SelfService - Get swop requests

API Url

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

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

Permissions: user

Query parameters

FieldTypeDescription
empIdoptionalString

List of employee IDs who has initiated the swop request, 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.

swopEmpIdoptionalString

List of employee IDs who are target of swop requests, 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.

tooptionalDate

Get data until this date.

Success 200

FieldTypeDescription
responseObject

Main object containing the response data.

  dataObject

Object containing the requested data.

    swopsObject[]

Object containing the swop 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.

      clockInoptionalDate

Shift start date-time as ISO-8601.

      clockOutoptionalDate

Shift end date-time as ISO-8601.

      commentoptionalString

Comment on the swop request (will be visible to other employees).

      dayProfileDescString

Day profile description of the vacant shift.

      dayProfileIdString

The day profile ID of the shift.

      empIdString

The employee ID initiating the swop (owner of the shift).

      empNameString

Name of employee initiating the swop (owner of shift).

      idNumber

Unique identifier of the swop request.

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

      swopWithObject

Object containing the shift to be swoped with.

        attendanceDateDate

Shift attendance date.

        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.

  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": {
"swops": [
{
"id": 12345678,
"statusCode": 2,
"statusMessage": "Waiting for employee approval",
"empId": "414",
"empName": "John Doe",
"attendanceDate": "2017-06-07",
"dayProfileId": "SH1",
"dayProfileDesc": "Morning shift",
"clockIn": "2017-06-07T08:00:00",
"clockOut": "2017-06-07T16:00:00",
"acceptBefore": "2017-06-06",
"comment": "My sister is getting married. Could you help?",
"swopWith":
{
"empId": "769",
"empName": "Kenneth Bing",
"attendanceDate": "2017-06-07",
"dayProfileId": "EH2",
"dayProfileDesc": "Evening shift",
"clockIn": "2017-06-07T13:00:00",
"clockOut": "2017-06-07T22:00:00",
},
"actions": [
{
"id": "accept",
"name": "Accept"
},
{
"id": "decline",
"name": "Decline"
}
]
}
]
}
}
}

Error 4xx

FieldTypeDescription
responseObject

Main object containing the response data.

  dataObject

Object containing the requested data (empty).

  errorCodeNumber

Error code.

  errorMessageString

Error description.