Get assignments by employee
This endpoint returns the assignments of an employee within a period not exceeding 31 days.
GET /api/v1/businesses/{businessId}/employees/{employeeId}/assignments/from/{yyyy-MM-dd}/to/{yyyy-MM-dd}
If the data included in the request is correct —businessId and employeeId— the response will contain the employee assignments for that period.
Below is an example of the response:
[
{
"product": "0001-G",
"blockedType": "NONE",
"person": "152021",
"day": "2024-09-16",
"presence": {
"worked": false,
"timeFrames": [
{
"startMinuteDay": 0,
"duration": 1425,
"paid": false,
"worked": false
}
]
}
},
{
"product": "0001-G",
"blockedType": "NONE",
"person": "152021",
"day": "2024-09-17",
"presence": {
"worked": true,
"timeFrames": [
{
"startMinuteDay": 480,
"duration": 120,
"paid": true,
"location": {
"color": "#00ADDC",
"description": "Changes on the display in SRA department",
"name": "MERCHANDISING SRA",
"shortName": "LW",
"requiredLevel": 3,
"priority": 5,
"type": "FIXED",
"shouldAvoidOvercover": false,
"system": false,
"category": "MERCHANDISING",
"product": "0001-G",
"id": "03"
},
"worked": true
},
{
"startMinuteDay": 600,
"duration": 180,
"paid": true,
"location": {
"color": "#1ab39f",
"description": "Customer Assistance",
"name": "FITTING ROOM",
"shortName": "FR",
"requiredLevel": 3,
"priority": 3,
"type": "VARIABLE",
"shouldAvoidOvercover": false,
"system": false,
"category": "FITTING ROOM",
"product": "0001-G",
"id": "06"
},
"worked": true
},
{
"startMinuteDay": 420,
"duration": 60,
"paid": true,
"location": {
"color": "#000000",
"description": "Management tasks by General Manager",
"name": "MANAGEMENT",
"shortName": "MG",
"requiredLevel": 3,
"priority": 5,
"type": "FIXED",
"shouldAvoidOvercover": false,
"system": false,
"category": "MANAGEMENT",
"product": "0001-G",
"id": "01"
},
"worked": true
},
{
"startMinuteDay": 780,
"duration": 60,
"paid": false,
"worked": false
},
{
"startMinuteDay": 840,
"duration": 240,
"paid": true,
"location": {
"color": "#1ab39f",
"description": "Customer Assistance",
"name": "FITTING ROOM",
"shortName": "FR",
"requiredLevel": 3,
"priority": 3,
"type": "VARIABLE",
"shouldAvoidOvercover": false,
"system": false,
"category": "FITTING ROOM",
"product": "0001-G",
"id": "06"
},
"worked": true
}
]
}
}
]
The first assignment in the example corresponds to a day off, as the worked
field in the presence is false
.
In the second assignment, the worked
field in the presence is true
and it indicates the characteristics of the tasks performed by the employee in each timeFrame
. Additionally, a rest period between tasks is also included.
The level of detail in the response will depend on the business configuration for the different tasks.
Considerations
If there are no assignments for the indicated period, the request will return an empty array []
.
If the employee specified in the URL does not exist in the business, the request will return a 404 Not Found
error, specifying in the message Person X does not exist.
If the interval specified in the URL exceeds 30 days, the request will return a 406 Not Acceptable
error, specifying in the message The request exceeded the maximum number of days allowed.