BookyFlow uses OAuth2 for API authentication. You'll need to obtain an access token before making API requests to protected endpoints.
For basic BookyFlow operations, you need:
For channel management operations, after obtaining a token you must:
X-BOOKYFLOW-channel-name header in all subsequent requestsPOST /bookyflow/api/oauth/token
Content-Type: application/x-www-form-urlencoded
| Parameter | Type | Required | Description |
|---|---|---|---|
grant_type |
string | Yes | Must be client_credentials |
client_id |
string | Yes | Your Client ID |
client_secret |
string | Yes | Your Client Secret |
scope |
string | Yes | Required API scopes (space-separated) |
curl -X POST https://yourdomain.com/bookyflow/api/oauth/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=YOUR_CLIENT_ID" \
-d "client_secret=YOUR_CLIENT_SECRET" \
-d "scope=read write"
{
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9...",
"token_type": "Bearer",
"expires_in": 3600
}
Include the access token in the Authorization header of your requests:
Authorization: Bearer YOUR_ACCESS_TOKEN
curl -X GET https://yourdomain.com/bookyflow/api/properties \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
When creating API credentials, you must specify which scopes (permissions) the key should have. Scopes are defined in each API plugin's scopes.json file.
Common scopes include:
read - Read access to resourceswrite - Create and update resourcesdelete - Delete resourcesSome API endpoints do not require authentication and are marked with an asterisk (*) in this documentation. These endpoints can be accessed without an access token.
All dates must be sent in YYYY-MM-DD format.
Example: 2024-11-17
Replace @variable_name placeholders with actual values:
@property_id → actual property UID@booking_id → actual booking IDThe API follows RESTful conventions:
{
"error": "unauthorized",
"error_description": "Invalid or expired token"
}
Solution: Request a new access token.
{
"error": "forbidden",
"error_description": "Insufficient scope"
}
Solution: Ensure your API key has the required scopes.