General - Change absence
API Url
Used for changing an absence reason or time. The API will check if it's allowed to change absence for other employees.
http://localhost:16010/ProMarkREST/rest/General/absences
Permissions: user
Request headers
| Field | Type | Description |
|---|---|---|
Accept-Languageoptional | String | =en-GB Language use for localization. |
X-Clientoptional | String | =Client type. "Portal""Mobile""Admin" |
X-Roleoptional | Number | ProMark role (1: Employee, 2: User). {12} |
X-WebPart-Idoptional | Number | Unique web-part identifier. |
Parameter
| Field | Type | Description |
|---|---|---|
| request | Object | Main object containing the request data. |
| data | Object | Object containg data to be uploaded. |
| absences | Object[] | Collection of absence intervals. |
activityoptional | String | Activity id |
| attendanceDate | Date | Attendance date to be absented. |
| code | String | The reason code (identifier). |
| empId | String | The employee ID. |
endTimeoptional | Number | End time of day in seconds. |
hoursoptional | Number | The absence time expressed in seconds. It's not needed if reason code is set-up as being percent of normal time. |
| id | String | Unique identifier for the absence object |
projectoptional | String | Project id |
startTimeoptional | Number | Start time of day in seconds. |
| type | Number | Absence type (1: All-day, 2: Anytime, 3: Before Clock-in, 4: After Clock-out, 5: All-shift). 1-5 |
Request example:
{"request": {"data": {"absences": [{"id": "2153607898~\u00002~\u000036600","empId": "804","attendanceDate": "2017-06-27","type": 2,"code": "W","hours": 0,"startTime": 36600,"endTime": 40200}]}}}
Success 200
| Field | Type | Description |
|---|---|---|
| response | Object | Main object containing the response data. |
| data | Object | Object containing the requested data. |
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": {"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": {"errorCode": 10"errorMessage": ""}}