Get requests by employee

This endpoint allows to query an employee’s requests within a specified time period not exceeding 31 days.

GET /api/v1/businesses/{businessId}/employees/{employeeId}/requests?from={yyyy-MM-dd}&to={yyyy-MM-dd}

If the data included in the request is correct —both the businessId and the employeeId— the response will contain the list of the employee’s requests within the defined time interval:

[
    {
        "employeeId": "00001",
        "status": "REQUESTED",
        "type": "NON_WORKED",
        "from": "2024-07-20",
        "to": "2024-07-20"
    },
    {
        "employeeId": "00001",
        "status": "GRANTED",
        "type": "MAYBE",
        "from": "2024-07-21",
        "to": "2024-07-21",
        "fromHour": "10:00",
        "toHour": "17:00"
    },
    {
        "employeeId": "00001",
        "status": "REQUESTED",
        "type": "MANDATORY",
        "from": "2024-07-25",
        "to": "2024-07-25",
        "fromHour": "10:00",
        "toHour": "12:00"
    }
]

As can be seen in the example, the response information will depend on the data defined for each request and its status in the system.

Considerations

The fromHour and toHour fields return values in local time, determined by the time zone configured for the service.

If the time period specified in the URL is longer than 31 days, the request will return a 406 Not Acceptable error.

If the employee identifier is incorrect, the request will return a 404 Not Found error indicating Employee not found.

If there are no requests for the employee in the query interval, the request will return an empty array [].

What is a request?