Skip to content

My Holiday API

My Holiday API provides a list of your holidays including Thailand holidays (if you so choose) in Thai and English. After creating your holidays, you can retrieve via the API below.

API Endpoint

To retrieve a list of your holidays from the given year and month.

Authorization

The token used for authorization come from the URL generated after creating My Holiday List

Query Parameters

year string - Required

The year that you want to return the holidays.

month string

The month that you want to return the holidays.

Return properties

status number

Status code for the response.

count number

Total number of holidays

holidays array

List of holidays based on your request parameters.

active boolean

Status of the holiday

id number

id of the holiday

nameTh string

Name of the holiday in Thai

nameEn string

Name of the holiday in English

date string

Date of the holiday

editable boolean

Status of edit holiday detail

holidayTypes array

Four holiday types - Public, Government, Company and Personal

note string

Description of the holiday

HTTP response codes

Status CodeDescription
200Success, everything went smoothly
400Year must not be empty
401Unauthorized Missing or incorrect API token
500Internal Server Error
cURL
curl -X 'GET' \
  -H 'accept: */*' \
  -H 'Authorization: Bearer token' \
   'https://mha.logicspark.com/api/v1.0/user-holidays?year=2023&month=1'

Sample Token

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2NzY5MmZkZi03ODkyLTRlMTAtOGU3ZS02YzVhOGExNGIyMGIiLCJpYXQiOjE2ODY5MjMwMTd9.B5pki1CYH8owNECB0-REiG9HpHteuOrHNL3avUvaPUI

Sample Holidays Response

json
{
  "status": 200,
  "count": 20,
  "holidays": [
    {
      "active": true,
      "id": 1,
      "nameTh": "วันขึ้นปีใหม่",
      "nameEn": "New year day",
      "date": "2023-01-01",
      "editable": false,
      "holidayTypes": ["Public", "Government"],
      "note": ""
    }
  ]
}