ProRoster - Preview swaps
API Url
Use it for returning a preview or commiting a swap.
http://localhost:16010/ProMarkREST/rest/ProRoster/plans/{id}/swaps
Permissions: user
Path parameters
| Field | Type | Description |
|---|---|---|
| id | Number | The id of the plan. |
Query parameters
| Field | Type | Description |
|---|---|---|
isPreviewoptional | Boolean | Determines if the request is for returning the preview Or commiting the swap. |
Parameter
| Field | Type | Description |
|---|---|---|
| shifts | Object[] | The source shift to swap with. |
| date | Date | The source date. |
| empId | String | The source emp id. |
shiftIdoptional | String | The source shift id , if not sent its a swap day. |
| swapWith | Object[] | The Target shift to swap with. |
| date | Date | The source date. |
| empId | String | The source emp id. |
shiftIdoptional | String | The source shift id , if not sent its a swap day. |
Success 200
| Field | Type | Description |
|---|---|---|
| response | Object | Main object containing the response data. |
| data | Object | Object containing the requested data. |
| employees | Object[] | Array of employees |
| date | Date | The date in which the swop matches. |
| empId | String | Employee id |
| empName | String | Employee full name |
| empNo | String | Employee number |
shiftsoptional | Object[] | Collection of shifts. |
attendanceTimeoptional | Object[] | Attendancetime interval of the shift. |
endTimeoptional | Number | End time of the interval in seconds. |
startTimeoptional | Number | Start time of the interval in seconds. |
| date | Date | The date of the shift. |
dayProfileoptional | Object[] | The day profile object. |
backColoroptional | String | BackGround color. |
| description | String | Description of the day profile. |
endTimeoptional | Number | Normal time end of day profile. |
foreColoroptional | String | ForeGround color. |
| id | String | Day profile ID. |
| isVariable | Boolean | True if day profile is variable. |
startTimeoptional | Number | Normal time start of day profile. |
departmentoptional | Object[] | The department object. |
descriptionoptional | String | Description of the department. |
| id | String | Id of the department. |
| empId | String | The Id of the employee. |
groupoptional | Object[] | The group object. |
descriptionoptional | String | Description of the group. |
| id | String | Id of the group. |
| id | Number | The Id of the shift. |
| isPublished | Boolean | True if shift is published False if not. |
normalTimeoptional | Object[] | Normal time interval for variable day profiles. |
endTimeoptional | Number | End time of the interval in seconds. |
startTimeoptional | Number | Start time of the interval in seconds. |
| planId | Number | The Id of the plan. |
| code | String | The code of the message. |
| message | String | The text of the message. |
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": {"employees": [{"empId": "1191","empNo": "DST","empName": "Dwight Schrute","date": "2019-09-30","canSwop": true,"shifts": [{"id": "2163650668\u00011191\u00012458758\u00010","empId": "1191","date": "2019-09-30","canSwop": true,"planId": 2163650668,"isPublished": true,"dayProfile": [{"id": "FLEX","startTime": 28800,"endTime": 57600,"description": "Fixed/flex","isVariable": false,"foreColor": "FFFFFF","backColor": "5032F5"}],"department": [{"id": "WAREHOUSE","description": "FGN warehouse department"}],"group": [{"id": "WHGRP","description": "FGN's Warehouse group"}]}]}]},"errorCode": 0,"errorMessage": ""}}