Start receiving event payloads
Webhooks are currently available to Scale customers only, if you’re interested contact us.
To start receiving webhook events in your integration, create and register a webhook endpoint by following the steps below:
You can register and create one endpoint to handle several different event types at once, or set up individual endpoints for specific events.
Setup a webhook and subscribe to brand updates
See the events reference to identify the event types your webhook handler needs to process.
Set an HTTPS endpoint function that can accept webhook requests with a POST method.
Set up your endpoint function so that it:
This code snippet is a webhook function configured to check that the event type was received, to handle the event, and return a 200 response.
Example code for hasVerifiedPayload()
is available here.
Once your handler is deployed on the web and ready to go, register your endpoint with Brandfetch by creating a webhook using the GraphQL APIs createWebhook
mutation.
Registered webhook endpoint URLs must be publicly accessible HTTPS URLs.
The final step is to subscribe to the objects (like brands) for which you want to receive events. You can subscribe to a few objects, or many thousands—one at a time, or in batches.
For example, perhaps you want to receive events for the Brandfetch brand. The URN for this brand is urn:brandfetch:brand:idL0iThUh6which
means we would subscribe to that URN.
To add a subscription we need two things: The URN for the webhook we created ($webhookUrn: URN!
) and the URN for the object to which we want to subscribe to ($subscriptions: [URN!]!
).
To help debug your endpoint, or to later retrieve failed event deliveries when your endpoint has a long duration outage, you can review all of the events Brandfetch attempted to deliver to your webhook endpoint using the GraphQL API.
Performing the following GraphQL query on the Webhooks API will return a list of all attempted webhook deliveries, responses from your endpoint, and the respective HTTP status codes we received. Delivery history is kept for 30 days after which time it is irreversibly deleted.
Start receiving event payloads
Webhooks are currently available to Scale customers only, if you’re interested contact us.
To start receiving webhook events in your integration, create and register a webhook endpoint by following the steps below:
You can register and create one endpoint to handle several different event types at once, or set up individual endpoints for specific events.
Setup a webhook and subscribe to brand updates
See the events reference to identify the event types your webhook handler needs to process.
Set an HTTPS endpoint function that can accept webhook requests with a POST method.
Set up your endpoint function so that it:
This code snippet is a webhook function configured to check that the event type was received, to handle the event, and return a 200 response.
Example code for hasVerifiedPayload()
is available here.
Once your handler is deployed on the web and ready to go, register your endpoint with Brandfetch by creating a webhook using the GraphQL APIs createWebhook
mutation.
Registered webhook endpoint URLs must be publicly accessible HTTPS URLs.
The final step is to subscribe to the objects (like brands) for which you want to receive events. You can subscribe to a few objects, or many thousands—one at a time, or in batches.
For example, perhaps you want to receive events for the Brandfetch brand. The URN for this brand is urn:brandfetch:brand:idL0iThUh6which
means we would subscribe to that URN.
To add a subscription we need two things: The URN for the webhook we created ($webhookUrn: URN!
) and the URN for the object to which we want to subscribe to ($subscriptions: [URN!]!
).
To help debug your endpoint, or to later retrieve failed event deliveries when your endpoint has a long duration outage, you can review all of the events Brandfetch attempted to deliver to your webhook endpoint using the GraphQL API.
Performing the following GraphQL query on the Webhooks API will return a list of all attempted webhook deliveries, responses from your endpoint, and the respective HTTP status codes we received. Delivery history is kept for 30 days after which time it is irreversibly deleted.