Zum Inhalt springen

Introduction

With the Bookingmood API you can access and manage your data in a programmatic way, using HTTP requests. The structure of the Bookingmood API is based on PostgREST v14.

Base URL

All endpoints are relative to https://api.bookingmood.com/v1. Every request must be authenticated with an API key, which scopes all data to its organization.

OpenAPI spec

The whole API, including the booking flow, is described in an OpenAPI 3.0 spec with request and response schemas. Import it into tools like Postman or Insomnia, or use it to generate a typed client.

Requests

Each core resource supports some or all of the following methods:

  • GET /{resource} lists records. Use selecting, filtering and sorting & pagination to shape the result.

  • POST /{resource} creates one record, or several when the body is an array.

  • PATCH /{resource} updates all records matching the filters.

  • DELETE /{resource} deletes all records matching the filters.

Request bodies are JSON, sent with the Content-Type: application/json header. Updates and deletes without filters apply to every record you have access to, so always filter, for example on id=eq.{id}.

Responses

Responses are JSON. By default the API sends Prefer: count=exact, return=representation to PostgREST, so:

  • Creates, updates and deletes return the affected records.

  • List responses include a Content-Range header with the returned range and the total number of matching records, for example 0-9/42.

To change this, send your own Prefer header. For example, Prefer: return=minimal returns 204 No Content for updates and deletes.

Errors

The API uses conventional HTTP status codes:

  • 400 The request is malformed, for example an unknown column, an invalid filter, or a body that doesn't match the endpoint's schema.

  • 401 The API key is missing or invalid.

  • 403 The API key has no permission for this record.

  • 405 The resource does not exist, or the method is not available for it.

  • 409 The request conflicts with existing data, for example a duplicate key.

  • 5xx Something went wrong on our side.

Errors have a JSON body following the PostgREST error format, with a code, message, details and hint. When a request doesn't match an endpoint's schema, for example on the booking flow endpoints, the code is BM400 and details lists each invalid field. Every request, including failed ones, is logged and can be inspected through the API requests resource.

Rate limits

The API currently has no rate limits. Please keep your usage reasonable: paginate large lists instead of fetching everything at once, and avoid polling more often than you need. Rate limits may be introduced in the future, in which case requests over the limit will receive a 429 Too Many Requests response.

Example response headers
HTTP
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Range: 0-9/42
Example error
JSON
{
  "code": "PGRST204",
  "details": null,
  "hint": null,
  "message": "Could not find the 'nme' column of 'products' in the schema cache"
}

Übernehmen Sie die Kontrolle über Ihre Buchungen. Bauen Sie Ihr eigenes Unternehmen auf.

Schließen Sie sich den über 1200 unabhängigen Anbietern von Ferienunterkünften an, die Bookingmood nutzen, um ihre Direktbuchungen zu steigern und engere Beziehungen zu ihren Gästen aufzubauen.

Starten Sie Ihren kostenlosen 14-Tage-Test