Create Time Off Request
POST {{baseUrl}}/odata/TimeOffRequests
Create Time Off Request entity.
- name - any non-empty string (the server will update the name, but it is required for validation).
- userId - The ID of the user for whom the request is being created.
- timeOffTypeId - ID of the time off type.
- startDate - the beginning of the period.
- finishDate - the end of the period.
- startDayInterval - the type of the first interval
day. - finishDayInterval - type of the last day interval.
- startDayHours - number of hours of time off on the first day. Actual if interval = Hours.
- finishDayHours - number of hours of time off in the last day. Actual if interval = Hours.
The interval type can take the following values:
- FullDay - The entire working day.
- Half - Half of the working day.
- ThreeQuarters - 3/4 working days.
- Quarter - A quarter of a working day.
- Hours - An explicit number of hours.
Request Body
{"name"=>"any", "userId"=>"2010b229-62fb-427b-ad6a-b426d15dd39f", "timeOffTypeId"=>"22c1f067-6bb8-41fc-92f9-c6e52aa4e719", "startDate"=>"2022-09-01", "finishDate"=>"2022-09-10", "startDayInterval"=>"Half", "finishDayInterval"=>"ThreeQuarters", "startDayHours"=>nil, "finishDayHours"=>nil}
RESPONSES
status: Created
{"@odata.context":"https://api.timetta.com/odata/$metadata#TimeOffRequests/$entity","startDate":"2022-09-01","finishDate":"2022-09-10","userId":"2010b229-62fb-427b-ad6a-b426d15dd39f","departmentId":"9468cd5c-ea04-4adb-a1d7-94b6b910ab2e","timeOffTypeId":"22c1f067-6bb8-41fc-92f9-c6e52aa4e719","startDayInterval":"Half","startDayHours":null,"finishDayInterval":"ThreeQuarters","finishDayHours":null,"comments":null,"approvalInstanceId":null,"approvalStatusId":"0aefb600-42fb-4aa5-991c-d70dc7ac7b27","submitted":null,"approved":null,"rowVersion":17138487,"name":"Max Fry: Annual leave","createdById":"2010b229-62fb-427b-ad6a-b426d15dd39f","modifiedById":"2010b229-62fb-427b-ad6a-b426d15dd39f","id":"b10bff28-a7e4-4a68-a7cf-fbb44cbb9097","created":"2022-09-08T12:22:34.6846834+03:00","modified":"2022-09-08T09:22:34.6509907Z","isActive":true}