SelfService - Offer a shift
API Url
Used in Self-service for selling (offering) a shift. After this is done, the shift will be vacant.
http://localhost:16010/ProMarkREST/rest/SelfService/offers
Permissions: user
Parameter
| Field | Type | Description |
|---|---|---|
| request | Object | Main object containing the request data. |
| data | Object | Object containg data to be uploaded. |
| offers | Object[] | Object containing shifts to sell. |
acceptBeforeoptional | Date | Date until you want the shift to be accepted. |
| attendanceDate | Date | Shift attendance date. |
| clockIn | Date | Shift start date-time as ISO-8601. |
| clockOut | Date | Shift end date-time as ISO-8601. |
commentoptional | String | Comment on the shift offer. Will be seen by other employees. |
| dayProfileId | String | The day profile ID of the shift. |
| empId | String | The employee ID. Owner of the shift. |
Request example:
{"request": {"data": {"offers": [{"empId": "414","attendanceDate": "2017-06-07","dayProfileId": "SH1","clock-in": "2017-06-07T07:00:00.000","clock-out": "2017-06-07T19:00:00.000","acceptBefore": "2017-06-06","comment": "Need a stand in. Anybody?"}]}}}
Success 200
| Field | Type | Description |
|---|---|---|
| response | Object | Main object containing the response data. |
| data | Object | Object containing the requested data. |
| statusCode | Number | Status code of the 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 request. |
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": {"statusCode": 0,"statusMessage": "The shift is now on offer"},"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. |
Error example:
HTTP/1.1 200 OK{"response": {"data": {},"errorCode": 10"errorMessage": "An open self service request already exists for employee John Doe"}}