SelfService - Update shift on offer

API Url

Used in Self-service for updating a shift that is on offer. Primarily used for changing status of request: cancel, accept, reject.

PUT
http://localhost:16010/ProMarkREST/rest/SelfService/offers

Permissions: user

Parameter

FieldTypeDescription
requestObject

Main object containing the request data.

  dataObject

Object containg data to be uploaded.

    offersObject[]

Object containing shifts to sell.

      acceptBeforeoptionalDate

Date until you want the shift to be accepted.

      actionString

Action to be performed on the request ("cancel", "accept", "decline").

      attendanceDateDate

Shift attendance date.

      clockInDate

Shift start date-time as ISO-8601.

      clockOutDate

Shift end date-time as ISO-8601.

      commentoptionalString

Comment on the shift offer. Will be seen by other employees.

      dayProfileIdString

The day profile ID of the shift.

      empIdString

The employee ID. Owner of the shift.

      idNumber

Unique identifier of the sell request.

Request example:

{
"request": {
"data": {
"offers": [
{
"id": 12345678,
"empId": "414",
"attendanceDate": "2017-06-07",
"dayProfileId": "SH1",
"clock-in": "2017-06-07T07:00:00.000",
"clock-out": "2017-06-07T19:00:00.000",
"acceptBefore": "2017-06-06",
"comment": "Need a stand in. Anybody?",
"action": "accept"
}
]
}
}
}

Success 200

FieldTypeDescription
responseObject

Main object containing the response data.

  dataObject

Object containing the requested data.

    statusCodeNumber

Status code of the 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 request.

  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": {
"statusCode": 99,
"statusMessage": "Shift is no longer on offer"
},
"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.