SelfService - Update absence request

API Url

Used in Self-service for updating absence requests. So far it supports only change of status: Cancel, Accept, Reject.

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

Permissions: user

Parameter

FieldTypeDescription
requestObject

Main object containing the request data.

  dataObject

Object containg data to be uploaded.

    absencesObject[]

Object containing the absence requests.

      acceptBeforeoptionalDate

Date until you want the request to be accepted (not updatable).

      actionString

Action to be performed on the request ("cancel", "accept", "decline").

      attendanceDateDate

Shift attendance date (not updatable).

      commentoptionalString

Comment on the absence request (not updatable).

      contactoptionalString

Contact person (not updatable).

      dayProfileIdString

The day profile ID of the shift (not updatable).

      empIdString

The employee ID. Owner of the shift (not updatable).

      idNumber

Unique identifier of the absence request (not updatable).

      reasonsObject[]

The absence reasons (not updatable).

        codeString

The absence reason code (not updatable).

        hoursoptionalNumber

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

        typeNumber

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

Size range: 1-5

Example for canceling an absence request:

{
"request": {
"data": {
"absences": [
{
"id": 123456789,
"empId": "414",
"attendanceDate": "2017-06-07",
"dayProfileId": "SH1",
"acceptBefore": "2017-06-06",
"comment": "Doctor appointment in the morning",
"reasons": [
{
"type": 3,
"code": "DR",
"hours": 7200
}
],
"action": "cancel"
}
]
}
}
}

Success 200

FieldTypeDescription
responseObject

Main object containing the response data.

  dataObject

Object containing the requested data.

    statusCodeNumber

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).

Size range: 0-99
    statusMessageString

Status message of the request.

  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": {
"data": {
"statusCode": 99,
"statusMessage": "Absence request canceled."
},
"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.