SelfService - Get single vacant shift
API Url
Used in Self-service for loading a single vacant shift by unique id.
http://localhost:16010/ProMarkREST/rest/SelfService/offers/{id}
Permissions: user
Path parameters
| Field | Type | Description |
|---|---|---|
| id | Number | Unique identifier of the vacant shift request. |
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","acceptBefore": "2017-06-07","comment": "Need a stand in. Anybody?","statusCode": 0,"statusMessage": "Vacant shift","actions": [{"id": "cancel","name": "Cancel"]]}]},"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. |