ProRoster - Insert absences

API Url

Use it for inserting an absence to ProSchedule

POST
http://localhost:16010/ProMarkREST/rest/ProRoster/absences

Permissions: user

Query parameters

FieldTypeDescription
empIdsString

List of employees for which the absence will be inserted

forceAssignBoolean

True = Will ignore the warning. False = Will perform the validations

fromDate

The interval start date

planIdString

The plan id

publishBoolean

True = Publish the absences

toDate

The interval end date

Parameter

FieldTypeDescription
requestObject

Main object containing the request data.

  dataObject

Object containg data to be uploaded.

    absencesObject[]
      codeString

Absence reason code.

      commentoptionalString

Comment on absence.

      dateDate

Date when absence is inserted.

      empIdString

The employee unique identifier.

      fromoptionalNumber

Start time of absences in seconds from midnight.

      tooptionalNumber

End time of absences in seconds from midnight.

Request example of all-day absence:

HTTP/1.1 200 OK
{
"request": {
"data": {
"absences": [
{
"empId": "456",
"date": "2018-07-22",
"code": "Doctor",
"comment": "Medical Appointment"
}
]
}
}
}

Request example of partial absence:

HTTP/1.1 200 OK
{
"request": {
"data": {
"absences": [
{
"empId": "456",
"date": "2018-07-22",
"to": 39600,
"code": "Doctor",
"comment": "Medical Appointment"
}
]
}
}
}

Success 200

FieldTypeDescription
responseObject

Main object containing the response data.

  dataObject

Object containing the requested data.

    absencesObject[]
      backColoroptionalString

Reason background color as HEX without #.

      codeString

Absence reason code.

      commentoptionalString

Comment on absence.

      dateDate

Date when absence is inserted.

      descriptionString

Absence reason description.

      empIdString

Employee ID.

      foreColoroptionalString

Reason foreground color as HEX without #.

      fromoptionalNumber

Start time of absences in seconds from midnight.

      idString

Unique identifier of the absence.

      isPublishedBoolean

TRUE if the absence was published.

      tooptionalNumber

End time of absences in seconds from midnight.

  messageoptionalObject

Object containing response messages.

    codeNumber

Message code.

    textString

Message text.

    typeString

Type of message.

Allowed values:"warning""info"

Response example of all-day absence:

HTTP/1.1 200 OK
{
"response": {
"data": {
"absences": [
{
"id": "1234567890",
"empId": "404",
"date": "2018-07-22",
"code": "Doctor",
"description": "Doctor's appointment",
"foreColor": "ffffff",
"backColor": "000000",
"comment": "Medical Appointment as agreed"
}
]
}
}
}

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 422
{
"request": {
"data": {},
"errorCode": 65,
"errorMessage": "There are errors when inserting this absence"
}

Error example when forceInsert = false:

HTTP/1.1 422
{
"response": {
"data": {
"assignedDemands": [
{
"id": 2163162849,
"empId": "953",
"date": "2018-10-14",
"demandId": 2163162390,
"planId": 2163133252,
"name": "Casino Host",
"description": "Casino Host",
"foreColor": "FFD500",
"backColor": "678DB6",
"version": 2,
"isPublished": true,
"normalTime": [
{
"isRequired": false,
"isLocked": false
}
],
"dayProfile": [
{
"id": "0600-1430",
"startTime": 21600,
"endTime": 52200,
"description": "Day Mon-Fri 8 hours",
"isVariable": false,
"isRequired": false,
"isLocked": false
}
],
"department": [
{
"description": "Hotel Summer department",
"isRequired": false,
"isLocked": false
}
],
"group": [
{
"isRequired": false,
"isLocked": false
}
],
"approvalGroup": [
{
"isRequired": false,
"isLocked": false
}
],
"category": [
{
"isRequired": false,
"isLocked": false
}
]
}
]
},
"errorCode": 24,
"errorMessage": "The absence is overlapping some of the demands"
}
}