ByteHR API Documentation

1. Get All Leaves

GET /api/leaves

Fetches a list of available leaves.

Request Parameters

Parameter Type Required Description
currentPage integer No Page number for pagination. Default is 1.
limit integer No Number of records per page. Default is 10 and maximum is 100.

Responses

200 OK

Successful retrieval of leaves.

Content type: application/json


            {
                "currentPage": "int",
                "limit": "int",
                "total": "int",
                "data": [
                    {
                        "employeeID": "string",
                        "systemID": "string",
                        "firstName": "string",
                        "lastName": "string",
                        "firstNameThai": "string",
                        "lastNameThai": "string",
                        "leaveName": "string",
                        "currentYear": {
                            "allowance": "int",
                            "carryForward": "int",
                            "usedDays": "int",
                            "balance": "int,
                            "carryForwardForfeit": "int"
                            }                     
                    },
                ]
            }
                            

401 Unauthorized

User authentication failed or missing API Key.


            {
                "StatusCode": 401,
                "Message": "Unauthorized client!",
                "Data": null
            }
                            

429 Too Many Requests

The request client error response status code indicates the client has sent too many requests in a given amount of time.


            {
                "StatusCode": 429,
                "Message": "Rate limit exceeded. Try again later!",
                "Data": null
            }
                            

Test API

No response yet...