Delete Specific Booking
This endpoint is used to cancel and delete bookings that are no longer needed or have been requested for cancellation by the customer. Deleting a booking frees up the associated time slots and resources and makes them available for other bookings.
When using this endpoint, it's essential to handle the deletion process carefully, as it permanently removes the booking record and cannot be undone.
Authentication
This endpoint needs an app token for authentication:
Method | DELETE |
---|---|
Endpoint | v1/resources/:uuid |
Headers | Accept: application/json |
Authorization: Bearer <owner_token> | |
Token Type | App |
Example Request:
The following code shows how to send a request to delete a specific booking in Slotify API:
- PHP
- BASH
$endpoint = 'https://api.slotify.ca/v1/resources/' . $uuid;
$owner_token = base64_encode('app_token');
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => $endpoint,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer ' . $owner_token,
'Accept: application/json'
),
));
$response = curl_exec($curl);
if(curl_errno($curl)) {
echo 'Error: ' . curl_error($curl);
} else {
$decoded_response = json_decode($response, true);
if(isset($decoded_response['message'])) {
echo 'Customer deleted successfully: ' . $decoded_response['message'];
} else {
echo 'Failed to delete customer.';
}
}
curl -X DELETE \
https://api.slotify.ca/v1/resources/:uuid \
-H 'Authorization: Bearer ' \
-H 'Accept: application/json'
Example Response:
The following response will be provided by the Slotify server when this endpoint is called:
- 204 No Content