BioT Interceptor Plugins

BioT Interceptor plugins will be called before or after an API call and let the plugin modify the call request or response. The plugins are useful when you want to modify an API request before it is processed by BioT or modify the response before it arrives to the UI.

Implementation

Plugins are a piece of code that hook into the platform APIs just before or after the API call is handled by the platform. The plugin enables you to modify the API request and response accordingly.

720720

Subscribing to Events

Each service in BioT has an "Interception API" that allows you to subscribe, unsubscribe and search for existing subscriptions.
To subscribe to an API, call the subscribe API of the service:
POST ​​<https://your-biot-domain.com/><service>/v1​/hooks​/interceptions​/subscribe

Parameter

Description

Format

type

The type of subscription. The supported values are:
PRE_REQUEST (Modify the request)
POST_REQUEST (Modify the response)

  • ADAPT_ENTITY (Modify the entity - see entityName description below)
    Mandatory

String

apiId

The ID of the API that you want to subscribe to. This only applies to PRE_REQUEST & POST_REQUEST types.
For possible values, see the API documentation for the service you are subscribing to.
Optional

String
For example:
POST/organization/v1/users/patients

entityName

The entity name that you want to modify.
Provided only if type=ADAPT_ENTITY.
For possible values, see the API documentation for the service you are subscribing to.
Optional

String
For example:
patient

endpoint

A valid URI for the platform to call when the event is triggered.
Mandatory.

String

📘

Note

For each API, only a single subscription can be made. A new subscription to the same API will override the old one.

Unsubscribing from Events

Using the same "interception" service, you can unsubscribe from an event.
To unsubscribe from an event, call the unsubscribe API of the service:
POST ​<https://your-biot-domain.com/><service>/v1/hooks/interceptions/unsubscribe

The call body should be the same as the subscribed call, just without the endpoint.
For example:

{
  "type": "PRE_REQUEST",
  "apiId": "POST/organization/v1/users/patients"
}

Did this page help you?