SelfService - Get absence reasons
API Url
Used in Self-service for loading absence reasons depending on absence request. Not all reasons are allowed and dependes on web-part setup.
http://localhost:16010/ProMarkREST/rest/SelfService/reasons
Permissions: user
Query parameters
| Field | Type | Description |
|---|---|---|
absenceTypeoptional | String | Absence type for which you need the reason list (1: All-day, 2: Anytime, 3: Before Clock-in, 4: After Clock-out, 5: All-shift). Default is 1. |
dateoptional | Date | Attendance date for which you need to insert the absence request. Default is TODAY. |
Success 200
| Field | Type | Description |
|---|---|---|
| response | Object | Main object containing the response data. |
| data | Object | Object containing the requested data. |
| reasons | Object[] | Collection of absence reasons. |
backColoroptional | String | The reason backcolor as HEX (without #). |
| code | String | The reason code (identifier). |
| description | String | The reason description. |
foreColoroptional | String | The reason forecolor as HEX (without #). |
| order | Number | Sort on this when displaying the list. |
percentoptional | Number | Percent out of normal time. There are reasons where absence time is set-up as beging a percent out of the normal time, so user does not need to insert the absence hours. |
messageoptional | Object | Object containing response messages. |
| code | Number | Message code. |
| text | String | Message text. |
| type | String | Type of message. "warning""info" |
Success example:
HTTP/1.1 200 OK{"response": {"data": {"reasons": [{"code": "HF","order": 1,"description": "Half-day holiday","foreColor": "FFFF00","backColor": "808000","percent": 50},{"code": "SS","order": 10,"description": "Sickness","foreColor": "FFFF00","backColor": "FF0000"}]},"errorCode": 0,"errorMessage": ""}}
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. |