Show Unavailable Dates
This endpoint identifies unavailable dates, such as holidays, maintenance periods, or fully booked days that cannot be reserved. It is particularly useful for ensuring that new bookings are only made on available dates to help to maintain an accurate and conflict-free schedule.
Authentication
This endpoint needs an app token for authentication:
Method | POST |
---|---|
Endpoint | v1/slots/unavailable/dates |
Headers | Accept: application/json |
Authorization: Bearer <base64_encoded_token> | |
Token type | App |
Request Body:
This endpoint requires the following parameters to be sent via post body:
Param Name | Required | Description |
---|---|---|
output_timezone | false | output results in timezone |
start | false | start date to search slots. If not provided uses scheduler settings. |
end | false | end date to search slots. If not provided uses scheduler settings. |
resources | false | list of resources that falls under given scheduler |
scheduler_id | true | scheduler uuid |
Example Request:
The following code shows how to send a request to find blocked dates in the Slotify API:
- PHP
- BASH
- JSON
$apiEndpoint = 'https://api.slotify.ca/v1/slots/unavailable/dates';
$apiToken = base64_encode("app-token");
$data = array(
"output_timezone" => "America/Toronto",
"scheduler_id" => "28f0b45d-d14f-438f-b59a-833a57a31147"
);
$ch = curl_init($apiEndpoint);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Authorization: Bearer ' . $apiToken,
'Content-Type: application/json'
));
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
$response = curl_exec($ch);
if(curl_errno($ch)){
echo 'Error: ' . curl_error($ch);
}
curl_close($ch);
echo $response;
curl -X POST \
-H "Authorization: Bearer <APP_TOKEN>" \
-H "Content-Type: application/json" \
-d '{"output_timezone": "America/Toronto", "scheduler_id": "28f0b45d-d14f-438f-b59a-833a57a31147"}' \
https://api.slotify.ca/v1/slots/unavailable/dates
{
"output_timezone": "America/Toronto",
"scheduler_id": "28f0b45d-d14f-438f-b59a-833a57a31147"
}
Example Response:
The following response will be provided by the Slotify server when this endpoint is called:
- 200 OK
- 400 Bad Request
{
"output_timezone": "America/Toronto",
"scheduler_id": "9ec10152-a808-446a-9f61-91046b90b0dc"
}
{
"success": false,
"errors": {
"scheduler_id": "Entity not found"
}
}