Authentication overview
Choose between OAuth2 or an API key, with an example header for each.
The Booking Experts API supports three ways to authenticate. Which one you use depends on who installs your app and which endpoints you call.
| Method | Header | Use it when | Gives access to |
|---|---|---|---|
| OAuth2 | Authorization: Bearer <access_token> | Other organizations install your app. Required for public apps | One organization per token, limited to the administrations and permissions the user approved |
| API key | X-API-KEY: <api_key> | You build an app for your own organization, or you're testing | One organization per key, limited to the administrations and permissions of the installation |
Use OAuth2 for anything other organizations will installAPI keys are meant for your own organization and for testing. Public apps must use OAuth2.
OAuth2
When an organization installs your app, Booking Experts redirects to your redirect URI with an authorization code. You exchange the code for an access token and a refresh token. See OAuth2 Flow for the full flow.
curl --request GET "https://api.bookingexperts.com/v3/subscription" \
--header "Accept: application/vnd.api+json" \
--header "Authorization: Bearer YOUR_ACCESS_TOKEN"- Access tokens are valid for 1 week (
expires_in: 604800). Use the refresh token to get a new one. - Only the
authorization_codegrant is supported. - Redirect URIs must use HTTPS.
API key
When the app's authentication method is API key, every installation gets its own key. You find it on the installation page of the app.
curl --request GET "https://api.bookingexperts.com/v3/subscription" \
--header "Accept: application/vnd.api+json" \
--header "X-API-KEY: YOUR_API_KEY"The key has the same permissions as your app and works for the organization where the app is installed. See API Key.
Permissions (scopes)
OAuth2 tokens and API keys only work for endpoints your app has permission for. Scopes have the form <resource>|<action>:
readforGETrequests, such asreservation|readwriteforPOSTandPATCHrequests, such asreservation|writedeleteforDELETErequests, such asreservation|delete
Some scopes are namespaced, such as channel::booking|read, and a few use manage, such as checkout_portal|manage. Each endpoint's reference page lists the scopes it needs.
To check which scopes your token or key has, call GET subscription and read current_scopes.
Environments
| Environment | Base URL |
|---|---|
| Production | https://api.bookingexperts.com |
| Staging | https://api.staging.bookingexperts.com |
Tokens and API keys only work in the environment where they were issued.
Webhooks and commands include an X-BE-Env header with the value production or staging, so you can tell which environment sent the request.
Rate limits
Each installation of your app gets a bucket of 100 requests per 3 minutes. Installations don't share their limit. App API key requests are limited per app. See the API introduction for details.
Authentication errors
All authentication errors return 403 Forbidden:
| Code | Cause |
|---|---|
INVALID_TOKEN | The token or API key is missing, invalid or revoked |
NO_VALID_SCOPE | The token or key doesn't have a scope the endpoint needs. The detail lists the scopes that would work |
APPLICATION_HALTED | Your app has been blocked and can't use the API |
{
"errors": [
{
"status": "403",
"code": "INVALID_TOKEN",
"title": "Forbidden",
"detail": "The token you specified is invalid or revoked"
}
]
}Updated about 4 hours ago