SelfService - Get absence reasons

API Url

Used in Self-service for loading absence reasons depending on absence request. Not all reasons are allowed and dependes on web-part setup.

GET
http://localhost:16010/ProMarkREST/rest/SelfService/reasons

Permissions: user

Query parameters

FieldTypeDescription
absenceTypeoptionalString

Absence type for which you need the reason list (1: All-day, 2: Anytime, 3: Before Clock-in, 4: After Clock-out, 5: All-shift). Default is 1.

dateoptionalDate

Attendance date for which you need to insert the absence request. Default is TODAY.

Success 200

FieldTypeDescription
responseObject

Main object containing the response data.

  dataObject

Object containing the requested data.

    reasonsObject[]

Collection of absence reasons.

      backColoroptionalString

The reason backcolor as HEX (without #).

      codeString

The reason code (identifier).

      descriptionString

The reason description.

      foreColoroptionalString

The reason forecolor as HEX (without #).

      orderNumber

Sort on this when displaying the list.

      percentoptionalNumber

Percent out of normal time. There are reasons where absence time is set-up as beging a percent out of the normal time, so user does not need to insert the absence hours.

  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": {
"reasons": [
{
"code": "HF",
"order": 1,
"description": "Half-day holiday",
"foreColor": "FFFF00",
"backColor": "808000",
"percent": 50
},
{
"code": "SS",
"order": 10,
"description": "Sickness",
"foreColor": "FFFF00",
"backColor": "FF0000"
}
]
},
"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.