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.

MethodPOST
Endpointv1/slots/unavailable
HeadersAccept: application/json 
Authorization: Bearer <base64_encoded_token> 
Token typeApp

Request Body:

This endpoint requires following parameters to be sent via post body:

Param NameRequiredDescription
output_timezone_falseoutput results in timezone
durationfalseduration in minutes or hours i.e. 30 minutes or 1 hours. If not provided uses scheduler settings.
startfalsestart date to search slots. If not provided uses scheduler settings.
endfalseend date to search slots. If not provided uses scheduler settings.
buffer_timefalsebuffer in minutes or hours i.e. 30 minutes or 1 hours. If not provided uses scheduler buffer_time settings
round_to_minsfalseround start time in increment of 15, 30, 45 or 60 minutes
booking_windowfalseslots look up period in days, weeks or months i,e. 4 weeks. If not provided uses scheduler booking_window settings
resourcesfalselist of resources that falls under given scheduler
scheduler_idtruescheduler 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"
    }
}