SelfService - Get absence requests

API Url

Used in Self-service for loading absence requests for one or more employees.

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

Permissions: user

Query parameters

FieldTypeDescription
empIdoptionalString

List of employee IDs with comma delimiter. The list will be validated against list of allowed employees. If you want to remove an employee from list, then add a '-' in front of id.

fromoptionalDate

Get data from this date forward (never in the past). Default is TODAY.

tooptionalDate

Get data until this date.

Success 200

FieldTypeDescription
responseObject

Main object containing the response data.

  dataObject

Object containing the requested data.

    absencesObject[]

Object containing the absence requests.

      acceptBeforeoptionalDate

Date until you want the request to be accepted.

      actionsoptionalObject[]

List of actions that can be performed on the request.

        idString

Action identifier ("accept", "cancel", "decline").

        nameString

Short action name.

      attendanceDateDate

Shift attendance date.

      commentoptionalString

Comment on the absence request.

      contactoptionalString

Contact person.

      dayProfileDescString

Day profile description of the shift.

      dayProfileIdString

The day profile ID of the shift.

      empIdString

The employee ID. Owner of the shift.

      empNameString

The employee full name.

      idNumber

Unique identifier of the absence request.

      reasonsObject[]

The absence reasons.

        backColorString

Absence reason background color as HEX.

        codeString

The absence reason code.

        descriptionString

The absence reason description.

        foreColorString

Absence reason text as HEX.

        hoursoptionalNumber

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

        typeNumber

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

Size range: 1-5
      statusCodeNumber

Status code of the offer 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 offer request. In correlation with 'statusCode'.

  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": {
"absences": [
{
"id": 123456789,
"statusCode": 3,
"statusMessage": "Waiting for manager approval",
"empId": "414",
"attendanceDate": "2017-06-07",
"dayProfileId": "SH1",
"dayProfileDesc": "Midday shift,
"acceptBefore": "2017-06-06",
"comment": "Doctor appointment in the morning",
"reasons": [
{
"type": 3,
"code": "DR",
"description": "Doctor",
"hours": 7200,
"backColor": FFFFFF,
"foreColor": 000000
}
],
"actions": [
{
"id": "cancel",
"name": "Cancel"
}
]
}
]
}
}
}

Error 4xx

FieldTypeDescription
responseObject

Main object containing the response data.

  dataObject

Object containing the requested data (empty).

  errorCodeNumber

Error code.

  errorMessageString

Error description.