SelfService - Update swop request
API Url
Used in Self-service for updating an existing swop request. Primarily used for changing status of request: Cancel, Accept, Decline.
http://localhost:16010/ProMarkREST/rest/SelfService/swops
Permissions: user
Parameter
| Field | Type | Description |
|---|---|---|
| request | Object | Main object containing the request data. |
| data | Object | Object containg data to be uploaded. |
| swops | Object[] | Object containing the swop requests. |
acceptBeforeoptional | Date | Date until you want the request to be accepted (not updatable). |
| action | String | Action to be performed on the request ("cancel", "accept", "decline"). |
| attendanceDate | Date | Shift attendance date (not updatable). |
clockInoptional | Date | Shift start date-time as ISO-8601 (not updatable). |
clockOutoptional | Date | Shift end date-time as ISO-8601 (not updatable). |
commentoptional | String | Comment on the swop request (will be visible to other employees, not updatable). |
| dayProfileId | String | The day profile ID of the shift (not updatable). |
| empId | String | The employee ID initiating the swop (owner of the shift, not updatable). |
| id | Number | Unique identifier of the swop request (not updatable). |
| swopWith | Object | Object containing the shift to be swoped with. |
| attendanceDate | Date | Shift attendance date (not updatable). |
clockInoptional | Date | Shift start date-time as ISO-8601 (not updatable). |
clockOutoptional | Date | Shift end date-time as ISO-8601 (not updatable). |
commentoptional | String | Comment of the swoped employee. |
| dayProfileId | String | The day profile ID of the shift (not updatable). |
| empId | String | The employee ID, owner of the shift to be swoped with (not updatable). |
Request example:
{"request": {"data": {"swops": [{"empId": "414","attendanceDate": "2017-06-07","dayProfileId": "SH1","clockIn": "2017-06-07T08:00:00","clockOut": "2017-06-07T16:00:00","acceptBefore": "2017-06-06","comment": "Can anybody exchange shift with me?","swopWith":{"empId": "769","attendanceDate": "2017-06-07","dayProfileId": "EH2","clockIn": "2017-06-07T13:00:00","clockOut": "2017-06-07T22:00:00",},"action": "accept"}]}}}
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": 3,"statusMessage": "Approved by employee, waiting for manager/approver"},"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. |