ProRoster - Insert an availability.

API Url

Use it for inserting the availability for an employee.

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

Permissions: user

Parameter

FieldTypeDescription
requestObject

Main object containing the request data.

  dataObject

Object containg data to be uploaded.

    availabilitiesObject[]

Collection of availabilities.

      commentString

Comment for the availability.

      endDateDate

The end date of the availability.

      excludeWeekendsLogical

If TRUE the repeat pattern is not to be repeated on weekends.

      inclDaysLogical[7]

Days to repeat.

      intvFromNumber

Start time of the availability.

      intvToNumber

End time of the availability.

      isAllDayLogical

Yes/No.

      isRepeatingLogical

TRUE/FALSE.

      repeatEveryNumber

Periods before repeat .

      repeatTypeNumber

1 = Daily, 2 = Weekly.

      startDateDate

The start date of the availability.

      typeNumber

The type of the availability.

Request example:

{
"request":{
"data":{
"availabilities": [{
"startDate": "2018-09-28",
"endDate": "2018-09-28",
"intvFrom": 1000,
"intvTo": 2000,
"isAllDay": "No",
"Type": 1,
"isRepeating": "Yes",
"repeatType": 1,
"repeatEvery": 3,
"excludeWeekends": "Yes",
"inclDays":["false","true","true","true","true","true","false"],
"comment": "Doctor appointment in the morning"
}]
}
}
}

Success 200

FieldTypeDescription
responseObject

Main object containing the response data.

  dataObject

Object containing the requested data.

    availabilitiesObject[]

Collection of availabilities.

      commentString

Comment for the availability.

      empIdString

The Id of the availability.

      endDateDate

The end date of the availability.

      excludeWeekendsLogical

If TRUE the repeat pattern is not to be repeated on weekends.

      idString

The unique id of the availability.

      inclDaysLogical[7]

Days to repeat.

      intvFromNumber

Start time of the availability.

      intvToNumber

End time of the availability.

      isAllDayLogical

Yes/No.

      isRepeatingLogical

TRUE/FALSE.

      repeatEveryNumber

Periods before repeat .

      repeatTypeNumber

1 = Daily, 2 = Weekly.

      startDateDate

The start date of the availability.

      typeNumber

The type of the availability.

  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": {
"availabilities": [
{
"id": "2163160308",
"empId": "892",
"startDate": "2018-09-28",
"endDate": "2018-09-28",
"intvFrom": 1000,
"intvTo": 2000,
"isAllDay": false,
"type": 1,
"isRepeating": true,
"repeatType": 1,
"repeatEvery": 3,
"excludeWeekends": true,
"inclDays": [
false,
true,
true,
true,
true,
true,
false
],
"comment": "Doctor appointment in the morning"
}
]
},
"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.