Retrieve end-user consent profile (GDPR TCF)

Sourcepoint offers your organization an API to retrieve an end-user's current consent information. This API can be called by server-side code or through a third-party service like Postman.

An end-user's consent information can be retrieved using the consentUUID value or the authId value.


API endpoints

The API endpoints to retrieve an end-user's consent information using consentUUID or authId are as follows:

Retrieve end-user consent status with consentUUID

This API endpoint has two placeholders that need to be replaced with the correct values:

  • A property's site ID {__SITE_ID__}
  • The cookie consentUUID {__CONSENT_UUID__}
https://cdn.privacy-mgmt.com/consent/tcfv2/consent/v3/history/{__SITE_ID__}?consentUUID={__CONSENT_UUID__}

  Note: The site ID value is the same as the Property ID and can be found on the Properties page inline with the property name.

Screen_Shot_2022-08-22_at_11_18_49_AM.jpg

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

Retrieve end-user consent status with authId

This API endpoint has two placeholders that need to be replaced with the correct values:

  • A property's site id {__SITE_ID__}
  • The authenticated id {__AUTH_ID__}
https://cdn.privacy-mgmt.com/consent/tcfv2/consent/v3/history/{__SITE_ID__}?authId={__AUTH_ID__}

  Note: The site ID value is the same as the Property ID and can be found on the Properties page inline with the property name.

Screen_Shot_2022-08-22_at_11_18_49_AM.jpg

The authenticated id value can be retrieved from the first-party cookie authId.


Example implementation

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

Server-side script (PHP example) Using Postman

Your organization could use a server side script using code similar to the following PHP example to retrieve an end-user's consent status. You will need to provide the correct values for site id and consent UUID in the script.

<?php
    
$site_id = YYYY;
$consent_uuid = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX";
$api_endpoint = "https://cdn.privacy-mgmt.com/consent/tcfv2/consent/v3/history/".$site_id."?consentUUID=".$consent_uuid;
$handle = curl_init($api_endpoint);
$fileHandle = fopen("get_permission.json", "w");

/* If you encounter an 'SSL certificate problem: unable to get local issuer certificate' then enable the following two lines */
/* This is NOT recommended as a solution and should only be used as a quick and temporary fix */
//curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, 0);
//curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, 0); 

curl_setopt($handle, CURLOPT_FILE, $fileHandle);

curl_exec($handle);

curl_close($handle);
fclose($fileHandle);

?>

API response

The API GET will respond with a list of category and vendor names, IDs and vendor type (IAB or custom) to which the user consented to along with the date/timestamp of when the end-user provided their consent preferences. 

Complete example response
[{
{ "dateCreated": "2021-08-20T10:35:53.255Z", "consentUUID": "7831f5a8-67c9-4a38-a7cd-6fe4f30a7283", "messageId": 527245, "vendorListId": "5efca560b8e05c06542b2a31", "vendors": [ { "_id": "5eff0d77969bfa03746427eb", "name": "Permutive Technologies, Inc.", "vendorType": "CUSTOM" }, { "_id": "5ef9bca940f2dd141527cfe5", "name": "Discover Networks Danmark", "vendorType": "CUSTOM" }, { "_id": "5e716fc09a0b5040d575080f", "name": "Facebook, Inc.", "vendorType": "CUSTOM" }, { "_id": "5e7ac3fae30e7d1bc1ebf5e8", "name": "Youtube", "vendorType": "CUSTOM" }, { "_id": "5ecd230a94f7636f2ce14e4e", "name": "SurveyMonkey Inc", "vendorType": "CUSTOM" } ], "legIntVendors": [ { "_id": "5f1b2fbeb8e05c306f2a1f07", "name": "Better Banners", "vendorType": "CUSTOM" }, { "_id": "5f1b2fbeb8e05c306d7249a5", "name": "Cloudflare", "vendorType": "CUSTOM", "googleId": 1097 }, { "_id": "5f1b2fbeb8e05c3057240f90", "name": "Zuuvi", "vendorType": "CUSTOM", "googleId": 2337 }, { "_id": "5e37fc3e56a5e66147767229", "name": "Emerse Sverige AB", "vendorType": "IAB" }, { "_id": "5e98e7f0b8e05c1c467daaf1", "name": "Adkernel LLC", "vendorType": "IAB" } ], "categories": [ { "_id": "5efca56014c1b303fd15bde6", "name": "Select personalised content", "iabPurposeRef": { "name": "Select personalised content", "iabId": 6 } }, { "_id": "5efca56014c1b303fd15bc32", "name": "Select personalised ads", "iabPurposeRef": { "name": "Select personalised ads", "iabId": 4 } }, { "_id": "5efca56014c1b303fd15b9e8", "name": "Select basic ads", "iabPurposeRef": { "name": "Select basic ads", "iabId": 2 } }, { "_id": "5efca56014c1b303fd15bb23", "name": "Create a personalised ads profile", "iabPurposeRef": { "name": "Create a personalised ads profile", "iabId": 3 } }, { "_id": "5efca56014c1b303fd15bd49", "name": "Create a personalised content profile", "iabPurposeRef": { "name": "Create a personalised content profile", "iabId": 5 } }, { "_id": "5efca56014c1b303fd15be72", "name": "Measure ad performance", "iabPurposeRef": { "name": "Measure ad performance", "iabId": 7 } }, { "_id": "5efca56014c1b303fd15bfd8", "name": "Measure content performance", "iabPurposeRef": { "name": "Measure content performance", "iabId": 8 } }, { "_id": "5efca56014c1b303fd15c09b", "name": "Apply market research to generate audience insights", "iabPurposeRef": { "name": "Apply market research to generate audience insights", "iabId": 9 } }, { "_id": "5efca56014c1b303fd15c192", "name": "Develop and improve products", "iabPurposeRef": { "name": "Develop and improve products", "iabId": 10 } }, { "_id": "5efca56014c1b303fd15b891", "name": "Store and/or access information on a device", "iabPurposeRef": { "name": "Store and/or access information on a device", "iabId": 1 } } ], "legIntCategories": [ { "_id": "5efca56014c1b303fd15bde6", "name": "Select personalised content", "iabPurposeRef": { "name": "Select personalised content", "iabId": 6 } }, { "_id": "5efca56014c1b303fd15bc32", "name": "Select personalised ads", "iabPurposeRef": { "name": "Select personalised ads", "iabId": 4 } }, { "_id": "5efca56014c1b303fd15b9e8", "name": "Select basic ads", "iabPurposeRef": { "name": "Select basic ads", "iabId": 2 } }, { "_id": "5efca56014c1b303fd15bb23", "name": "Create a personalised ads profile", "iabPurposeRef": { "name": "Create a personalised ads profile", "iabId": 3 } }, { "_id": "5efca56014c1b303fd15bd49", "name": "Create a personalised content profile", "iabPurposeRef": { "name": "Create a personalised content profile", "iabId": 5 } }, { "_id": "5efca56014c1b303fd15be72", "name": "Measure ad performance", "iabPurposeRef": { "name": "Measure ad performance", "iabId": 7 } }, { "_id": "5efca56014c1b303fd15bfd8", "name": "Measure content performance", "iabPurposeRef": { "name": "Measure content performance", "iabId": 8 } }, { "_id": "5efca56014c1b303fd15c09b", "name": "Apply market research to generate audience insights", "iabPurposeRef": { "name": "Apply market research to generate audience insights", "iabId": 9 } }, { "_id": "5efca56014c1b303fd15c192", "name": "Develop and improve products", "iabPurposeRef": { "name": "Develop and improve products", "iabId": 10 }
} ] } ]
Consent information
"dateCreated": "2021-08-20T10:35:53.255Z",
"consentUUID": "7831f5a8-67c9-4a38-a7cd-6fe4f30a7283",
"messageId": 527245,
"vendorListId": "5efca560b8e05c06542b2a31"
Key Value
dateCreated Date consent status was created
consentUUID Consent UUID
messageId ID of first layer shown to end-user
vendorListId ID of vendor list
Vendor description (including legitimate interest)
"vendors": [
     {
          "_id": "5eff0d77969bfa03746427eb",
          "name": "Permutive Technologies, Inc.",
          "vendorType": "CUSTOM"
     }
]

"legIntVendors": [
     {
          "_id": "5f1b2fbeb8e05c306f2a1f07",
          "name": "Better Banners",
          "vendorType": "CUSTOM"
     }
]
Key Value
_id Sourcepoint vendor id
name Vendor name
vendorType Vendor type
Category description (including legitimate interest)
"categories": [
     {
          "_id": "5efca56014c1b303fd15bde6",
          "name": "Select personalised content",
          "iabPurposeRef": {
               "name": "Select personalised content",
               "iabId": 6
          }
     }
]

"legIntCategories": [
{ "_id": "5efca56014c1b303fd15bde6", "name": "Select personalised content", "iabPurposeRef": { "name": "Select personalised content", "iabId": 6 } } ]
Key Value
_id Sourcepoint purpose id
name Purpose name
iabPurposeRef:name IAB Purpose name
iabPurposeRef:iabId IAB Purpose Id
Was this article helpful?
0 out of 0 found this helpful