Get assignments by product
This endpoint returns the assignments for a product within a period not exceeding 31 days.
GET /api/v2/business/{businessId}/products/{productId}/assignments/from/{yyyy-MM-dd}/to/{yyyy-MM-dd}
If the data included in the request is correct —both the businessId and the productId—, the response will contain the product assignments for that period.
Response example
[
{
"product": "0001-G",
"blockedType": "NONE",
"person": "1006352",
"day": "2024-09-17",
"presence": {
"worked": false,
"timeFrames": [
{
"startMinuteDay": 0,
"duration": 1440,
"paid": false,
"worked": false
}
]
},
"virtual": false
},
{
"product": "0001-G",
"blockedType": "NONE",
"person": "222",
"day": "2024-09-16",
"presence": {
"worked": true,
"timeFrames": [
{
"startMinuteDay": 525,
"duration": 60,
"paid": true,
"location": {
"color": "#5fe7d5",
"description": "Daily truck unloading",
"name": "Unloading",
"shortName": "DTU",
"requiredLevel": 3,
"priority": 5,
"maxResources": 2,
"type": "FIXED",
"shouldAvoidOvercover": true,
"system": false,
"category": "OPERATIONAL",
"product": "0001-G",
"id": "08",
"zone": "General"
},
"worked": true
},
{
"startMinuteDay": 600,
"duration": 300,
"paid": true,
"location": {
"color": "#007dea",
"name": "Fitting rooms",
"shortName": "FR",
"requiredLevel": 1,
"priority": 5,
"maxResources": 3,
"type": "VARIABLE",
"shouldAvoidOvercover": false,
"system": false,
"category": "OPERATIONAL",
"product": "0001-G",
"id": "07",
"zone": "General"
},
"worked": true
}
]
},
"virtual": false
}
]
Details
-
product: external identifier of the product (section) to which the assignment belongs.
-
blockedType: if the assignment is blocked and how (
NONE,EXTENSIBLE_WORK,NON_EXTENSIBLE_WORK,EXTENSIBLE_TIME,NON_EXTENSIBLE_TIME,DAILY_WORKED). -
person: employee external identifier.
-
day: day of the assignment in
yyyy-MM-ddformat. -
presence: type of assignment that contains the work periods (timeFrames) with their locations. It contains the following fields:
-
startTime: the start time of the presence in minutes from the beginning of the day (00:00). It can be
null, as the actual start time can be calculated as the sum of the durations of its time periods (timeFrames). -
duration: the duration in minutes of the entire presence. Can be
null, as the actual duration can be calculated as the sum of the durations of its timeFrames. -
worked: whether the type of assignment or presence is worked (
true) or if it is a rest day (false). -
timeFrames: set of time intervals that contain the tasks to be performed. For each interval, the following information is included:
-
startMinuteDay: start of the interval in minutes elapsed since the beginning of the day (00:00).
-
duration: duration of the interval in minutes.
-
paid: whether the interval, whether work or rest, is paid (
true) or not (false). -
worked: determines if the timeFrame has an assigned task (
true) or not (false). -
location: task to be performed in the defined interval. For each task, the following information is included:
-
color: color configured in Orquest for the task.
-
description: description of the task defined in Orquest.
-
name: name of the task in Orquest.
-
shortName: task abbreviation in Orquest.
-
requiredLevel: skill level required to perform the task. Ranges from
0(no training needed) to3(maximum training level) and must be previously configured in Orquest. -
priority: priority of task coverage. Ranges from
0(low) to5(high) and must be previously configured in Orquest. -
maxResources: limit of people for the task.
-
type: type of task, whether it is fixed, variable, or non-plannable (
FIXED,VARIABLE,NON_PLANIFIABLE). -
shouldAvoidOvercover: if this parameter is
true, the task will not be overcovered. -
system: determines if the task was created by the system (
true) or by the user (false). -
category: category of the task previously configured in Orquest.
-
product: external identifier of the product or section.
-
id: external identifier of the task.
-
metadata: any additional data that has been previously configured for the task in Orquest. The metadata structure must be previously configured.
-
zone: physical place in the service (store, restaurant, etc.) where the location is carried out.
-
-
-
-
virtual: indicates whether the employee is virtual (
true) or real (false).
The first assignment in the example corresponds to a rest day, as the worked field in the presence object is false.
Additionally, it only has one timeFrame with no associated task, which spans the entire day, and both the paid and worked fields are also marked as false.
In the second assignment of the example, the worked field is true, and the characteristics of the tasks performed by the employee are indicated in each timeFrame.
The level of detail in the response will depend on the configuration established in the business for different tasks.
Considerations
If there are no assignments for the specified time period, the request will return an empty array [].
If the product specified in the URL does not exist in the business, the request will return a 404 Not Found error, specifying in the message not exists.
If the time range specified in the URL exceeds 31 days, the request will return a 406 Not Acceptable error, specifying the message The request exceeded the maximum number of days allowed.
Useful links
What is an assignment?
What is a task?