Introduction

TheBooking REST API

TheBooking implements a REST API to make the interaction with its data easier for developers.

Auth API tokens

In order to use the API, a client must provide an authorization API token to identify itself.

Authorization tokens can be generated inside the Settings > API section. A token can authorize either read-only operations (GET) or read-writing data operations (POST or GET).

A token can't be modified, but it can be revoked (deleted).

API base url

The base URL that a REST request has to call can be found inside the Settings > API section. It depends on your WordPress installation and on how permalinks are set, generally it has this form:

https://mywebsite.com/index.php?rest_route=/thebooking/v1/api/

so for instance, a GET call for listing reservations should be directed to:

http://mywebsite.com/index.php?rest_route=/thebooking/v1/api/reservations/get/

Authorization

Each API request must be equipped with a REST API token. Once a token is generated, it must be included in the Authorization header of the request:

Authorization Bearer <token>

Last updated

Was this helpful?