Show Unavailable Slots
This endpoint helps identify blocked times, such as existing bookings, maintenance periods, or any other non-bookable events that affect availability. It is particularly useful for ensuring that new bookings do not overlap with these unavailable slots, maintaining an accurate and conflict-free schedule.
Authentication
This endpoint needs app token for authentication.
Method | POST |
---|---|
Endpoint | v1/slots/unavailable |
Headers | Accept: application/json |
Authorization: Bearer <base64_encoded_token> | |
Token type | App |
Request Body:
This endpoint requires following parameters to be sent via post body:
Param Name | Required | Description |
---|---|---|
output_timezone_ | false | output results in timezone |
duration | false | duration in minutes or hours i.e. 30 minutes or 1 hours. If not provided uses scheduler settings. |
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. |
buffer_time | false | buffer in minutes or hours i.e. 30 minutes or 1 hours. If not provided uses scheduler buffer_time settings |
round_to_mins | false | round start time in increment of 15, 30, 45 or 60 minutes |
booking_window | false | slots look up period in days, weeks or months i,e. 4 weeks. If not provided uses scheduler booking_window settings |
resources | false | list of resources that falls under given scheduler |
scheduler_id | true | scheduler uuid |
Example Request:
Following code shows how to send request to create a resource in Slotify api.
- PHP
- BASH
- JSON
$apiEndpoint = 'https://api.slotify.ca/v1/slots/unavailable';
$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
{
"output_timezone": "America/Toronto",
"scheduler_id": "28f0b45d-d14f-438f-b59a-833a57a31147"
}
Example Response:
Following response will be provided by Slotify server when this endpoint is called:
- 200 OK
- 400 Bad Request
{
"success": true,
"data": []
}
{
"success": false,
"errors": {
"scheduler_id": "Entity not found"
}
}