Integrations communicate with the outside world over HTTP. Your integration can receive HTTP requests from the outside callers, such as webhooks or callback URLs, and it can also receive events from the GitBook platform.
Most integrations will not need to deal with this low-level API, our framework takes care of that for you.
Your integration provides an API to the outside world like so:
The URL of the request contains the version of the API. Your integration is expected to be backwards compatible with previous (non-deprecated) versions of the API. If you're using GitBook's CLI to create your integration, we manage the backwards compatibility for you.
Requests contain a
FormDatabody with 3 properties:
eventcontains the event, and is of typing
environmentcontains the environment of this execution
fetch-bodycontains the raw buffer of the body sent with the request (if one exists)