Get incremental changes
This endpoint returns the assignments that have undergone changes from the date indicated in the request to the current date.
GET /api/v1/businesses/{businessId}/assignments/incremental?since={yyyy-MM-ddTHH:mm:ss.SSS}
If the data included in the request is correct, the response will contain the assignments that have changed from the date indicated in the since
parameter to the current date.
This parameter must be a date within the last 45 days in UTC format.
This is a paginated response, so after the first call, the response headers will include a cursor to the next page (next
) that indicates the URL of the next incremental assignments request.
To get the next page of data, it is necessary to make a request to that URL with the cursor:
GET /api/v1/businesses/{businessId}/assignments/incremental?cursor=*******
It is necessary to repeat this process until the response no longer contains the next
header, indicating that pagination is complete and there is no more data to display.
Example
[
{
"product": "0001-G",
"day": "2024-07-17",
"assignments": [
{
"person": "1006355",
"orquestId": 3456,
"presence": {
"worked": false,
"timeFrames": [
{
"startMinuteDay": 0,
"duration": 1425,
"paid": false,
"worked": false
}
]
},
"virtual": false
},
{
"person": "1006356",
"orquestId": 1234,
"presence": {
"worked": true,
"timeFrames": [
{
"startMinuteDay": 570,
"duration": 180,
"paid": true,
"location": {
"color": "#738ac8",
"description": "Carrying out opening tasks: opening boxes, reviewing funds",
"name": "KITCHEN OPENING",
"shortName": "KO",
"requiredLevel": 3,
"priority": 4,
"type": "VARIABLE",
"shouldAvoidOvercover": true,
"system": false,
"category": "ADMINISTRATIVE",
"product": "0001-G",
"id": "KITCHEN_OPENING"
},
"worked": true
},
{
"startMinuteDay": 420,
"duration": 150,
"paid": true,
"location": {
"color": "#ffffff",
"description": "Carrying out merchandise unloading",
"name": "Truck Unloading",
"shortName": "TU",
"requiredLevel": 3,
"priority": 5,
"maxResources": 1,
"type": "FIXED",
"shouldAvoidOvercover": true,
"system": false,
"category": "ADMINISTRATIVE",
"product": "0001-G",
"id": "Truck_Unloading"
},
"worked": true
}
]
},
"virtual": false
}
]
},
{
"product": "0002-G",
"day": "2024-07-03",
"assignments": [
{
"person": "1006359",
"orquestId": 6789,
"presence": {
"worked": false,
"timeFrames": [
{
"startMinuteDay": 0,
"duration": 1425,
"paid": false,
"worked": false
}
]
},
"virtual": false
}
]
}
]
As shown in the example, assignments are grouped by product and day. |
The purpose of this endpoint is to allow a client to make recurring requests to keep their data updated without having to perform excessively complex update processes. Therefore, this request provides a list showing the current state of assignments so that only outdated data needs to be overwritten.
For example, if an assignment for an employee on a specific day is deleted, the API returns the assignments for the entire day for the involved product.
Considerations
Orquest only stores the last 45 days of incremental changes. If the client does not make an incremental change request within that time period, a complete assignment request will need to be made.
Due to the complexity of the data, it is difficult to know if an element has changed when making bulk modifications. For example, when publishing a draft, assignments may change in bulk, but the result appears unchanged because an identical assignment has replaced another.
Since assignments are grouped into larger concepts, it is possible to record a change on a day regardless of how many individual assignments have changed for that day. Therefore, it is common to receive entities that seem unchanged because they are part of a larger concept that has changed.
Using this endpoint requires that the functionality be activated in advance by the Orquest team, due to its computational and memory costs when performing audits on certain entities. Therefore, it will be necessary to analyze the use case and manage its activation. |
Useful links
What is an assignment?