Sync Calendar API
2-way synchronization between your club management software and Anybuddy
v2 · Updated Dec 2024Web services and webhooks allow to synchronize court availability, create bookings and handle cancellations. All endpoints use HTTP REST / JSON.
Account Creation
Send an account creation request to contact@anybuddyapp.com with:
- An email address to contact you
- The webhook URL to receive booking events and pull availabilities
We will send you:
- The test and production service URLs
- A token to connect to the Anybuddy API
https://extsync.stage.anybuddyapp.com/api/testsync
Authentication
HTTP Basic authentication. Include the following header with every request:
Where credentials is the Base64 encoding of
id:password.
HTTP Codes
| Code | Description |
|---|---|
| 200 | Success of the request |
| 204 | Request successfully processed but no information to return |
| 401 | Authentication error, the token is not valid |
| 404 | Page not found |
Club Software → Anybuddy
Pull Calendar
Used to initialize the club calendar or when there is a sync issue. We call this API regularly to get all availabilities.
| Parameter | Description |
|---|---|
center_id | ID of the center |
date | Number of days to sync per club |
Response Body
Push: Update Slots
Call the Anybuddy API every time there is a change in the calendar (booking or cancellation). Send both available and unavailable slots.
Slot Attributes
| Attribute | Type | Description |
|---|---|---|
facilityId | string required | Unique identifier of the court |
facilityName | string required | Court name |
startDateTime | string required | Start date/time in ISO 8601 |
endDateTime | string required | End date/time in ISO 8601 |
isAvailable | boolean required | true if the slot is free |
facilityDescription | string optional | Court description |
facilitySurface | string optional | Court surface |
IsIndoor | boolean optional | true if indoor court |
sport | string required | Sport code: tennis, padel, squash, badminton |
slotId | string optional | Unique slot ID |
price | number optional | Slot price in cents (e.g. 1500) |
Surface Values
Request
Response
Returns HTTP 200 on success.
Anybuddy → Club Software
Anybuddy sends webhook events as JSON in the body of POST requests to notify your software of new reservations and cancellations.
Webhook Creation
Create an API endpoint to read POST requests. Requests are sent as JSON. You can include a token in the URL to secure it:
Check Message Signature (Optional)
Anybuddy can optionally sign webhook events by including a signature in the X-Anybuddy-Signature header. This lets you verify events were sent by Anybuddy.
New Booking Event
Sent when an Anybuddy player makes a reservation.
Event Attributes
| Attribute | Type | Description |
|---|---|---|
facilityId | string required | Unique identifier of the court |
startDateTime | string required | Start date/time in ISO 8601 |
endDateTime | string required | End date/time in ISO 8601 |
playerName1 | string optional | Player's full name |
slotId | string optional | Unique slot ID |
Request
Response
- 200 Booking confirmed by the software
- 400 Bad Request: server cannot process the request
- 401 Unauthorized: authentication required
- 403 Forbidden: slot unavailable for booking
- 404 Not Found: slot doesn't exist
- 409 Conflict: slot is not available
Event: Cancel a Reservation
Sent when an Anybuddy player cancels a reservation.
Response Codes
- 200 Cancellation confirmed by the software
- 400 Bad Request: server cannot process the request
- 401 Unauthorized: authentication required
- 403 Forbidden: not an Anybuddy slot
- 404 Not Found: slot doesn't exist
- 409 Conflict: slot is not available
Test Implementation
You can use the following form to test the API calls with your server:
Code Example
PHP — Call Anybuddy API
Need help? Contact contact@anybuddyapp.com