Configure a HTTP webhook

Webhooks are a premium feature that is not enabled for organizations by default. Make sure you reach out to support@didomi.io to enable this integration before configuring one for your organization.

Introduction

Webhooks allow you to subscribe to events happening on the Didomi platform to implement custom workflows when your users change their consent preferences. When an event is triggered, we'll send a HTTP POST payload to the configured endpoint.

Creating your integration configuration

To configure a HTTP Webhook integration for your organization, send a POST /marketplace/integrations request with the webhook-http type, the ID of your organization, and the URL (endpoint) through which the events will be received. By default, HTTP webhook authentication is disabled.

POST https://api.didomi.io/v1/marketplace/integrations?organization_id=YOUR_ORG_ID

BODY
{
  "type_id": "webhook-http",
  "authentication": {},
  "properties": {
    "url": "https://api.my-site.com/consents"
  }
}

Authentication

The HTTP webhook integration supports OAuth as authentication mechanism. To enable it, you can specify the url and the oauth credentials to get a session token (this token will be sent inside the Authorization HTTP header in the event webhook request) inside the authentication object.

POST https://api.didomi.io/v1/marketplace/integrations?organization_id=YOUR_ORG_ID

BODY
{
  "type_id": "webhook-http",
  "authentication": {
    "url": "https://api.my-site.com/oauth/token",
    "client_id": "***************",
    "client_secret": "******************"
  "properties": {
    "url": "https://api.my-site.com/consents"
  }
}

This will automatically start sending HTTP POST requests to your configured endpoint whenever a new Didomi event happens and your users consent preferences are updated.

For more information on HTTP webhooks, please visit the Webhooks documentation.

Last updated