Introduction to webhooks in ReflexBlue
Introduction
It’s increasingly common these days that collaboration is required between two or more online systems that need to communicate with each other to exchange data. To facilitate this, ReflexBlue supports setting up Integrations that allow data (such as products, relations, and orders) to be synchronized. When this data is updated, ReflexBlue can send webhook requests to external (back-end) systems.
In general, a webhook request is a HTTPS request that is automatically triggered by an event in a source system and sent to a target system, often with a package of data. This provides a way for one system (the source) to communicate with another system (the target) via a HTTPS request when an event occurs and to share information (request payload) about the event that has taken place.
In the context of ReflexBlue as the source system, webhook requests contain just enough information for the target system to know which data has been modified, enabling it to retrieve the updated data by making requests to the ReflexBlue Integration API.
Webhooks in ReflexBlue
When webhooks are created in ReflexBlue via the Webhooks overview screen, webhook events are automatically generated when they occur. For example, if you add a webhook for the Article updated event, then each time you modify an article in ReflexBlue, an Article updated webhook event will automatically be created. A newly created webhook event receives the status New. This event is then forwarded by ReflexBlue via a webhook request to an external system using the endpoint (or URL) specified for that webhook.
If communication with the external system fails, ReflexBlue will automatically attempt to resend the webhook request up to a total of ten times. After that, the webhook event will be assigned the status Failed. If sending the webhook request is successful, the event will receive the status Finished.
The table below provides an overview of the statuses that can be assigned to webhook events.
| Status | Description |
|---|---|
| New | The webhook event has just been created and has not yet been sent. |
| Retrying | Sending the webhook event failed but it will be retried. |
| Failed | Sending the webhook event has failed. |
| Finished | Sending the webhook event was successful. |
Monitoring webhook events
To gain insight into the webhook events that occur and to monitor and manage them afterwards, you can retrieve a list of events in the Webhook events overview screen, with the ability to search and filter this list.
This makes it easy, for example, to periodically retrieve a list of failed webhook events and take action on them. Failed webhook events can be retried by restarting them.
Cleaning up webhook events
Webhook events can also be periodically cleaned up automatically using Scheduled tasks in ReflexBlue. For this purpose, a Delete webhook events task is available.