Integrating with Webhooks
You can use webhooks to notify the occurrence of an event in real-time. Instead of frequently polling a system to keep up to date with events, the system can call an HTTP URL with data pertaining to an event as they occur.
OneTrust can consume events that are called out by many modern applications. Sample events include the following:
-
A new lead created in Marketo
-
Prospect updates their profile information in Salesforce
-
Newly created asset in ServiceNow
-
Consumer unsubscribes from marketing emails
The following tasks are required for event consumption by OneTrust to occur:
-
Defining an event on an external system. This is when OneTrust should be called.
-
Information pertaining to the event the system will provide to OneTrust.
-
An endpoint (URL) that the external system will call to when this event occurs.
-
An authentication method with OneTrust. This verifies that the system is in fact calling the endpoint.
To create a webhook trigger in OneTrust
The following integration uses sample JSON from sent through Postman to trigger a workflow, parse the body, and then include the parameters in the body to a make a second call to Webhook.site, the example system for this documentation.
To obtain a webhook URL
Generic POST Request Screen Reference
- Field
- Description
- Request URL
-
Paste the webhook.site URL you copied from webhook.site into the Request URL field.
- Body
-
Enter a JSON dynamic lookup option. It should resemble the following example:
JSON{ "firstNameFlow":"${(event.payload.firstname)!}", "emailFlow":"${(event.payload.email)!}" }
To verify the webhook integration
You can call the workflow from an external system to test the webhook. These instructions use Postman as a proxy system to demonstrate this verification.
Webhook Payload Types
Below are the payload types that are available in the Response tab of OneTrust actions for webhook configuration.
Keys that contain a null value will be removed from the payload for optimization.
-
JSON
-
Form-URL-Encoded
-
XML
-
Attachment
Note:This payload type has a number of extension types to select from. The action will default to ADAPTIVE.
Content-types for Webook Payloads
The following table details which content-types are available for each payload type supported by OneTrust. Content-types are needed when providing key-value pairs in the headers of your API call to a webhook.
|
Webhook Payload |
Content-Type Example |
|---|---|
|
JSON |
application/json |
|
Form URL Encoded |
application/x-www-form-urlencoded |
|
XML |
application/xml |
|
Adaptive/Attachments |
application/<file-extension> For PDF, this would be application/pdf |