getAvailability
Get the availability of a specified period.
Some clients allow to make a reservation for a day, others require to also select a time (for example het Van Gogh Museum).
URL
https://globalreseller.nl/webservices/getAvailability
HMAC calculation
apiKey + endDate + environment + showTicketsAllocation + startDate + userId
Input:
| Name | Datatype | Description |
|---|---|---|
| apiKey | String | Your public apiKey needs to be included in every request. |
| environment | Enum | "test" or "production" |
| userId | Integer | The userId is a reference to the user (museum / attraction). The userId can be requested via getAvailableUsers and can be cached in your application. |
| startDate | Date | Date format: yyyy-mm-dd. |
| endDate | Date | Date format: yyyy-mm-dd. |
| showTicketsAllocation | Integer | When set to 1 the response will include the amount of available tickets instead of a boolean. |
| HMACKey | String | The HMACKey is calculated based on the input fields. |
Output:
| Name | Datatype | Description |
|---|---|---|
| success | Boolean | Indicates if the request was successfully executed. |
| availabilityType | Enum |
Possible options: "timeslots", "date" and "oneyearvalid".
timeslots indicates that there are timeslots in place, those will appear in the "availability" output parameter. |
| availability | Array with availability dates (or dates + timeslots) | |
JSON output example availabilityType - Timeslots
{
"success": true,
"availability": {
"2018-05-16": {
"11:30": true,
"11:45": true,
"12:00": true,
"12:15": true,
"12:30": true,
"12:45": true,
"13:00": true,
"13:15": true,
"13:30": true,
"13:45": true,
"14:00": true,
"14:15": true,
"14:30": true,
"14:45": true,
"15:00": true,
"15:15": true,
"15:30": true,
"15:45": true,
"16:00": true,
"16:15": true,
"16:30": true,
"16:45": true,
"17:00": true
}
},
"availabilityType": "timeslots"
}
JSON output example availabilityType - Timeslots with showTicketsAllocation set true
{
"success": true,
"availability": {
"2018-05-16": {
"11:30": 22,
"11:45": 23,
"12:00": 45,
"12:15": 20,
"12:30": 22,
"12:45": 23,
"13:00": 22,
"13:15": 23,
"13:30": 22,
"13:45": 23,
"14:00": 22,
"14:15": 23,
"14:30": 22,
"14:45": 23,
"15:00": 22,
"15:15": 23,
"15:30": 20,
"15:45": 23,
"16:00": 13,
"16:15": 23,
"16:30": 22,
"16:45": 23,
"17:00": 18
}
},
"availabilityType": "timeslots"
}
JSON output example availabilityType - Date
{
"success": true,
"availability": [
"2018-05-16"
],
"availabilityType": "date"
}
JSON output example availabilityType - Period
{
"success": true,
"availabilityType": "period",
"availabilityPeriod": "2019-05-16"
}