Skip to main content

Webhooks

There is the possibility to be dynamically advertised by some events. For example when a run is completed (with his payload). This gives you the option not to worry about polling to see only one or more attributes change.

The current webhooks available events are:

In the message that is sent by webhook, is specified what is the triggering event followed by his payload. The payload is structured the same as the base event (exam_request.retrieved return a payload of an exam_request).

The message is composed like the following structure:

{
"event": "exam_request.retrieved",
"payload": {
"id": 25,
"status": "retrieved",
"start_date": "2022-01-01T10:42:00.000Z",
"end_date": "2022-01-07T23:59:00.000Z",
"patient_id": 24,
"device_id": 27
}
}

exam_request.retrieved

This event is generated when a requested exam request is being retrieved. This is due to the fact that retrieving data from device producer is not instantaneous.

exam_request.error

This event is generated when a requested exam request couldn't retrieve the data from device producer due to error(s). This could be generated if the device has no longer the updated tokens.

run.completed

This event is generated when a run completed the examination. This is due to the fact that the run of the exam is executed by a separated service.

run.error

This event is generated when a run terminate with error(s). This could be generated if there are some data error(s).

device.needs_authorization

This event is generated when the token(s) of a device is expired, so it's necessary to refresh the registration of the device to device producer.

device.updated

This event is generated when the device has been updated. This could be generated for notify of the correct authorization to device producer.