Configure a HTTP webhook
Webhooks are a premium feature that is not enabled for organizations by default. Make sure you reach out to [email protected] 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 /integrations request with the webhook-http type, a name and a description for your integration, the ID of your organization, and the URL (endpoint) through which the events will be received. By default, HTTP webhook authentication is disabled.
1
POST https://api.didomi.io/v1/integrations
2
3
BODY
4
{
5
"name": "My Webhooks integration",
6
"description": "Testing the webhooks integration",
7
"organization_id": "didomi",
8
"type": "webhook-http",
9
"config": {
10
"url": "https://api.my-site.com/consents",
11
"authentication": {
12
"enabled": false
13
}
14
}
15
}
16
Copied!

Authentication

The HTTP webhook integration supports OAuth as authentication mechanism. To enable it, set the enabled property to true, and the type to oauth. Inside the params property, 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). The lifetime property defines the lifetime of your session token so a new token can be fetched before the current one expires.
1
POST https://api.didomi.io/v1/integrations
2
3
BODY
4
{
5
"name": "My Webhooks integration",
6
"description": "Testing the webhooks integration",
7
"organization_id": "didomi",
8
"type": "webhook-http",
9
"config": {
10
"url": "https://api.my-site.com/consents",
11
"authentication": {
12
// Enabling OAuth
13
"enabled": true,
14
"type": "oauth",
15
"lifetime": 3600,
16
"params": {
17
"url": "https://api.my-site.com/oauth/token",
18
"credentials": {
19
"client_id": "***************",
20
"client_secret": "******************"
21
}
22
}
23
}
24
}
25
}
Copied!
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 modified 2mo ago