ProRoster - Update an assigned demand
API Url
Use it for reassigning a demand or for editing its attributes. For the remanning only the id of the assigned demand and the EmpId are required. If you send any of the attributes, the existing ones wiil be overwritten.
http://localhost:16010/ProMarkREST/rest/ProRoster/assigned-demands/{id}
Permissions: user
Query parameters
| Field | Type | Description |
|---|---|---|
| forceAssign | Logical | True = Will ignore the warning. False = In case the employee's department/group/approval group/category doesn't match the demand's department/group/approval group/category, the routine ends with an error that those demand atrributes will replace the employee's ones. |
Parameter
| Field | Type | Description |
|---|---|---|
| request | Object | Main object containing the request data. |
| data | Object | Object containg data to be uploaded. |
approvalGroupoptional | Object[] | Approval group object when wanting to overwrite the demand defaults. |
| id | String | Id of the approvalGroup. |
categoryoptional | Object[] | Category object when wanting to overwrite the demand defaults. |
| id | String | Id of the category. |
dayProfileoptional | Object[] | The day profile object when wanting to overwrite the demand defaults. |
| id | String | Day profile ID. |
departmentoptional | Object[] | Department object when wanting to overwrite the demand defaults. |
| id | String | Id of the department. |
| empId | String | Employee's id to receive the demand. |
groupoptional | Object[] | Group object when wanting to overwrite the demand defaults. |
| id | String | Id of the group. |
| id | Number | The unique id of the assigned demand. |
normalTimeoptional | Object[] | Normal time interval for variable day profiles. Use when wanting to overwrite the demand defaults. |
| endTime | Number | End time of the interval in seconds. |
startTimeoptional | Number | Start time of the interval in seconds. |
Request example:
{"request":{"data":{"assignedDemands": [{"id": 123456789,"empId": "893""normalTime": [{"startTime": 0,"endTime": 0}],"dayProfile": [{"id": "Morning"}],"department": [{"id": "Welders"}],"group": [{"id": "Group1"}],"approvalGroup": [{"id": "Special"}],"category": [{"id": "Cat1"}]}]}}}
Success 200
| Field | Type | Description |
|---|---|---|
| response | Object | Main object containing the response data. |
| data | Object | Object containing the requested data. |
| assignedDemands | Object[] | |
approvalGroupoptional | Object[] | |
descriptionoptional | String | Description of the approvalGroup. |
idoptional | String | Id of the approvalGroup. |
| isLocked | Boolean | Is the attribute locked. |
| isRequired | Boolean | Is the attribute required. |
| backColor | String | BackGround color in HEX without #. |
categoryoptional | Object[] | |
descriptionoptional | String | Description of the category. |
idoptional | String | Id of the category. |
| isLocked | Boolean | Is the attribute locked. |
| isRequired | Boolean | Is the attribute required. |
| date | Date | The date of the assigned demand. |
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. |
idoptional | String | Day profile ID. |
| isLocked | Boolean | Is the attribute locked. |
| isRequired | Boolean | Is the attribute required. |
| isVariable | Boolean | True if day profile is variable. |
startTimeoptional | Number | Normal time start of day profile. |
| demandId | Number | The Id of the plan demand the assigned demand originates from. |
departmentoptional | Object[] | |
descriptionoptional | String | Description of the department. |
idoptional | String | Id of the department. |
| isLocked | Boolean | Is the attribute locked. |
| isRequired | Boolean | Is the attribute required. |
| description | String | Description of the demand. |
| empId | String | The Id of the employee assigned to a demand. |
| foreColor | String | ForeGround color in HEX without #. |
groupoptional | Object[] | |
descriptionoptional | String | Description of the group. |
idoptional | String | Id of the group. |
| isLocked | Boolean | Is the attribute locked. |
| isRequired | Boolean | Is the attribute required. |
| id | Number | The unique id of the assigned demand. |
| isPublished | Boolean | False = the assigned demand is not published. True = the assigned demand is published. |
| isTask | Boolean | True if demand is task, false if not. |
| name | String | The name of the demand. |
normalTimeoptional | Object[] | Normal time interval for variable day profiles. |
endTimeoptional | Number | End time of the interval in seconds. |
| isLocked | Boolean | Is the attribute locked. |
| isRequired | Boolean | Is the attribute required. |
startTimeoptional | Number | Start time of the interval in seconds. |
| planId | Number | The Id of the plan. |
| version | Number | Version number of the assigned demand. |
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": {"assignedDemands": [{"id": 2154019413,"empId": "893","date": "2021-09-29","demandId": 1234567890,"planId": 2153977956,"name": "BaseDemandDeTestBlah","description": "same","foreColor": "678DB6","backColor": "678DB6","version": 1,"isPublished": false,"normalTime": [{"startTime": 0,"endTime": 0,"isRequired": false,"isLocked": false}],"dayProfile": [{"id": "Morning","description": "Morning shift","isVariable": false,"foreColor": "","backColor": "","isRequired": false,"isLocked": false}],"department": [{"id": "Welders","description": "Welders specialists","isRequired": false,"isLocked": false}],"group": [{"id": "Group1","description": "Group 1","isRequired": false,"isLocked": false}],"approvalGroup": [{"description": "","isRequired": false,"isLocked": false}],"category": [{"description": "","isRequired": false,"isLocked": false}],"ignoreDayProfile": [{"value": true,"isLocked": true}]}]},"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. |