v1

latestOpenAPI 3.0.02026-07-14800227.2 KB
Time off

Return a list of time-off requests.

This endpoint returns a paginated list of time off requests for a given date range.The maximum number of time off requests to retrieve once is 92 days, so the URL params from and to are mandatory. The URL params help to return more accurate results.

get/time-off/requests

Query parameters

fromstring required
Example:2020-01-01

A date in format YYYY-MM-DD to indicate the starting point. It needs to be equals or less than the to param.

tostring required
Example:2020-01-10

A date in format YYYY-MM-DD to indicate the ending point. It needs to be equals or greater than the from param.

_userIdstring
Example:60a2db290da29e126a18789b

This field allows to return only the time off requests for a given _userId.

_timeOffTypeIdstring
Example:90a2db290da29e126a187891

This field allows to filter by time-off type Id.

status'Approved' | 'Declined' | 'Cancelled' | 'Pending' | 'Submitted' | 'Processed' | 'CancelledAfterProcessed' | 'InApproval'
Example:Approved

This field allows to filter by the time-off request status.

offsetnumber
Example:1

Optional filter for pagination proposals. Determines the number of pages to skip when pagination is being used. If this value is not provided, by default the offset will be 1.

limitnumber
Example:25

Optional filter for pagination proposals. The maximum number of rows to retrieve which determines the size of the page. If this value is not provided then the limit will be 50 users. The maximum value of the limit is 100 users per page. Only are valid the following limit values: 25, 50 and 100.

Headers

Authorizationstring required
Example:Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL2FwaS5rZW5qby5pbyIsInN1YiI6IjYwZjBhOTE2MjE0OTg3MjU2YmU5YzhmZiIsImF1ZCI6Imh0dHBzOi8vYXBpLmtlbmpvLmlvIiwiaWF0IjoxNjI2Mzg1MTE1LCJuYmYiOjE2MjYzODUxMTUsImV4cCI6MTYyNjU1NzkxNSwiYWNjZXNzVHlwZSI6IkFwaUFjY2VzcyIsInNfb3JnSWQiOiI2MGYwNGVhN2RmN2JhMjFlY2U0YmYzYzIifQ.cxG_7dIS-VbmDXdJuLkekoyuyCIzQG2fMcgc0nkfbWE8cihhcb5FnALbQkjU9b5-qVcEoMHZlSuUA-jMEBMMVQ

A valid bearer token.

Response

OK.

Example response

{
  "data": [
    {
      "_id": "60a2db290da29e126a18789a",
      "_userId": "80a2db290da29e126a18789b",
      "_timeOffTypeId": "80a2db290da29e126a187809",
      "_policyId": "80a2db290da29e126a187878",
      "policyName": "Sick days",
      "_policyType": "Day",
      "status": "Submitted",
      "from": "2022-03-10T00:00:00",
      "to": "2022-03-12T00:00:00",
      "duration": 2,
      "workingTime": 2,
      "_createdAt": "2022-03-10T08:00:00",
      "hasAttachment": true,
      "_type": "Submission"
    },
    {
      "_id": "60a2db290da29e126a18789b",
      "_userId": "80a2db290da29e126a18789b",
      "_timeOffTypeId": "80a2db290da29e126a18789f",
      "_policyId": "80a2db290da29e126a187897",
      "policyName": "Holidays for tech team",
      "_policyType": "Day",
      "status": "Submitted",
      "from": "2022-02-01T00:00:00",
      "to": "2022-02-12T00:00:00",
      "duration": 12,
      "workingTime": 8,
      "_createdAt": "2022-02-01T10:30:00",
      "description": "I have requested days off",
      "hasAttachment": false,
      "_type": "Submission"
    }
  ],
  "metadata": {
    "count": 2,
    "offset": 1,
    "limit": 50,
    "total": 2
  }
}