Get current service associations
This endpoint returns the current service associations of a service.
GET /api/v1/businesses/{businessId}/services/{serviceId}/service-associations/current
If the data in the request is correct —both businessId and serviceId— the response will contain all service associations with a start date before the current date and an end date after the current date (or not set).
Response example
Below is a snippet of the response:
[
{
"ownerProduct": "0001-G",
"product": "0001-G",
"from": "2021-06-25",
"splitPresence": true,
"unplannable": false,
"employeeId": "152015",
"service": "0001"
},
{
"ownerProduct": "0001-G",
"product": "0001-G",
"from": "2021-06-25",
"splitPresence": true,
"unplannable": false,
"employeeId": "1006357",
"service": "0001"
},
{
"ownerProduct": "0001-G",
"product": "0002",
"from": "2024-10-08",
"to": "2024-10-15",
"splitPresence": false,
"unplannable": false,
"employeeId": "152015",
"service": "0002"
}
]
Details
-
ownerProduct*. External identifier of the product or section to which the employee belongs.
-
product*. External identifier of the product or section where the employee will work. It may be the same as
ownerProduct; if different, it is a cession. -
from*. The start date of the service association in the format
yyyy-MM-dd. -
to. The end date of the service association in the format
yyyy-MM-dd. It may benull, indicating that no end date is set. -
splitPresence. Determines whether it is a split shift. The default value is
true. -
unplannable. Determines whether the employee will be ignored by the scheduler and must be planned manually. The default value is
false. -
id. External identifier of the service association.
-
employeeId. External identifier of the employee.
-
service. External identifier of the service or store.
Considerations
The request will return all service associations and cessions where the ownerProduct matches the products of the service specified in the URL.
Regular cessions do not appear in the response.
If there are no current service associations, the request will return an empty array [].
If the service indicated in the URL does not exist within the business, the request will return a 404 Not Found error, specifying in the message not exits.
Useful links
What is a service association? And what is a cession?