General - Get all absences for an employee
API Url
Used to get all absences for an employee.
http://localhost:16010/ProMarkREST/rest/General/employees/{empId}/absences
Permissions: user
Request headers
| Field | Type | Description |
|---|---|---|
Accept-Languageoptional | String | =en-GB Language use for localization. |
X-Clientoptional | String | =Client type. "Portal""Mobile""Admin" |
X-Roleoptional | Number | ProMark role (1: Employee, 2: User). {12} |
X-WebPart-Idoptional | Number | Unique web-part identifier. |
Path parameters
| Field | Type | Description |
|---|---|---|
| empId | String | Employee Id. |
Query parameters
| Field | Type | Description |
|---|---|---|
absenceTypeoptional | String | Absence type (1: All-day, 2: Anytime, 3: Before Clock-in, 4: After Clock-out, 5: All-shift). |
endDateoptional | Date | End date for absences, Default : TODAY. |
startDateoptional | Date | Start date for absences, Default: TODAY. |
Success 200
| Field | Type | Description |
|---|---|---|
| response | Object | Main object containing the response data. |
| data | Object | Object containing the requested data. |
| absences | Object[] | Collection of absence intervals. |
activityoptional | String | Activity Id |
approvalDateoptional | Number | Date of the absence approval. |
approvalStatusoptional | Number | Approval status of the registration (0: No approval needed, 1: Pending approval, 2: Approved, 3: Rejected). |
approvalStatusDescoptional | String | Description for the approval status. |
approverInitialsoptional | String | Initials of the absence approver. |
| attendanceDate | Date | Attendance date of absence. |
backColoroptional | String | The reason background color. |
| code | String | The reason code (identifier). |
| description | String | The reason description. |
| empId | String | The employee ID. |
endTimeoptional | Number | End time of day in seconds. |
foreColoroptional | String | The reason foreground color. |
hoursoptional | Number | The absence time expressed in seconds. It's not needed if reason code is set-up as being percent of normal time. |
| id | String | Unique identifier for the absence object. |
| isCompanyAbs | Boolean | TRUE = Absence from Company Calendar. |
projectoptional | String | Project Id |
| readOnly | Boolean | TRUE = Registration is read only (approved and not allowed to delete). |
| shortDescription | String | The reason short description. |
startTimeoptional | Number | Start time of day in seconds. |
| type | Number | Absence type (1: All-day, 2: Anytime, 3: Before Clock-in, 4: After Clock-out, 5: All-shift). 1-5 |
messageoptional | Object | Object containing response messages. |
| code | Number | Message code. |
| text | String | Message text. |
| type | String | Type of message. "warning""info" |
Success example with a single shift:
HTTP/1.1 200 OK{"response": {"data": {"absences": [{"id": "2153604964~\u00002~\u000030600""empId": "804","attendanceDate": "2017-06-22","type": 2,"code": "W","description": "Illness","shortDescription": "Ill","hours": 0,"startTime": 30600,"endTime": 34200,"isCompanyAbs": false}]},"erorCode": 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. |
Error example:
HTTP/1.1 404 Not found{"response": {"errorCode": 5,"errorMessage": "No employees"}}