Skip to main content

Clients API

General notes​

Embeddable fields​

NameTypeDescription
hourly_paysHourlyPay[]Array of hourly pays HourlyPay.
newest_projectProject[]Array of users assigned to project Project.
projects_countintClient's projects count.
profitarrayProfit, in money and percentage.
responsible_userUserClient's responsible User.

Content​

Roles collection:

Single role:

Client's notes:

Clients collection

Clients index​

This method needs permission access on clients.

Request​

Index behaviourDefinition
Paginated by defaultNo
Sortingid, name, goodday_id, address, city, postal_code, country_id, phone, fax, email, website, active, note, created_at, updated_at
Filtersid:enum, name:string, goodday_id:string, address:string, city: string, postal_code: string, country_id: string, phone: string, fax: string, email: string, website: string, active: bool, created_at: date, updated_at: date
Embedded-
GET /api/v0/clients HTTP/1.1
Content-Type: application/json

Response​

200 OK​

GET /api/v0/clients HTTP/1.1
Content-Type: application/json

{
"items": [
{
"id": 1,
"name": "Demo projects",
"goodday_id": "3MFGRZ",
"address": null,
"city": null,
"postal_code": null,
"country_id": null,
"phone": null,
"fax": null,
"email": null,
"website": null,
"active": true,
"note": null,
"created_at": "2022-11-23T15:59:55+0100",
"updated_at": "2022-11-23T15:59:55+0100",
"_links": [
{
"href": "/api/v0/clients/1",
"rel": "self",
"type": "GET"
}
]
}
]
}


Single client

Client detail​

GET /api/v0/clients/{client_id}

This method needs permission read on clients.

Get Client detail.

Request​

Index behaviourDefinition
Embedded-

Request​

GET /api/v0/clients/1 HTTP/1.1
Content-Type: application/json

Response​

200 OK​

GET /api/v0/clients/1 HTTP/1.1
Content-Type: application/json

{
"id": 1,
"name": "Demo projects",
"goodday_id": "3MFGRZ",
"address": null,
"city": null,
"postal_code": null,
"country_id": null,
"phone": null,
"fax": null,
"email": null,
"website": null,
"active": true,
"note": null,
"created_at": "2022-11-23T15:59:55+0100",
"updated_at": "2022-11-23T15:59:55+0100",
"_links": [
{
"href": "/api/v0/clients/1",
"rel": "self",
"type": "GET"
}
]
}

404 NOT FOUND​

Role was not found.

GET /api/v0/clients/2 HTTP/1.1
Content-Type: application/json
Status-Code: 404

{
"type": "NotFound",
"message": "Required model was not found.",
"id": "0cd85449-05fe-4866-9802-8192e6785fc7"
}

Update Client​

PUT/PATCH /api/v0/clients/{client_id}

This method needs permission update on clients.

Method for updating Client data.

Request​

ParamTypeDescriptionRequirements
namestringClient nameSometimes. Has to be string. Max length is 150 chars.
addressstringClient addressSometimes. Has to be string. Max length is 255 chars.
citystringClient citySometimes. Has to be string. Max length is 255 chars.
postal_codestringClient postal codeSometimes. Has to be string. Max length is 255 chars.
country_idstringClient country_idSometimes. Has to be string. Max length is 20 chars.
phonestringClient phoneSometimes. Has to be string. Max length is 255 chars.
faxstringClient faxSometimes. Has to be string. Max length is 100 chars.
emailstringClient emailSometimes. Has to be string. Max length is 100 chars.
websitestringClient websiteSometimes. Has to be string. Max length is 100 chars.
activeboolActivity flagSometimes. Has to be boolean. Max length is 255 chars.
notestringClient noteSometimes. Has to be string. Max length is 255 chars.

For PATCH method any field can be omitted.

PATCH /api/v0/clients/1 HTTP/1.1
Content-Type: application/json

{
"name": "Demo clientx",
}

Response​

200 OK​

Client successfully updated.

PATCH /api/clients/3 HTTP/1.1
Content-Type: application/json

{
"id": 1,
"name": "Demo clientx",
"goodday_id": "3MFGRZ",
"address": null,
"city": null,
"postal_code": null,
"country_id": null,
"phone": null,
"fax": null,
"email": null,
"website": null,
"active": true,
"note": null,
"created_at": "2022-11-23T15:59:55+0100",
"updated_at": "2022-11-24T16:19:09+0100",
"_links": [
{
"href": "/api/v0/clients/1",
"rel": "self",
"type": "GET"
}
]
}

404 NOT FOUND​

Client was not found.

PATCH /api/clients/2 HTTP/1.1
Content-Type: application/json
Status-Code: 404

{
"type": "NotFound",
"message": "Required model was not found.",
"id": "0cd85449-05fe-4866-9802-8192e6785fc7"
}

422 UNPROCESSABLE ENTITY​

Validation error occurred.

PUT /api/clients HTTP/1.1
Content-Type: application/json

{
"type" : "ValidationError",
"message" : "The given data was invalid.",
"id" : "fe1b04de-b347-43b5-8118-864c1eefaccf",
"errors": [
{
"field": "name",
"message": "The name field is required."
}
]
}

Client notes index​

GET /api/v0/clients/{client_id}/notes

This method needs permission access on notes.

Get list of existing client Notes.

Request​

Index behaviourDefinition
Paginated by defaultYes
Sortingid, noteable_type, noteable_id, text, user_id, created_at, updated_at
Filtersid:enum, noteable_type:string, noteable_id:int, text:string, user_id:int, created_at:date,updated_at:date
GET /api/v0/clients/1/notes HTTP/1.1

Responses​

200 OK​

GET /api/v0/clients/1/notes HTTP/1.1
Content-Type: application/json

{
"items": [
{
"id": 1,
"noteable_type": "App\\Containers\\Clients\\Clients\\Models\\Client",
"noteable_id": 2,
"text": "Note update text",
"user_id": 1,
"created_at": "2023-01-05T15:35:48+0100",
"updated_at": "2023-01-06T11:11:51+0100",
"_links": [
{
"href": "/api/v0/notes/1",
"rel": "self",
"type": "GET"
}
]
},
{
"id": 2,
"noteable_type": "App\\Containers\\Clients\\Clients\\Models\\Clients",
"noteable_id": 2,
"text": "test poznamky",
"user_id": 1,
"created_at": "2023-01-05T15:37:12+0100",
"updated_at": "2023-01-05T15:37:12+0100",
"_links": [
{
"href": "/api/v0/notes/2",
"rel": "self",
"type": "GET"
}
]
}
],
"_meta": {
"page": 1,
"total_pages": 1,
"records": 2,
"per_page": 100
}
}

Create client note​

POST /api/v0/clients/{client_id}/notes

This method needs permission create on notes.

Create client Note.

Request​

ParamTypeDescriptionRequirements
textstringUser's first nameRequired.
user_idintAuthor's User idRequired.
POST /api/v0/clients/1/notes HTTP/1.1

{
"text": "test poznamky"
"user_id": 2,
}

Responses​

200 OK​

POST /api/v0/clients/1/notes HTTP/1.1
Content-Type: application/json

{
"id": 9,
"noteable_type": "App\\Containers\\Clients\\Clients\\Models\\Client",
"noteable_id": 1,
"text": "User note test",
"user_id": 2,
"created_at": "2023-01-06T12:01:55+0100",
"updated_at": "2023-01-06T12:01:55+0100",
"_links": [
{
"href": "/api/v0/notes/9",
"rel": "self",
"type": "GET"
}
]
}