SelfService - Get vacant shifts of 1 employee

API Url

Used in Self-service for loading vacant shifts for a single employee.

GET
http://localhost:16010/ProMarkREST/rest/SelfService/employees/{id}/offers

Permissions: user

Path parameters

FieldTypeDescription
idString

Employee ID who owns the vacant shifts. If this is not the current employee, it will be validated angainst the list of allowed employees.

Query parameters

FieldTypeDescription
canForefillShiftsoptionalBoolean

true = Show only shifts you can take (default is false).

fromoptionalDate

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

tooptionalDate

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

Success 200

FieldTypeDescription
responseObject

Main object containing the response data.

  dataObject

Object containing the requested data.

    offersObject[]

Collection of offered (vacant) shifts.

      acceptBeforeoptionalDate

Accept the offer before this date.

      actionsoptionalObject[]

List of actions that can be performed on the request.

        idString

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

        nameString

Short action name.

      attendanceDateDate

Attendance date of vacant shift as ISO-8601.

      clockInDate

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

      clockOutDate

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

      commentoptionalString

Comment of the employee who initiated the offer.

      dayProfileDescString

Day profile description of the vacant shift.

      dayProfileIdString

Day profile ID of the vacant shift.

      empIdString

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

      empNameString

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

      idNumber

Unique ID of the offer 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'.

      swopWithoptionalObject

Object containing the shift to be swoped with in case the vacant shift was taken by another employee.

        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": {
"offers": [
{
"id": 2153576626,
"empId": "414",
"empName": "Soren Gent",
"attendanceDate": "2017-06-07",
"dayProfileId": "SH1",
"dayProfileDesc": "Morning shift",
"clockIn": "2017-06-07T07:00:00.000",
"clockOut": "2017-06-07T19:00:00.000",
"acceptBefore": "2017-06-07",
"comment": "Need a stand in. Anybody?",
"statusCode": 0,
"statusMessage": "Vacant shift",
"actions": [
{
"id": "cancel",
"name": "Cancel"
]
]
}
]
},
"errorCode": 0,
"errorMessage": ""
}
}

Success example of shift taken by another employee:

HTTP/1.1 200 OK
{
"response": {
"data": {
"offers": [
{
"id": 2153576626,
"empId": "414",
"empName": "Soren Gent",
"attendanceDate": "2018-03-07",
"dayProfileId": "SH1",
"dayProfileDesc": "Morning shift",
"clockIn": "2018-03-07T07:00:00.000",
"clockOut": "2018-03-07T19:00:00.000",
"comment": "Need a stand in. Anybody?",
"statusCode": 3,
"statusMessage": "Approved by employee, waiting for manager/approver",
"swopWith": {
"empId": "625",
"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.",
}
}
]
},
"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.