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.

PUT
http://localhost:16010/ProMarkREST/rest/General/absences

Permissions: user

Request headers

FieldTypeDescription
Accept-LanguageoptionalString

=en-GB Language use for localization.

X-ClientoptionalString

=Client type.

Allowed values:"Portal""Mobile""Admin"
X-RoleoptionalNumber

ProMark role (1: Employee, 2: User).

Allowed values:{12}
X-WebPart-IdoptionalNumber

Unique web-part identifier.

Parameter

FieldTypeDescription
requestObject

Main object containing the request data.

  dataObject

Object containg data to be uploaded.

    absencesObject[]

Collection of absence intervals.

      activityoptionalString

Activity id

      attendanceDateDate

Attendance date to be absented.

      codeString

The reason code (identifier).

      empIdString

The employee ID.

      endTimeoptionalNumber

End time of day in seconds.

      hoursoptionalNumber

The absence time expressed in seconds. It's not needed if reason code is set-up as being percent of normal time.

      idString

Unique identifier for the absence object

      projectoptionalString

Project id

      startTimeoptionalNumber

Start time of day in seconds.

      typeNumber

Absence type (1: All-day, 2: Anytime, 3: Before Clock-in, 4: After Clock-out, 5: All-shift).

Size range: 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

FieldTypeDescription
responseObject

Main object containing the response data.

  dataObject

Object containing the requested data.

  messageoptionalObject

Object containing response messages.

    codeNumber

Message code.

    textString

Message text.

    typeString

Type of message.

Allowed values:"warning""info"

Success example:

HTTP/1.1 200 OK
{
"response": {
"errorCode": 0
"errorMessage": ""
}
}

Error 4xx

FieldTypeDescription
responseObject

Main object containing the response data.

  dataObject

Object containing the requested data (empty).

  errorCodeNumber

Error code.

  errorMessageString

Error description.

Error example:

HTTP/1.1 200 OK
{
"response": {
"errorCode": 10
"errorMessage": ""
}
}