Get last draft by product
This endpoint returns the last draft of a product for the specified day in the request.
GET /api/v1/businesses/{businessId}/products/{productId}/last-draft?day={yyyy-MM-dd}
If the data included in the request is correct —both businessId and productId—, the response will contain the last draft with its assignments.
Below is an example of the response:
{
"orquestId": 1234567,
"from": "2025-04-28",
"to": "2025-05-04",
"assignments": [
{
"product": "0001-GENERAL",
"blockedType": "NONE",
"person": "001",
"day": "2025-05-04",
"presence": {
"worked": true,
"timeFrames": [
{
"startMinuteDay": 540,
"duration": 420,
"paid": true,
"location": {
"color": "#003e75",
"description": "",
"name": "Outbound",
"shortName": "OUT",
"requiredLevel": 3,
"priority": 1,
"type": "VARIABLE",
"shouldAvoidOvercover": false,
"system": false,
"category": "2-O",
"product": "0001-GENERAL",
"id": "006",
"zone": "General"
},
"worked": true
}
]
}
},
{
"product": "0001-GENERAL",
"blockedType": "NON_EXTENSIBLE_WORK",
"person": "002",
"day": "2025-05-01",
"presence": {
"worked": false,
"timeFrames": [
{
"startMinuteDay": 540,
"duration": 960,
"paid": false,
"worked": false
}
]
}
}
]
}
Considerations
The level of detail in the response will depend on the configuration set in the business for the different tasks.
If there is no draft for the requested date, the request will return a 404 Not Found
error.
If the product specified in the URL does not exist in the business, the request will return a 404 Not Found
error, with the message indicating not exits.
Useful links
What is an assignment? How is its structure?
What is a task?