Get active service associations
This endpoint returns the active service associations of a service.
GET /api/v1/businesses/{businessId}/services/{serviceId}/service-associations/active
If the data in the request is correct —both businessId and serviceId— the response will contain all service associations with an end date after the current date (or not set).
Below is a snippet of the 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
}
]
}
],
"service": "0001",
"person": {
"name": "John",
"surname": "Smith",
"birthday": "1987-05-07",
"employeeId": "152015",
"virtual": false
}
},
{
"ownerProduct": "0001-G",
"product": "0002",
"from": "2021-06-25",
"splitPresence": true,
"unplannable": false,
"roles": [],
"disponibility": [
{
"from": "2021-06-25",
"ranges": [
{
"dayType": "ALL",
"startMinuteDay": 0,
"duration": 1440
}
]
}
],
"service": "0001",
"person": {
"name": "Mark",
"surname": "Murphy",
"birthday": "1987-05-07",
"employeeId": "1006357",
"metadata": {
"position": "developer"
},
"virtual": false
}
},
{
"ownerProduct": "0001-G",
"product": "0001-G",
"from": "2021-10-01",
"splitPresence": true,
"unplannable": false,
"roles": [],
"disponibility": [
{
"from": "2021-10-01",
"ranges": [
{
"dayType": "ALL",
"startMinuteDay": 0,
"duration": 1440
}
]
}
],
"regularCessions": [
{
"product": "081818",
"minutes": 360,
"days": [
"MONDAY"
]
}
],
"service": "0001",
"person": {
"name": "Ann",
"surname": "Williams",
"birthday": "1987-05-07",
"employeeId": "1006356",
"virtual": false
}
},
{
"ownerProduct": "0001-G",
"product": "0002",
"from": "2024-10-02",
"to": "2024-10-16",
"splitPresence": false,
"unplannable": false,
"roles": [],
"disponibility": [
{
"from": "2024-10-02",
"to": "2024-10-16",
"ranges": [
{
"dayType": "ALL",
"startMinuteDay": 0,
"duration": 1440
}
]
}
],
"metadata": {
"code": "SSA"
},
"service": "0002",
"person": {
"name": "Emily",
"surname": "Cork",
"birthday": "1987-05-07",
"employeeId": "1006352",
"virtual": false
}
}
]
As shown in the example, the response data depends on the information that has been defined for each of the employees and the associations: whether there is metadata, regular cessions, etc.
Considerations
The request will return all service associations and cessions where the ownerProduct matches the products of the service specified in the URL.
If there are regular cessions defined for any employee of the service, they will also appear in the response.
Employees without an external identifier (employeeId) configured in the system will not appear in the response.
If there are no active 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?