Show Available Slots Count

This endpoint helps you quickly determine the number of open slots that can be booked within specified criteria, such as date ranges, resources, or schedulers. It is ideal for tracking availability and ensuring that sufficient booking opportunities are available to meet demand.

Authentication

This endpoint needs app token for authentication.

MethodPOST
Endpointv1/slots/count
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/count';
$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/count
{
    "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
{
    "sucess": true,
    "data": {
        "total": 432
    }
}
{
    "success": false,
    "errors": {
        "scheduler_id": "Entity not found"
    }
}