SelfService - Get self-service requests
API Url
Used in Self-service for loading requests for approval.
http://localhost:16010/ProMarkREST/rest/SelfService/requests
Permissions: user
Query parameters
| Field | Type | Description |
|---|---|---|
approvalGroupoptional | String | Approval group Id used to filter data. If not sent, all will be used. |
approvalStatusoptional | Number | Approval status to filter data (1: Untreated, 2: Approved, 3: Rejected). If not sent, all will be returned. 1-3 |
empIdoptional | String | List of employee IDs with comma delimiter, used for filtering data. If not supplied, data for allowed employees will be returned. The list will be validated against list of allowed employees. If you want to remove an employee from list, then add a '-' in front of id. |
fromoptional | Date | Get data from this date forward. Default is TODAY. |
tooptional | Date | Get data until this date. Default is 'from' + 365 days. |
typeoptional | Number | Request type (1: Swop, 2: Vacant shifts, 3: Absence). If not sent, all will be returned. 1-3 |
Success 200
| Field | Type | Description |
|---|---|---|
| response | Object | Main object containing the response data. |
| data | Object | Object containing the requested data. |
| requests | Object[] | Collection of requests. |
actionsoptional | Object[] | List of actions that can be performed on the request. |
| id | String | Action identifier ("approve", "reject", "delete"). |
| name | String | Short action name. |
| attendanceDate | Date | Attendance date of vacant shift as ISO-8601. |
avatarURIoptional | String | URI used for loading the employee avatar. |
| clockIn | Date | Clock-in date-time of the shift as ISO-8601. |
| clockOut | Date | Clock-out date-time of the shift as ISO-8601. |
commentoptional | String | Comment of the employee who initiated the request. |
contactoptional | String | Contact person. Used on absence requests according to setup. |
| dayProfileDesc | String | Day profile description of the shift. |
| dayProfileId | String | Day profile ID of the shift. |
| empId | String | Employee ID who initiated the request (owner of shift). |
| empName | String | Name of employee who initiated the request (owner of shift). |
| empNo | String | Employee No who initiated the request (owner of shift). |
| id | Number | Unique request identifier. |
| initials | String | Employee Initials. |
reasonsoptional | Object[] | The absence reasons on absence requests (type = 3). |
backColoroptional | String | Absence reason background color as HEX without #. |
| code | String | The absence reason code. |
| description | String | The absence reason description. |
foreColoroptional | String | Absence reason text as HEX without #. |
hoursoptional | Number | The absence time expressed in seconds. It's not needed if reason code is set-up as being percent of normal time. |
| type | Number | Absence type (1: All-day, 2: Anytime, 3: Before Clock-in, 4: After Clock-out, 5: All-shift). 1-5 |
| sortEmpNo | String | Employee No used for sorting. |
| statusCode | Number | Status code of the offer request (0: Vacant shift, 1: Waiting for manager, 2: Wating for employee, 3: Approved by employee, waiting for manager/approver, 4: Approved by employee, waiting for 2nd manager/approver, 5: Rejected by employee, 6: Rejected by manager/approver, 7: Approved by manager/approver, 8: Approved, 99: Request was deleted). 0-99 |
| statusMessage | String | Status message of the offer request. In correlation with 'statusCode'. |
swopWithoptional | Object | Object containing the shift to be swoped with. Only for swop requests (type = 1) or vacant shift taken by another employee (type = 2). |
| attendanceDate | Date | Shift attendance date. |
avatarURIoptional | String | URI to the employee avatar. |
clockInoptional | Date | Shift start date-time as ISO-8601. |
clockOutoptional | Date | Shift end date-time as ISO-8601. |
commentoptional | String | Comment of the swoped employee. |
| dayProfileDesc | String | Day profile description of the vacant shift. |
| dayProfileId | String | The day profile ID of the shift. |
| empId | String | The employee ID, owner of the shift to be swoped with. |
| empName | String | Employee name, owner of shift to be swoped with. |
| empno | String | The employee No, owner of the shift to be swoped with. |
| initials | String | Employee initials |
| sortEmpNo | String | Employee No used for sorting. |
| type | Number | Request type (1: Swop, 2: Vacant shifts, 3: Absence). 1-3 |
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": {"requests": [{"id": 2153576626,"type": 1,"empId": "420","empNo": "1234","sortEmpNo": "!!!!1234","initials": "GJE","avatarURI: "rest/General/employees/420/avatar","empName": "Gitte Jensen","attendanceDate": "2018-03-07","dayProfileId": "SH1","dayProfileDesc": "Morning shift","clockIn": "2018-03-07T07:00:00.000","clockOut": "2018-03-07T15:00:00.000","comment": "Need a stand in. Anybody?","statusCode": 3,"statusMessage": "Approved by employee, waiting for manager/approver","swopWith": {"empId": "625","empNo": "6000","sortEmpNo": "!!!!6000","initials": "MOS","empName": "Mick Osbourn","attendanceDate": "2018-03-07","dayProfileId": "MH2","dayProfileDesc": "Evening shift","clockIn": "2018-03-07T15:00:00.000","clockOut": "2018-03-07T23:00:00.000","comment": "I will help you this time.",},"actions": [{"id": "approve","name": "Approve"},{"id": "reject","name": "Reject"},{"id": "delete","name": "Delete"}]},{"id": 123456789,"type": 3,"empId": "420","empNo": "4000","sortEmpNo": "!!!!4000","empName": "Gitte Jensen","initials": "GJE","avatarURI: "rest/General/employees/420/avatar","attendanceDate": "2018-04-07","dayProfileId": "SH1","dayProfileDesc": "Midday shift,"acceptBefore": "2018-04-06","comment": "Doctor appointment in the morning","statusCode": 3,"statusMessage": "Waiting for manager approval","reasons": [{"type": 3,"code": "DR","description": "Doctor","hours": 7200,"backColor": FFFFFF,"foreColor": 000000}],"actions": [{"id": "cancel","name": "Cancel"}]}]},"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. |