Skip to main content

Client Contacts API

General notes

Content

Client Contacts collection:

Single role:

Clients collection

Client Contacts index

This method needs permission access on client-contacts.

Request

Index behaviourDefinition
Paginated by defaultNo
Sortingid, email, client_id, is_active, is_primary
Filtersid:int, email:string, client_id:int, is_active:bool, is_primary:bool
Embedded-
GET /api/v0/client-contacts HTTP/1.1
Content-Type: application/json

Response

200 OK

{
"items": [
{
"id": 1,
"client_id": 2,
"email": "a@simplo.cz",
"is_active": true,
"is_primary": false,
"_links": [
{
"href": "/api/v0/client-contacts/1",
"rel": "self",
"type": "GET"
}
]
}
]
}

Create Client Contacts

This method needs permission create on client-contacts.

Request

ParamTypeDescriptionRequirements
emailstringContact emailRequired.
client_idintClient IdentifierRequired.
is_activeboolIs contact active flag.Required.
is_primaryboolIs contact primary flag.Required.
POST /api/v0/client-contacts HTTP/1.1
Content-Type: application/json
{
"client_id": 2,
"email": "a@simplo.cz",
"is_active":true,
"is_primary":false
}

Response

201 CREATED

{
"id": 1,
"client_id": 2,
"email": "a@simplo.cz",
"is_active": true,
"is_primary": false,
"_links": [
{
"href": "/api/v0/client-contacts/1",
"rel": "self",
"type": "GET"
}
]
}

422 UNPROCESSABLE ENTITY

Validation error occurred.

403 FORBIDDEN

Unauthorized.



Single Client Contact

Client Contact detail

GET /api/v0/client-contacts/{contact_id}

This method needs permission read on client-contacts.

Request

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

Response

200 OK

{
"id": 1,
"client_id": 2,
"email": "a@simplo.cz",
"is_active": true,
"is_primary": false,
"_links": [
{
"href": "/api/v0/client-contacts/1",
"rel": "self",
"type": "GET"
}
]
}

404 NOT FOUND

Not found.


Update Client Contact

PUT/PATCH /api/v0/client-contacts/{contact_id}

This method needs permission update on client-contacts.

Request

ParamTypeDescriptionRequirements
emailstringContact email
client_idintClient Identifier
is_activeboolIs contact active flag.
is_primaryboolIs contact primary flag.

For PATCH method any field can be omitted.

PATCH /api/v0/client-contacts/5 HTTP/1.1
Content-Type: application/json
{
"email": "b@simplo.cz",
}

Response

200 OK

Successfully updated.

404 NOT FOUND

Not found.

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

422 UNPROCESSABLE ENTITY

Validation error occurred.

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

Delete Client Contact

DELETE /api/v0/client-contacts/{contact_id}

This method needs permission delete on client-contacts.

Request

DELETE /api/v0/client-contacts/5 HTTP/1.1
Content-Type: application/json

Response

204 NO CONTENT

Successfully deleted.

404 NOT FOUND

Not found.