Public holiday API

This API is:Public
Business purpose:To provide a means to retrieve future dates on which payments will not be permitted within a given date range.
HTTP Methods:GET 
Request URL:https://api.asb.co.nz/public/v1/public-holidays   

Requests

The following parameters are supported in JSON format

Parameter             

Mandatory

Type         Description   
countryCode

No

String

Filter by 2-character country code, for example, NZ for New Zealand, AU for Australia, see Supported Country List. Holidays from all countries will be returned if this parameter is not specified

startDateNoDateStart date of the range to query (in the format of "yyyy-mm-dd"), both the default and the minimum is today.
endDateNoDateEnd date of the range to query (in the format of "yyyy-mm-dd"), both the default and the maximum is (today + 1 year).
$fieldsNoStringSpecify the properties to include in the result set, e.g. $fields=date,description
$orderbyNoStringSpecify the sort order, e.g. $orderby=date. The default sort order is first by countryCode and then by date
$limitNoIntegerPage limit (number of records to return)
$offsetNoIntegerPage offset (number of records to skip)

Sample Request/s:

https://api.asb.co.nz/public/v1/public-holidays

https://api.asb.co.nz/public/v1/public-holidays?countryCode=AU&startDate=2014-08-01&endDate=2014-08-31

Responses

Responses are in JSON format

Parameter             Type           Description   
countryCodeString2-character country code, for example, NZ for New Zealand, AU for Australia.
dateStringDate in the format of "yyyy-MM-dd", all date values are of the local time of the applicable country.
description

String

Description for the holiday, for example "Christmas Day".

 

Return Codes:

The specific return codes for this API are: 

Code           Description   

200

Success

400

Bad Request

500

Internal Server Error

503

Service Unavailable – API service is currently unavailable

 

Sample Response/s:

Retrieving only NZ holidays, and exclude the countryCode from the output field.

GET https://api.asb.co.nz/public/v1/public-holidays?countryCode=NZ&$fields=date,description
{
    "value": [
        { "date": "2014-10-27", "description": "Labour Day" },
        { "date": "2014-12-25", "description": "Christmas Day" },
        { "date": "2014-12-26", "description": "Boxing Day" },
        ...
    ]
}


Retrieve all holidays from all countries for one month, order by date

GET https://api.asb.co.nz/public/v1/public-holidays?startDate=2014-09-01&endDate=2014-09-30&$orderby=date
{
    "value": [
        { "countryCode": "CA", "date": "2014-09-01", "description": "Labour Day" },
        { "countryCode": "US", "date": "2014-09-01", "description": "Labour Day" },
        { "countryCode": "HK", "date": "2014-09-09", "description": "Day After MidAutumn" },
        { "countryCode": "JP", "date": "2014-09-15", "description": "Respect For Aged Day" },
        { "countryCode": "PG", "date": "2014-09-16", "description": "Constitution Day" },
        { "countryCode": "JP", "date": "2014-09-23", "description": "Autumnal Equinox" },
        { "countryCode": "ZA", "date": "2014-09-24", "description": "Heritage Day" },
        { "countryCode": "IN", "date": "2014-09-30", "description": "Bank Holiday" }
    ]
}

Security

This API is non-authenticated

  • API URL : https://api.asb.co.nz