ProRoster - Insert absences
API Url
Use it for inserting an absence to ProSchedule
http://localhost:16010/ProMarkREST/rest/ProRoster/absences
Permissions: user
Query parameters
| Field | Type | Description |
|---|---|---|
| empIds | String | List of employees for which the absence will be inserted |
| forceAssign | Boolean | True = Will ignore the warning. False = Will perform the validations |
| from | Date | The interval start date |
| planId | String | The plan id |
| publish | Boolean | True = Publish the absences |
| to | Date | The interval end date |
Parameter
| Field | Type | Description |
|---|---|---|
| request | Object | Main object containing the request data. |
| data | Object | Object containg data to be uploaded. |
| absences | Object[] | |
| code | String | Absence reason code. |
commentoptional | String | Comment on absence. |
| date | Date | Date when absence is inserted. |
| empId | String | The employee unique identifier. |
fromoptional | Number | Start time of absences in seconds from midnight. |
tooptional | Number | End time of absences in seconds from midnight. |
Request example of all-day absence:
HTTP/1.1 200 OK{"request": {"data": {"absences": [{"empId": "456","date": "2018-07-22","code": "Doctor","comment": "Medical Appointment"}]}}}
Request example of partial absence:
HTTP/1.1 200 OK{"request": {"data": {"absences": [{"empId": "456","date": "2018-07-22","to": 39600,"code": "Doctor","comment": "Medical Appointment"}]}}}
Success 200
| Field | Type | Description |
|---|---|---|
| response | Object | Main object containing the response data. |
| data | Object | Object containing the requested data. |
| absences | Object[] | |
backColoroptional | String | Reason background color as HEX without #. |
| code | String | Absence reason code. |
commentoptional | String | Comment on absence. |
| date | Date | Date when absence is inserted. |
| description | String | Absence reason description. |
| empId | String | Employee ID. |
foreColoroptional | String | Reason foreground color as HEX without #. |
fromoptional | Number | Start time of absences in seconds from midnight. |
| id | String | Unique identifier of the absence. |
| isPublished | Boolean | TRUE if the absence was published. |
tooptional | Number | End time of absences in seconds from midnight. |
messageoptional | Object | Object containing response messages. |
| code | Number | Message code. |
| text | String | Message text. |
| type | String | Type of message. "warning""info" |
Response example of all-day absence:
HTTP/1.1 200 OK{"response": {"data": {"absences": [{"id": "1234567890","empId": "404","date": "2018-07-22","code": "Doctor","description": "Doctor's appointment","foreColor": "ffffff","backColor": "000000","comment": "Medical Appointment as agreed"}]}}}
Error 4xx
| Field | Type | Description |
|---|---|---|
| response | Object | Main object containing the response data. |
| data | Object | Object containing the requested data (empty). |
| errorCode | Number | Error code. |
| errorMessage | String | Error description. |
Error example:
HTTP/1.1 422{"request": {"data": {},"errorCode": 65,"errorMessage": "There are errors when inserting this absence"}
Error example when forceInsert = false:
HTTP/1.1 422{"response": {"data": {"assignedDemands": [{"id": 2163162849,"empId": "953","date": "2018-10-14","demandId": 2163162390,"planId": 2163133252,"name": "Casino Host","description": "Casino Host","foreColor": "FFD500","backColor": "678DB6","version": 2,"isPublished": true,"normalTime": [{"isRequired": false,"isLocked": false}],"dayProfile": [{"id": "0600-1430","startTime": 21600,"endTime": 52200,"description": "Day Mon-Fri 8 hours","isVariable": false,"isRequired": false,"isLocked": false}],"department": [{"description": "Hotel Summer department","isRequired": false,"isLocked": false}],"group": [{"isRequired": false,"isLocked": false}],"approvalGroup": [{"isRequired": false,"isLocked": false}],"category": [{"isRequired": false,"isLocked": false}]}]},"errorCode": 24,"errorMessage": "The absence is overlapping some of the demands"}}