Webhooks

Last updated 3 months ago

ConsentEye webhooks is a way for server-side apps to get real-time notifications about events occurring while using the ConsentEye API i.e. creating an agreement, creating a data subject ect

What’s a webhook?

In short, a webhook is a simple way for app developer to specify a URL in order to receive notifications based on some trigger (ex. creating a data subject). There are several different webhooks that can be triggered, once a webhook is triggered we will send you a send a HTTP POST payload to your defines URL. From there you can so whatever you wish with the data, you could the webhooks to save data you your own CRM system.

Why use ConsentEye webhooks?

ConsentEye webhooks will notify you instantly about events that have occurred within the app or through the API , such as:

  • A Data subject being created

  • A Data subject being updated

  • The creation of agreement containing consents

  • An agreement being updated

  • The creation of a receipt ( a data subjects response to an agreement)

Getting started

To get started with the with the ConsentEye triggers...

  1. Log into the ConsentEye app

  2. Navigate to developer settings which can be found in the dropdown in the top right corner

  3. Set the URL's for where you would like the web hooks you send data to

  4. Test the webhook by performing one of the following actions...

    1. Creating / updating a Data subject

    2. Publishing and agreement

    3. Creating / updating an Agreement

    4. Creating a Receipt for a Data subject

  5. If the trigger was successful the you will receive data to the URL that has been specified

Data subject event triggers

Create Data subject

Description: Data subject has been created and stored into ConsentEye

Example webhook response:

{
"id":"5b851588fa55d60005d345f3",
"firstName":"John",
"lastName":"Smith",
"email":"john.smith@consenteye.com",
"organisationId":"5b7fde0b4fdbaf0005a36819",
"uid":"1",
"importDate":1535448456,
"importedBy":"5b7fde0d4fdbaf0005a3681a"
}

Update Data subject

Description: An existing data subject has been updated and the new changes have been stored

Example webhook response:

{
"id":"5b851588fa55d60005d345f3",
"firstName":"John",
"lastName":"James",
"email":"john.james@consenteye.com",
"organisationId":"5b7fde0b4fdbaf0005a36819",
"uid":"1",
"importDate":1535448456,
"importedBy":"5b7fde0d4fdbaf0005a3681a",
"updatedAt":1535449104,
"updatedBy":"5b7fde0d4fdbaf0005a3681a"
}

Agreement event triggers

Create/Publish Agreement

Description: Agreement has been created and stored in ConsentEye

Example webhook response:

{
"Id":"5b85156c2415df0005d3c9c9",
"Name":"test agreement",
"Parent":"5b85156c2415df0005d3c9c8",
"OrganisationId":"5b7fde0b4fdbaf0005a36819",
"Published":true,
"Description":"{\"blocks\":[{\"key\":\"5lhvq\",\"text\":\"we have made changes to our privacy policy\",\"type\":\"unstyled\",\"depth\":0,\"inlineStyleRanges\":[],\"entityRanges\":[],\"data\":{}}],\"entityMap\":{}}",
"consents":[
{
"id":"5b8515662415df0005d3c9c6",
"heading":"do you consent to email marketing",
"description":"we need your email to send promotions",
"organisationId":"5b7fde0b4fdbaf0005a36819",
"Parent":"5b8515662415df0005d3c9c7",
"CreationDate":1535448422,
"CreatedBy":"5b7fde0d4fdbaf0005a3681a"
}
],
"Version":1,
"PublicationDate":1535448428,
"CreationDate":1535448428,
"UpdateDate":1535448428,
"CreatedBy":"5b7fde0d4fdbaf0005a3681a",
"LastUpdatedBy":"5b7fde0d4fdbaf0005a3681a"
}

Update/Publish Agreement

Description: An existing agreement has been updated

Example webhook response:

{
"Id":"5b851aa02415df0005d3c9ca",
"Name":"test agreement 1",
"Parent":"5b85156c2415df0005d3c9c8",
"OrganisationId":"5b7fde0b4fdbaf0005a36819",
"Published":true,
"Description":"{\"blocks\":[{\"key\":\"5lhvq\",\"text\":\"we have made changes to our privacy policy, we need you to review your consents\",\"type\":\"unstyled\",\"depth\":0,\"inlineStyleRanges\":[],\"entityRanges\":[],\"data\":{}}],\"entityMap\":{}}",
"consents":[
{
"id":"5b8515662415df0005d3c9c6",
"heading":"Do you consent to email marketing",
"description":"we need your email to send promotions",
"organisationId":"5b7fde0b4fdbaf0005a36819",
"Parent":"5b8515662415df0005d3c9c7",
"CreationDate":1535448422,
"CreatedBy":"5b7fde0d4fdbaf0005a3681a"
}
],
"Version":2,
"PublicationDate":1535449760,
"CreationDate":1535448428,
"UpdateDate":1535449760,
"CreatedBy":"5b7fde0d4fdbaf0005a3681a",
"LastUpdatedBy":"5b7fde0d4fdbaf0005a3681a"
}

note: Its important to understand the difference between an agreement in a published/unpublished state. If an agreement is in a published state then its available for consent request, if an agreement is in an unpublished state then its classified as a draft. In order to publish a draft, the agreement need to be updated so the "published" boolean is set to true. So an agreement can be published when being created and also when it is updated

Receipt event triggers

Description: When a data subject has given consent to an agreement, a receipt is created and stored into ConsentEye

Example webhook response:

{
"id":"5b851c33fa55d60005d345fb",
"token":"56fLXdZITAMO9LUNaX5qcmJuLzPhv3tSHcRTLrxSbRZoDAJQ1G0MavwA6MBjmxYYrx5j4NZNr9JCL-zaubs7_u0AJEnM47jxLE1b4KQpaHbJwQY9m5j5sO5LakW213iMScKHiI-U0Jifonv9rc1SJIAA3wwhUC0yVaCV57xIoST8wS48EgBrtHvzGQ4-8eWwoOyzjVkqp9DMwkhSwDi5MgFF0Vvj6QkUJ488ZhWyFYPqTZ84F1sP35VZW6clHdTPOWzpecwcTSxlAKiRZ99w-jqPFI25pYptrDkpXt4z1ZnkzN6XWfIGHX-zjQNHHMytPl0o6bWSMmardqqVVjbtwZau3vuL8xB-0q67e0gCTPcDF1lSnKyZmGX95EpHlYPwSsGccf3IQdHr5U23MwlqrLLqKPaNgWH-ZKPz0t7BAkwnJIWdlgD5kTIWWYqlD-EGjjS-xhcOTsvMJWB_C_VObuvNYOnB7jzGCo91DKft40Hr7EPhULH0NwrJis7ACoklS09zKQ4jKK3TncgtwKry694m7VrjnRuYALrriDu4xjcaZ2LO8lpez0aImiQ3uT5RAkeP-eznBIp4qSe9j_ehMFCRO8JX2yx3rj4svilx72-pRrP_nE-QCMJ9fPmTgawbNkG6ta0J119P",
"agreementId":"5b851aa02415df0005d3c9ca",
"consents":[
{
"id":"5b8515662415df0005d3c9c6",
"response":true
}
]
}

note: The token is a consent request token that was created for data subject for a particular agreement