Show Available Dates
This endpoint retrieves available dates for booking appointments or reservations within a specified date range. It dynamically calculates availability based on current bookings, predefined scheduling rules, and resource constraints to provide a real-time view of open dates. This ensures users can make informed decisions when selecting a date for their desired service or resource.
Authentication
This endpoint needs an app token for authentication:
Method | POST |
---|---|
Endpoint | v1/slots/available/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 available dates in the Slotify API:
- PHP
- BASH
- JSON
$apiEndpoint = 'https://api.slotify.ca/v1/slots/available/dates';
$apiToken = base64_encode("app-token");
$data = array(
"scheduler_id" => "28f0b45d-d14f-438f-b59a-833a57a31147",
"output_timezone" => "America/Toronto",
"start" => "2024-09-05T09:00:00-04:00",
"end" => "2024-09-05T10:00:00-04:00"
);
$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 '{
"scheduler_id": "28f0b45d-d14f-438f-b59a-833a57a31147",
"output_timezone": "America/Toronto",
"start": "2024-09-05T09:00:00-04:00",
"end": "2024-09-05T10:00:00-04:00"
}' \
https://api.slotify.ca/v1/slots/available/dates
{
"scheduler_id": "28f0b45d-d14f-438f-b59a-833a57a31147",
"output_timezone": "America/Toronto",
"start": "2024-09-05T09:00:00-04:00",
"end": "2024-09-05T10:00:00-04:00"
}
Example Response:
The following response will be provided by the Slotify server when this endpoint is called:
- 200 Ok
- 400 Bad Request
{
"success": true,
"data": [
"2025-01-03"
]
}
{
"success": false,
"errors": {
"scheduler_id": "Entity not found"
}
}