Documentation
Everything you need to integrate BookingAPI into your application
Quickstart Guide
Get up and running with BookingAPI in under 5 minutes.
1. Get Your API Key
First, sign up for an account and get your API key from the dashboard:
https://app.bookingapi.ca/dashboard/api-keys2. Install the SDK
Install the BookingAPI SDK for your language:
# Node.js / JavaScript
npm install @bookingapi/sdk
# Python
pip install bookingapi
# Ruby
gem install bookingapi3. Make Your First Request
Here's a simple example to create a booking:
import BookingAPI from '@bookingapi/sdk';
const client = new BookingAPI({
apiKey: 'your_api_key_here'
});
// Create a booking
const booking = await client.bookings.create({
service: 'haircut',
date: '2024-03-15',
time: '14:00',
customer: {
name: 'John Doe',
email: 'john@example.com',
phone: '+1234567890'
}
});
console.log('Booking created:', booking.id);
console.log('Status:', booking.status);4. Retrieve a Booking
// Get booking details
const booking = await client.bookings.get('bk_abc123');
console.log(booking);Authentication
BookingAPI uses API keys to authenticate requests. Include your API key in the Authorization header:
curl https://api.bookingapi.ca/v1/bookings \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"Security Note: Keep your API keys secure. Never commit them to version control or expose them in client-side code.
Making Requests
All API requests should be made to:
https://api.bookingapi.ca/v1The API accepts JSON-encoded request bodies and returns JSON-encoded responses.
Webhooks
Webhooks allow you to receive real-time notifications when events occur in your BookingAPI account.
Setting Up Webhooks
Configure webhooks in your dashboard or via the API:
const webhook = await client.webhooks.create({
url: 'https://your-site.com/webhook',
events: ['booking.created', 'booking.updated', 'booking.cancelled']
});Error Handling
BookingAPI uses conventional HTTP response codes:
| Code | Meaning |
|---|---|
| 200 | Success |
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Invalid API key |
| 404 | Not Found - Resource doesn't exist |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Server Error - Something went wrong |