Webhooks are code that executes when an event happens. Advocate allows you to use webhooks to register a URL that we will POST to any time an event happens in your program, e.g., when a vanity coupon code is created for a new participant, or an event object is created. There are two methods for creating and managing webhooks: via the Advocate API or in the Advocate platform. This help article will explain how to manage webhooks through the Advocate platform.
From the left navigation menu, select
[Menu] → Settings.
In the left column below Advocate Settings, select Webhooks.
On the Webhook Subscriptions page, select Create Subscription.
Below Post to URL, enter the unique address the application uses to send real-time updates about specific events.
Optionally, below Webhook Name, enter the name of the new webhook subscription.
Select Save.
When you register a URL to which Advocate posts whenever an event happens in your program, you can review the logs and troubleshoot any webhook events that fail.
From the left navigation menu, select
[Menu] → Settings.
In the left column below Advocate Settings, select Webhooks.
On the Webhook Subscriptions page, select View Logs.
Use the filters below Webhooks Event Log to filter the webhooks.
Refer to the Filter reference below for more information.
Filter
Description
Type
Filter for the webhook event type. This filter defaults to All Types.
Period
Filter for the period in which the webhook was last updated. This filter defaults to All time.
Select a specific webhook to open the Webhook Details view.
This view provides information that can be used to troubleshoot a webhook subscription.
Refer to the Event reference below for more information.
Filter
Description
Type
The webhook event type.
Webhook ID
The webhook's unique identifier.
Date Created
The date on which the webhook was created.
Event Data
The webhook payload.
Subscription(s)
Webhook subscriptions to which the webhook was sent and their status.
Subscription Details
Details about the response received from the webhook subscription endpoint. Details can include webhook's delivery attempt, showing the timestamp of the attempt, the HTTP status code received from the destination, and whether the attempt timed out due to the request taking too long to receive a response from the destination server.
Rest hooks are delivered immediately after an event is triggered. If the endpoint does not successfully respond to a delivery attempt (i.e., respond with a status code other than 200), the delivery will be considered as failed.
Failed deliveries will be reattempted every hour after the previous failed attempt until either a successful delivery is made or until 72 attempts have been made (approximately 3 days at the rate of 1 retry per hour).
Webhook endpoints that consistently return errors will be automatically disabled after the following number of errors:
Status code
Errors received
4xx errors
1000
5xx errors
2000
3xx errors
2000