Save Consent Preferences

The Sourcepoint Consent API allows developers to implement a variety of consent experiences on their platform through the use of a REST API. The Sourcepoint API is a fully integrated part of the Sourcepoint platform that leverages the Campaign, Scenario, and Message definitions managed in the Sourcepoint Portal.

Using the Sourcepoint platform with the Consent API allows developers to integrate consent management capabilities into their own apps and distribution channels, while still allowing business configuration to be managed by non-technical users.

The save consent preferences API call allows developers to update the end-user consent for each purpose and vendor through their own apps. This article describes the implementation and the JSON response with examples examples of both.


POST API call - Save user preferences

The API endpoints to retrieve an end-user's consent information using consentUUID:

API endpoint

https://cdn.privacy-mgmt.com/consent/tcfv2/consent/v3/{SITE_ID}?consentUUID={CONSENT_UUID}
Parameter Description
{SITE_ID} Site id of property setup. Can be found in the Sourcepoint dashboard. See note below.
consentUUID The end-user’s consentUUID. This value is saved as a cookie.

  Note: The site id value can be found by selecting a property from the Dialogue dashboard and navigating to the browser address bar. The site id value will be shown in the browser address bar.

site_id.png

The consentUUID value can be retrieved from the first-party cookie consentUUID.


Example implementation

Your organization can call the API endpoint using a server-side script or a third-party service like Postman.

In these examples, two IAB purposes "Store and/or access information on a device" (IAB purpose id 1) and "Select personalised content" (IAB purpose id 6) will be granted consent. A vendor in the vendor listed will be granted consent also (IAB vendor id 109).

With Postman PHP code

Your organization can use a third party service like Postman to retrieve an end-user's consent purposes. You will need to provide the correct API endpoint address and values for siteID and consentUUID.

save_user_pref.png

categories object

Field Description
_id The Sourcepoint id for the purpose
type Is the purpose an IAB type or custom
iabId The IAB id for the purpose
consent Value true if consent is given for this purpose, otherwise false
legInt Value true if purpose is legitimate interest, otherwise false

vendors object

Field Description
_id The Sourcepoint id for the vendor
type Is the vendor accredited with the IAB or custom
iabId The IAB id for the vendor
consent Value true if consent is given for this vendor, otherwise false
legInt Value true if vendor has legitimate interest, otherwise false

JSON response

The response from the native message API call is a JSON string with several objects & values. The following is a description of the JSON response with their objects and values.

Field Description
categories[] object List of Sourcepoint ids for categories given consent
legIntCategories[] object List of Sourcepoint ids for legitimate categories given consent by the end-user
vendors[] object List of vendors given consent by the end-user
legIntVendors[] List of legitimate vendors given consent by the end-user
dateCreated The time and date the JSON report was created
euconsent The TC string for the consent given by the end-user
consentUUID The consentUUID value
rejectedAny true if any purposes have been rejected by the end-user
consentedToAll true if all purposes have been accepted by the end-user
gdprApplies Does GDPR apply in this situation
cookies object See below
grants object See below

cookies object

Field Description
key The name of the cookie
value The value of the cookie
maxAge The lifetime of the cookie
shareRootDomain true if the cookie has a shared root domain

grants object

Field Description
_id (prefix) The Sourcepoint id for the vendor
vendorGrant true if the end-user accepts all purposes for this vendor
purposeGrants[] List of Sourcepoint ids for purposes and whether consent has been granted by the end-user
Sample - JSON response
{
   "categories": [
      "60925aa29ccb1d3420efabf7",
      "60925aa29ccb1d3420efac36"
   ],
   "legIntCategories": [
      "60925aa29ccb1d3420efabf7",
      "60925aa29ccb1d3420efac36"
   ],
   "vendors": [
      "5e7ced57b8e05c47e418b73c"
   ],
   "legIntVendors": [
      "5e7ced57b8e05c47e418b73c"
   ],
   "dateCreated": "2022-01-13T19:11:35.246Z",
   "euconsent": "CPSxL4IPSxL4IAGABCENB9CgAIQAAAQAAAYgA2wAQA2gDbABADaAAAAA.YAAAAAAAAAAA",
   "specialFeatures": [],
   "consentUUID": "dd71fcf5-b1fe-4ecb-9ef9-6e9fa616b471_3",
   "rejectedAny": true,
   "consentedToAll": false,
   "gdprApplies": true,
   "cookies": [
      {
         "key": "consentUUID",
         "value": "dd71fcf5-b1fe-4ecb-9ef9-6e9fa616b471_3",
         "maxAge": 31536000,
         "shareRootDomain": false
     }
   ],
   "grants": {
      "5e7ced57b8e05c47e418b73c": {
         "vendorGrant": false,
         "purposeGrants": {
            "60925aa29ccb1d3420efabf7": true,
            "60925aa29ccb1d3420efabfe": false,
            "60925aa29ccb1d3420efac05": false,
            "60925aa29ccb1d3420efac0b": false,
            "60925aa29ccb1d3420efac12": false,
            "60925aa29ccb1d3420efac19": false,
            "60925aa29ccb1d3420efac20": false,
            "60925aa29ccb1d3420efac27": false,
            "60925aa29ccb1d3420efac2e": false,
            "60925aa29ccb1d3420efac36": true
         }
      },
      "5f1aada6b8e05c306c0597d7": {
         "vendorGrant": false,
          "purposeGrants": {
             "60925aa29ccb1d3420efabf7": false,
             "60925aa29ccb1d3420efabfe": false,
             "60925aa29ccb1d3420efac0b": false,
             "60925aa29ccb1d3420efac12": false,
             "60925aa29ccb1d3420efac19": false,
             "60925aa29ccb1d3420efac20": false,
             "60925aa29ccb1d3420efac27": false,
             "60925aa29ccb1d3420efac2e": false,
             "60925aa29ccb1d3420efac36": false
          }
       },
       "5f3bc0d7b8e05c606f3dfc27": {
          "vendorGrant": false,
          "purposeGrants": {
             "60925aa29ccb1d3420efabf7": false,
             "60925aa29ccb1d3420efabfe": false,
             "60925aa29ccb1d3420efac05": false,
             "60925aa29ccb1d3420efac0b": false,
             "60925aa29ccb1d3420efac12": false,
             "60925aa29ccb1d3420efac19": false,
             "60925aa29ccb1d3420efac20": false,
             "60925aa29ccb1d3420efac27": false,
             "60925aa29ccb1d3420efac2e": false,
             "60925aa29ccb1d3420efac36": false
          }
       },
       "5e37fc3e56a5e6614776722e": {
          "vendorGrant": false,
          "purposeGrants": {
             "60925aa29ccb1d3420efac2e": false,
             "60925aa29ccb1d3420efac36": false
          }
       }
    },
    "addtlConsent": "1~"
}
Was this article helpful?
0 out of 0 found this helpful