Decline existing booking
When a booking is created in Manual mode, you will have an option to Confirm or Decline this booking. This endpoint is specifically used for declining an existing tentative booking.
Decline pending bookings that are not confirmed. Use this endpoint to reject bookings and keep your schedule organized.
Authentication
This endpoint needs app token for authentication.
Method | PUT |
---|---|
Token Type | App Token |
Endpoint | v1/bookings/:uuid/decline |
Headers | Accept: application/json |
Authorization: Bearer <base64_encoded_token> |
Request Body:
This endpoint requires following parameters to be sent via post body:
Param Name | Required | Description |
---|---|---|
resource_id | true | Resource uuid who is declining |
decline_message | true | Reason to decline |
Example Request:
The following code shows how to send request to decline a booking by resource:
- PHP
- NodeJS
require 'vendor/autoload.php';
use Slotify\Slotify;
$slotify = new Slotify('your_api_key');
$response = $slotify->declineBooking("fake-booking-uuid-1234", [
"resource_id" => "fake-resource-uuid-5678",
"decline_message" => "Resource unavailable at requested time"
]);
if ($response->isSuccess()) {
echo "Booking declined by resource successfully!";
} else {
echo "Failed to decline booking by resource: " . $response->getError();
}
const Slotify = require('slotify-sdk');
const slotify = new Slotify({ apiKey: 'your_api_key' });
slotify.declineBooking("fake-booking-uuid-1234", {
resource_id: "fake-resource-uuid-5678",
decline_message: "Resource unavailable at requested time"
})
.then(response => {
console.log("Booking declined by resource successfully:", response);
})
.catch(error => {
console.error("Failed to decline booking by resource:", error);
});
Example Response:
The following response will be provided by Slotify server when this endpoint is called:
- 204 No Content