Native Message API - Get user 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 get user consent preference API call returns a JSON response that lists the purposes, vendors and the purposes the end-user has consented to/rejected for each vendor. This article describes the implementation, the JSON response with examples examples of both.


GET API call - Get user consent preferences

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

Retrieve end-user consent information with consentUUID

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

https://cdn.privacy-mgmt.com/consent/tcfv2/consent/v3/{SITE_ID}?consentUUID={CONSENT_UUID}&separateLegIntVendors={SEPARATE_LEG_INT_VENDORS}
Query param Required Description
{SITE_ID} Yes Site id of property setup. Can be found in the Sourcepoint dashboard
{CONSENT_UUID} Optional The user’s consentUUID. This can be set empty for new users but a value will be generated as part of the response. More information can be found in the following example
{SEPARATE_LEG_INT_VENDORS} Optional true if you wish to separate legitimate interest vendors

  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.

Retrieve end-user consent information with authId

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

https://cdn.privacy-mgmt.com/consent/tcfv2/consent/v3/{SITE_ID}?authId={AUTH_ID}&separateLegIntVendors={SEPARATE_LEG_INT_VENDORS}
Query param Required Description
{SITE_ID} Yes Site id of property setup. Can be found in the Sourcepoint dashboard
{AUTH_ID} Yes The end-user's authenticated id
{SEPARATE_LEG_INT_VENDORS} Optional true if you wish to separate legitimate interest vendors

  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 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 a third-party service like Postman.

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, consentUUID and (optionally) separateLegIntVendors.

get_user_prefs.png

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
consentUUID The UUID value for the end-user
categories[], legIntCategories[] List of purposes, legitimate interest purposes approved by the end-user
vendors[], legIntVendors[] List of vendors, legitimate interest vendors approved by the end-user
euconsent The end-user's TC string
grants object Click here
dateCreated The time and date the JSON report was created

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
{
    "consentUUID": "9d00d173-2f08-447f-80f9-b7bad187f4f0",
    "categories": [
        "5e8b11c3ebdb0627ecca27ab",
        "5e8b11c3ebdb0627ecca279c",
        "5e8b11c3ebdb0627ecca279f",
        "5e8b11c3ebdb0627ecca27a0",
        "5e8b11c3ebdb0627ecca279d",
        "5e8b11c3ebdb0627ecca279b",
        "5e8b11c3ebdb0627ecca279e",
        "5e8b11c3ebdb0627ecca27a1",
        "5e8b11c3ebdb0627ecca27a2",
        "5e8b11c3ebdb0627ecca27a3"
    ],
    "legIntCategories": [
        "5e8b11c3ebdb0627ecca279c",
        "5e8b11c3ebdb0627ecca279d",
        "5e8b11c3ebdb0627ecca279b"
    ],
    "vendors": [
        "5eab3d5ab8e05c1c467dab7a",
        "5eab3d5ab8e05c2bbe33f398",
        "5e37fc3e56a5e60dff4e1987",
        "5f369a02b8e05c2f2d546a41",
        "5e37fc3e56a5e6615502f9c3",
        "5e7ced57b8e05c485246ccd8",
        "5e7ced57b8e05c4854221bd0",
        "5e37fc3e56a5e66147767221",
        "5eb559cfb8e05c111d01b4e3",
        "5e98e7f0b8e05c1c467daaf1",
        "5e37fc3e56a5e60e003a7124",
        "5ee15bc6b8e05c164c398ae3",
        "5e37fc3e56a5e6615502f9d2",
        "5e865b36b8e05c48537f60a7",
        "5eab3d5ab8e05c241a63c5dc",
        "5e37fc3e56a5e60dff4e1986",
        "5e98e7f0b8e05c48537f6111",
        "5e7ced56b8e05c4854221bb3",
        "5f520ca8b8e05c64357e20f4",
        "5e98e7f0b8e05c1c467daaf0",
        
        ...
        ...
        ...
        
        "5eb559d0b8e05c6f984a390b",
        "60e81aada228630e634e06b1"
    ],
    "legIntVendors": [
        "5e7792c8d8d48d7950873ff3",
        "5e7f6927b8e05c48537f6074",
        "5e7786abf443bb795772efee",
        "5e77890cd8d48d7950873ef7",
        "5e7793636fbbc471e4b62573",
        "5f21834b4e23d23c6c4ce0f3",
        "5f2a2b392b87b72624a333f2",
        "5f1b2fbeb8e05c3057240f67",
        "5f1b2fbdb8e05c3057240f55",
        "5f1b2fbdb8e05c306f2a1eab",
        "5f1b2fbeb8e05c3057240f91",
        "5f1b2fbeb8e05c306e139f45",
        "5f1b2fbdb8e05c306f2a1eac",
        "5f1b2fbeb8e05c306643bae4",
        "5f1b2fbeb8e05c306f2a1ef5",
        "5f1b2fbdb8e05c306643bace",
        "5f1b2fbdb8e05c306d724992",
        "5f1b2fbeb8e05c306e139f58",
        "5f1b2fbeb8e05c306d7249a5",
        "5f1b2fbeb8e05c30686fd737",
        
        ...
        ...
        ...
        
        "5f1b2fbeb8e05c306e139f2a",
        "604b382da2286319d61aa96e"
    ],
    "specialFeatures": [],
    "euconsent": "CPOA6HgPOA6HgFZABCDEBwCgAP_AAEwAAAYgIDpb_T7VbWFCWf59fvsgOYxXVMCeA-QCAASAJ2ABgAKQcDwCkmAaNESgBgACIQAAoTJBIAIEDAEECUAA4AAEAAGgAAAEhAAIIAAAgBEAAAIYAAoCAIAAAACIwAAQEAAAm1gYA-bmGEBAhAAAYAgQgAAAAAIAAgAAAAAIAAAAAAAAAAgeOhGZIlVNQUDB6E08gAAIgBBUgBgAIAAAAIAiYACAABBgDAAAQBoAQIAAAAIgAACAEAEAAAAAAAQAQAAgAAQAAKAAAACAAAgAAACAEQAAABAACAIAgAAAAABAAAAAAACAEBAAAgIYAAAAAAAAAASAAAEAAgAAAAAAAAgJjIA4AQwAmACZAGoAPwAjgC8xoAEAFQwAEAWIA6oiAUAFYALYAhgBqAD8AOqAi8BOwCkQGTiAAIAJAoCMAAIABgAFAASABFACcAKAAVAAsAB2AEIAI4AUAApABXAC2AIsAaIA1ABxgEIgJMAk4BNACdgFZAK6AX4A_YB_QElgJaAU2AsQBfwDGQG1hoBwAVAArQBbAFwAQwA1AB-AEFANkAdUBF4CdgFIgMYAZOGABAHUAX0KgEgBDACYAFwATIA1AB-AEcAU2AvMWABABUKABgEFAOqAvodA2AAWABUADIAHAAQAAyABoADwAH0AQwBFACYAE-AKoArABYgC2ALoAXwAxABvADmAH4AQwAiIBLAEwAKMAUoAsQBhgDRAGoAPaAfgB-gEWAI4ASkAsQBcwC6gGKANwAcQA6gB6AENgIvATsAocBeYDBgGJAMYAZOAywBqoDxxwBaABwAHgAXABIADkAH4AzQCCwEHAQgAiIBeoDAAMCAZkA14B0gDqgHkASsArsBfQDIQGTANoIQFgAFgAZACGAEwAKoAXAAvgBiADeALEAagA_ACOAEpALmAYoA6gB6AGJAMnAaqA8cgAHAB-AQUAsQBgADMgHVAX0SgNgALAAyABwAHgARAAmQBUAFUALgAXwAxABtAEMAIgAUYApQBqgD8AI4AScAuoBigDcAHUAReAvMBk4DLCQAkABwAFwAcgDUAMyAa8A6oCVgF9FIFIACwAKgAZAA4ACAAGQANAAeQBDAEUAJgATwApQBUAFUALAAXwAxABzAD8AIYARAAmQBRgClAFiANEAasA_AD9AIsARwAlIBcwDFAG4APQAi8BOwChwF5gMYAZOA8coATAAuACQAHIAPwArABtAGoAScAnYBYgC6gGAANeAdUA8gCuwF9AMmAcEAA.YAAAAAAAAAAA",
    "grants": {
        "5e717c8e69966540e4554f05": {
            "vendorGrant": false,
            "purposeGrants": {
                "5e8b11c3ebdb0627ecca279b": false,
                "5e8b11c3ebdb0627ecca279d": false,
                "5e8b11c3ebdb0627ecca27a1": false,
                "5e8b11c3ebdb0627ecca27a4": false,
                "5e8b11c3ebdb0627ecca27ab": false
            }
        },
        "5e717c3a9a0b5040d5750816": {
            "vendorGrant": false,
            "purposeGrants": {
                "5e8b11c3ebdb0627ecca279b": false,
                "5e8b11c3ebdb0627ecca27a0": false,
                "5e8b11c3ebdb0627ecca279c": true,
                "5e8b11c3ebdb0627ecca279f": false,
                "5e8b11c3ebdb0627ecca279d": false,
                "5e8b11c3ebdb0627ecca279e": false,
                "5e8b11c3ebdb0627ecca27a1": false,
                "5e8b11c3ebdb0627ecca27a4": false,
                "5e8b11c3ebdb0627ecca27ab": false
            }
        },
        "5ed90e2947dbbd564700dfaa": {
            "vendorGrant": false,
            "purposeGrants": {
                "5e8b11c3ebdb0627ecca279b": false,
                "5e8b11c3ebdb0627ecca27a1": false,
                "5e8b11c3ebdb0627ecca27ab": false
            }
        },
        "5e717ad49a0b5040d5750815": {
            "vendorGrant": false,
            "purposeGrants": {
                "5e8b11c3ebdb0627ecca279b": false,
                "5e8b11c3ebdb0627ecca27a4": false
            }
        },
        
        ...
        ...
        ...
        
        "5e71764c69966540e4554f02": {
            "vendorGrant": true,
            "purposeGrants": {
                "5f20425eebd78b75ded8197a": true
            }
        }
    },
    "dateCreated": "2021-10-15T15:58:01.118Z",
    "hasConsentData": true
}     
      
Was this article helpful?
0 out of 0 found this helpful