General - Get all absences for an employee

API Url

Used to get all absences for an employee.

GET
http://localhost:16010/ProMarkREST/rest/General/employees/{empId}/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.

Path parameters

FieldTypeDescription
empIdString

Employee Id.

Query parameters

FieldTypeDescription
absenceTypeoptionalString

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

endDateoptionalDate

End date for absences, Default : TODAY.

startDateoptionalDate

Start date for absences, Default: TODAY.

Success 200

FieldTypeDescription
responseObject

Main object containing the response data.

  dataObject

Object containing the requested data.

    absencesObject[]

Collection of absence intervals.

      activityoptionalString

Activity Id

      approvalDateoptionalNumber

Date of the absence approval.

      approvalStatusoptionalNumber

Approval status of the registration (0: No approval needed, 1: Pending approval, 2: Approved, 3: Rejected).

      approvalStatusDescoptionalString

Description for the approval status.

      approverInitialsoptionalString

Initials of the absence approver.

      attendanceDateDate

Attendance date of absence.

      backColoroptionalString

The reason background color.

      codeString

The reason code (identifier).

      descriptionString

The reason description.

      empIdString

The employee ID.

      endTimeoptionalNumber

End time of day in seconds.

      foreColoroptionalString

The reason foreground color.

      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.

      isCompanyAbsBoolean

TRUE = Absence from Company Calendar.

      projectoptionalString

Project Id

      readOnlyBoolean

TRUE = Registration is read only (approved and not allowed to delete).

      shortDescriptionString

The reason short description.

      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
  messageoptionalObject

Object containing response messages.

    codeNumber

Message code.

    textString

Message text.

    typeString

Type of message.

Allowed values:"warning""info"

Success example with a single shift:

HTTP/1.1 200 OK
{
"response": {
"data": {
"absences": [
{
"id": "2153604964~\u00002~\u000030600"
"empId": "804",
"attendanceDate": "2017-06-22",
"type": 2,
"code": "W",
"description": "Illness",
"shortDescription": "Ill",
"hours": 0,
"startTime": 30600,
"endTime": 34200,
"isCompanyAbs": false
}
]
},
"erorCode": 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 404 Not found
{
"response": {
"errorCode": 5,
"errorMessage": "No employees"
}
}