SelfService - Get vacant shifts
API Url
Used in Self-service for loading vacant shifts (offered by others) for all allowed employees.
http://localhost:16010/ProMarkREST/rest/SelfService/offers
Permissions: user
Query parameters
| Field | Type | Description |
|---|---|---|
addEmpIdoptional | String | List of employee IDs for which to see offers |
canForefillShiftsoptional | Boolean | true = Show only shifts you can take (default is false). |
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 (never in the past). Default is TODAY. |
tooptional | Date | Get data until this date. Default is 'from' + 7 days. |
Success 200
| Field | Type | Description |
|---|---|---|
| response | Object | Main object containing the response data. |
| data | Object | Object containing the requested data. |
| offers | Object[] | Collection of offered (vacant) shifts. |
acceptBeforeoptional | Date | Accept the offer before this date. |
actionsoptional | Object[] | List of actions that can be performed on the request. |
| id | String | Action identifier ("accept", "cancel", "decline"). |
| name | String | Short action name. |
| attendanceDate | Date | Attendance date of vacant shift as ISO-8601. |
| clockIn | Date | Clock-in date-time of the vacant shift as ISO-8601. |
| clockOut | Date | Clock-out date-time of the vacant shift as ISO-8601. |
commentoptional | String | Comment of the employee who initiated the offer. |
| dayProfileDesc | String | Day profile description of the vacant shift. |
| dayProfileId | String | Day profile ID of the vacant shift. |
| empId | String | Employee ID who initiated the offer (owner of shift). |
| empName | String | Name of employee who initiated the offer (owner of shift). |
| id | Number | Unique ID of the offer request. |
| 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 in case the vacant shift was taken by another employee. |
| attendanceDate | Date | Shift attendance date. |
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. |
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": {"offers": [{"id": 2153576626,"empId": "414","empName": "Soren Gent","attendanceDate": "2017-06-07","dayProfileId": "SH1","dayProfileDesc": "Morning shift","clockIn": "2017-06-07T07:00:00.000","clockOut": "2017-06-07T19:00:00.000","comment": "Need a stand in. Anybody?","statusCode": 0,"statusMessage": "Vacant shift","actions": [{"id": "accept","name": "Take"}]}]},"errorCode": 0,"errorMessage": ""}}
Success example of shift taken by another employee:
HTTP/1.1 200 OK{"response": {"data": {"offers": [{"id": 2153576626,"empId": "414","empName": "Soren Gent","attendanceDate": "2018-03-07","dayProfileId": "SH1","dayProfileDesc": "Morning shift","clockIn": "2018-03-07T07:00:00.000","clockOut": "2018-03-07T19:00:00.000","comment": "Need a stand in. Anybody?","statusCode": 3,"statusMessage": "Approved by employee, waiting for manager/approver","swopWith": {"empId": "625","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.",}}]},"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. |