This guide outlines how to subscribe to Relay webhook notifications using the notification service.
Why use webhooks?
Webhooks (or HTTP callbacks) allow you to subscribe to a variety of events and to get notified directly when these events happen.
To keep your backend in sync with our service, we highly recommend that you use webhooks. The advantages are many:
- Webhooks are robust against various runtime failures (network failures and other temporary processing failures).
We repost the events until you acknowledge the webhook by returning a 200 HTTP status code.
- Webhooks are efficient since they avoid polling us for state changes.
We send these notifications using HTTPS as JSON payload. Find a list of events you can subscribe to here.
Once you have decided which events you want to subscribe to, you must:
- create your webhook URL
- create your webhook notification request - (Subscribe to specific webhooks)
- verify received notifications
- parse the notification's JSON payload
We will walk you through each of these steps in this section.
Before parsing the incoming webhook notification's payload, you SHOULD verify the webhook.