List Holidays

Requires authentication

HTTP Request

GET connector/api/holidays

Query Parameters

Parameter Status Description
location_id optional id of the location
start_date optional format:Y-m-d
end_date optional format:Y-m-d

Example request:

curl -X GET \
-G "http://erp.dstadvertising.com/connector/api/holidays?location_id=totam&start_date=2020-06-25&end_date=2020-06-25" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"

Example response (200):

{
"data": [
{
"id": 2,
"name": "Independence Day",
"start_date": "2020-08-15",
"end_date": "2020-09-15",
"business_id": 1,
"location_id": null,
"note": "test holiday",
"created_at": "2020-09-15 11:25:56",
"updated_at": "2020-09-15 11:25:56"
}
]
}

javascript

const url = new URL(
"http://erp.dstadvertising.com/connector/api/holidays"
);
let params = {
"location_id": "totam",
"start_date": "2020-06-25",
"end_date": "2020-06-25",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));