SelfService - Get self-service requests

API Url

Used in Self-service for loading requests for approval.

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

Permissions: user

Query parameters

FieldTypeDescription
approvalGroupoptionalString

Approval group Id used to filter data. If not sent, all will be used.

approvalStatusoptionalNumber

Approval status to filter data (1: Untreated, 2: Approved, 3: Rejected). If not sent, all will be returned.

Size range: 1-3
empIdoptionalString

List of employee IDs with comma delimiter, used for filtering data. If not supplied, data for allowed employees will be returned. 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. Default is TODAY.

tooptionalDate

Get data until this date. Default is 'from' + 365 days.

typeoptionalNumber

Request type (1: Swop, 2: Vacant shifts, 3: Absence). If not sent, all will be returned.

Size range: 1-3

Success 200

FieldTypeDescription
responseObject

Main object containing the response data.

  dataObject

Object containing the requested data.

    requestsObject[]

Collection of requests.

      actionsoptionalObject[]

List of actions that can be performed on the request.

        idString

Action identifier ("approve", "reject", "delete").

        nameString

Short action name.

      attendanceDateDate

Attendance date of vacant shift as ISO-8601.

      avatarURIoptionalString

URI used for loading the employee avatar.

      clockInDate

Clock-in date-time of the shift as ISO-8601.

      clockOutDate

Clock-out date-time of the shift as ISO-8601.

      commentoptionalString

Comment of the employee who initiated the request.

      contactoptionalString

Contact person. Used on absence requests according to setup.

      dayProfileDescString

Day profile description of the shift.

      dayProfileIdString

Day profile ID of the shift.

      empIdString

Employee ID who initiated the request (owner of shift).

      empNameString

Name of employee who initiated the request (owner of shift).

      empNoString

Employee No who initiated the request (owner of shift).

      idNumber

Unique request identifier.

      initialsString

Employee Initials.

      reasonsoptionalObject[]

The absence reasons on absence requests (type = 3).

        backColoroptionalString

Absence reason background color as HEX without #.

        codeString

The absence reason code.

        descriptionString

The absence reason description.

        foreColoroptionalString

Absence reason text as HEX without #.

        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
      sortEmpNoString

Employee No used for sorting.

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

      swopWithoptionalObject

Object containing the shift to be swoped with. Only for swop requests (type = 1) or vacant shift taken by another employee (type = 2).

        attendanceDateDate

Shift attendance date.

        avatarURIoptionalString

URI to the employee avatar.

        clockInoptionalDate

Shift start date-time as ISO-8601.

        clockOutoptionalDate

Shift end date-time as ISO-8601.

        commentoptionalString

Comment of the swoped employee.

        dayProfileDescString

Day profile description of the vacant shift.

        dayProfileIdString

The day profile ID of the shift.

        empIdString

The employee ID, owner of the shift to be swoped with.

        empNameString

Employee name, owner of shift to be swoped with.

        empnoString

The employee No, owner of the shift to be swoped with.

        initialsString

Employee initials

        sortEmpNoString

Employee No used for sorting.

      typeNumber

Request type (1: Swop, 2: Vacant shifts, 3: Absence).

Size range: 1-3
  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": {
"requests": [
{
"id": 2153576626,
"type": 1,
"empId": "420",
"empNo": "1234",
"sortEmpNo": "!!!!1234",
"initials": "GJE",
"avatarURI: "rest/General/employees/420/avatar",
"empName": "Gitte Jensen",
"attendanceDate": "2018-03-07",
"dayProfileId": "SH1",
"dayProfileDesc": "Morning shift",
"clockIn": "2018-03-07T07:00:00.000",
"clockOut": "2018-03-07T15:00:00.000",
"comment": "Need a stand in. Anybody?",
"statusCode": 3,
"statusMessage": "Approved by employee, waiting for manager/approver",
"swopWith": {
"empId": "625",
"empNo": "6000",
"sortEmpNo": "!!!!6000",
"initials": "MOS",
"empName": "Mick Osbourn",
"attendanceDate": "2018-03-07",
"dayProfileId": "MH2",
"dayProfileDesc": "Evening shift",
"clockIn": "2018-03-07T15:00:00.000",
"clockOut": "2018-03-07T23:00:00.000",
"comment": "I will help you this time.",
},
"actions": [
{
"id": "approve",
"name": "Approve"
},
{
"id": "reject",
"name": "Reject"
},
{
"id": "delete",
"name": "Delete"
}
]
},
{
"id": 123456789,
"type": 3,
"empId": "420",
"empNo": "4000",
"sortEmpNo": "!!!!4000",
"empName": "Gitte Jensen",
"initials": "GJE",
"avatarURI: "rest/General/employees/420/avatar",
"attendanceDate": "2018-04-07",
"dayProfileId": "SH1",
"dayProfileDesc": "Midday shift,
"acceptBefore": "2018-04-06",
"comment": "Doctor appointment in the morning",
"statusCode": 3,
"statusMessage": "Waiting for manager approval",
"reasons": [
{
"type": 3,
"code": "DR",
"description": "Doctor",
"hours": 7200,
"backColor": FFFFFF,
"foreColor": 000000
}
],
"actions": [
{
"id": "cancel",
"name": "Cancel"
}
]
}
]
},
"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.