Get service associations by employee
This endpoint returns an employee’s service associations.
GET /api/v1/business/{businessId}/person/{personId}/service-associations
If the data in the request is correct —both businessId and personId— the response will contain all service associations for the employee specified.
Below is an example response:
[
{
"ownerProduct": "0001-G",
"product": "0001-G",
"from": "2021-06-25",
"splitPresence": true,
"unplannable": false,
"roles": [],
"disponibility": [
{
"from": "2021-06-25",
"ranges": [
{
"dayType": "ALL",
"startMinuteDay": 0,
"duration": 1440
}
]
}
],
"regularCessions": [
{
"product": "0003",
"minutes": 240,
"days": [
"TUESDAY"
]
}
],
"service": "0001",
"person": {
"name": "John",
"surname": "Smith",
"birthday": "1987-05-07",
"employeeId": "152015",
"virtual": false
}
},
{
"ownerProduct": "0001-G",
"product": "0002",
"from": "2024-10-08",
"to": "2024-10-15",
"splitPresence": false,
"unplannable": false,
"roles": [],
"disponibility": [
{
"from": "2024-10-08",
"to": "2024-10-15",
"ranges": [
{
"dayType": "ALL",
"startMinuteDay": 0,
"duration": 1440
}
]
}
],
"service": "0002",
"person": {
"name": "John",
"surname": "Smith",
"birthday": "1987-05-07",
"employeeId": "152015",
"virtual": false
}
}
]
As shown in the example, the response data depends on the information defined for the employee.
In this case, the employee has a service association with product 0001-G
from 2021-06-25
, with a regular cession of four hours on Tuesdays to 0003
, and a cession from 2024-10-08
to 2024-10-15
to product 0002
.
Considerations
The request will return all service associations and cessions for the employee. If there are regular cessions defined within any of the associations, they will also appear in the response.
If the employee identifier provided in the URL does not exist within the business, the request will return a 404 Not Found
error, specifying Employee not found in the message.
If there are no service associations for the employee (neither active nor completed), the request will return an empty array []
.
Useful links
What is a service association? And what is a cession?