latestOpenAPI 3.0.02026-08-1061522.5 KB

24b687a6e18c

Leave Applications

Create leave application

Create leave application

post/users/leave-applications

Request body

fromstring required

Start date time of the leave application in format Y-m-d H:i:s, required

tostring required

End date time of the leave application in format Y-m-d H:i:s, required, if leave is allDay and for example employee selected 27.06.2020 then we should send value like 2020-06-27 00:00:00, can be in some cases same value as 'from' if leave is exactly one date long

leaveReasonIdstring required

Leave reason id, required

managerIdstring

Manager id which will receive leave application, can be omitted

leaveMessagestring

Leave message, can be omitted

allDayboolean

Not really needed and its not used by the backend logic, should be used by frontend only, if time in 'from' and 'to' parameters is 00:00:00 or leave lasts longer than 24h then its automatically allDay true by default, otherwise its false

Example request

{
  "from": "2020-06-27 00:00:00",
  "to": "2020-06-27 00:00:00",
  "leaveReasonId": "kBep_ZtJ1sce0EXuI_9Evt.4qUR7INSe06UTygqpqLxc",
  "managerId": "hd58ElPA.IW0FHctO8oCRAhGTetM2yCxIs.63wgYdfB75C0--",
  "leaveMessage": "I am going on vacation",
  "allDay": true
}

Response

Created leave application

Example response

{
  "leaveApp": {
    "id": "aidhjTypVxiWxO.E8dXmixitUDIUDj175Av8YZyUjtjxWuWm",
    "employeeName": "John Doe",
    "leaveReason": "Sick",
    "from": "2020-09-01 00:00:00",
    "to": "2020-09-01 00:00:00",
    "sendDate": "2020-08-20 12:25:00",
    "status": "PENDING",
    "comment": "Employee's comment",
    "allDay": true
  }
}