__tcfapi function - getCustomVendorConsents call

Sourcepoint has extended the functionality of the IAB's TCF API to offer your organization additional commands that can be used with the __tcfapi() function call. This provides a level of consistency and feature overlap between IAB TCF API and custom function integrations.

The getCustomVendorConsents command enables your organization to handle vendors that participate in the TCF API and custom vendors that do not participate in the TCF API.


the getCustomVendorConsents command

The command returns a JSON object that contains information on IAB and custom vendors an end-user consents to, the legitimate interest and consent purposes mapped to a vendor. The getCustomVendorConsents command can be called as follows:

getCustomVendorConsents command

__tcfapi('getCustomVendorConsents', 2, function(data, success) { console.log(data); });

Example implementation

Your organization can call the getTCData command through the browser console or Javascript code on a webpage.

The command returns a JSON object that contains information on IAB and custom vendors an end-user consents to, the legitimate interest and consent purposes mapped to a vendor.

Browser console command Code example
//Input into browser console to receive response
__tcfapi('getCustomVendorConsents', 2, function(data, success) {console.log("getCustomVendorConsents response: ", data, " + ", success);});

API response

The response is a JSON object that contains the consent data and this is divided into four parts - consentedPurposes, consentedVendors, grants, legIntPurposes. The format of these four sections are described next.

consentedPurposes

The consentedPurposes section lists the purposes that apply to the end-user. The consented purposes are listed as follows:

Parameter Description
_id Purpose ID
name Purpose description as described in vendor list

index: {_id: "purpose id", name: "purpose description"}

consentedPurposes: Array(10)
   0: {_id: "60925aa29ccb1d3420efac20", name: "Select basic ads"}
   1: {_id: "60925aa29ccb1d3420efac2e", name: "Measure ad performance"}
   2: {_id: "60925aa29ccb1d3420efac0b", name: "Apply market research to generate audience insights"}
   3: {_id: "60925aa29ccb1d3420efabf7", name: "Select personalised content"}
   4: {_id: "60925aa29ccb1d3420efabfe", name: "Create a personalised content profile"}
   5: {_id: "60925aa29ccb1d3420efac05", name: "Measure content performance"}
   6: {_id: "60925aa29ccb1d3420efac19", name: "Select personalised ads"}
   7: {_id: "60925aa29ccb1d3420efac27", name: "Create a personalised ads profile"}
   8: {_id: "60925aa29ccb1d3420efac36", name: "Store and/or access information on a device"}
   9: {_id: "60925aa29ccb1d3420efac12", name: "Develop and improve products"}

consentedVendors

The consentedVendors section lists the custom vendors in the vendor list that apply to the end-user. The custom vendors are listed as follows:

Parameter Description
_id Vendor ID
name Vendor name as described in vendor list
vendorType The vendor type, if the vendor is custom or affiliated to the IAB

index: {_id:"vendor id", name:"vendor name", vendorType:"vendor type"}

consentedVendors:
   0: {_id: "5f3bc0d7b8e05c606f3dfc27", name: "Artefact S.A.", vendorType: "CUSTOM"}

grants

The grants section lists the consented purposes for each vendor. The consented purposes are listed as follows:

Parameter Description
vendor_id Vendor ID
purpose_id Purpose ID
status Status is true if the purpose applies to an end-user
vendorGrant • Status is true if all purposes for a vendor apply to an end-user

• Status is false if one or more purposes for a vendor do not apply to an end-user.

The vendorGrant status is set to true if the end-user has granted consent to all purposes assigned to a vendor. If the end-user denies consent for one or more purposes then the vendorGrant status is set to false

vendor_id: purposeGrants: { "purpose_id 1": status, "purpose_id 2": status, ...}, vendorGrant: status

grants:
   5e37fc3e56a5e6614776722e:    
   purposeGrants: {
      6011ea75c5d9c787531b3ecf: true,
      6011ea75c5d9c787531b3ed6: true,
      6011ea75c5d9c787531b3ede: true,
      6011ea75c5d9c787531b3efd: true,
      6011ea75c5d9c787531b3f0e: true,
      6011ea75c5d9c787531b3f05: true,
      6011ea75c5d9c787531b3f18: true
   },
   vendorGrant: true

legIntPurposes

The legIntPurposes section lists the purposes that are listed as legitimate interest for all vendors. The legitimate interest purposes are listed as follows:

Parameter Description
_id Purpose ID
name Purpose description as described in vendor list

index: {_id: "purpose id", name: "purpose description"}

legIntPurposes: Array(6)
   0: {_id: "6011ea75c5d9c787531b3ede", name: "Apply market research to generate audience insights"}
   1: {_id: "6011ea75c5d9c787531b3ee6", name: "Select personalised content"}
   2: {_id: "6011ea75c5d9c787531b3eed", name: "Create a personalised content profile"}
   3: {_id: "6011ea75c5d9c787531b3ef5", name: "Measure content performance"}
   4: {_id: "6011ea75c5d9c787531b3f05", name: "Create a personalised ads profile"}
   5: {_id: "6011ea75c5d9c787531b3f18", name: "Develop and improve products"}

Complete example

Object {
   dateCreated: "2022-02-28T15:11:26.129Z"
   newUser: true
   consentedPurposes {
      0: {_id: "60925aa29ccb1d3420efac20", name: "Select basic ads"}
      1: {_id: "60925aa29ccb1d3420efac2e", name: "Measure ad performance"}
      2: {_id: "60925aa29ccb1d3420efac0b", name: "Apply market research to generate audience insights"}
      3: {_id: "60925aa29ccb1d3420efabf7", name: "Select personalised content"}
      4: {_id: "60925aa29ccb1d3420efabfe", name: "Create a personalised content profile"}
      5: {_id: "60925aa29ccb1d3420efac05", name: "Measure content performance"}
      6: {_id: "60925aa29ccb1d3420efac19", name: "Select personalised ads"}
      7: {_id: "60925aa29ccb1d3420efac27", name: "Create a personalised ads profile"}
      8: {_id: "60925aa29ccb1d3420efac36", name: "Store and/or access information on a device"}
      9: {_id: "60925aa29ccb1d3420efac12", name: "Develop and improve products"}
   }
   consentedVendors:
      0: {_id: "5f3bc0d7b8e05c606f3dfc27", name: "Artefact S.A.", vendorType: "CUSTOM"}
   grants:
      5e7ced57b8e05c47e418b73c:    
         purposeGrants: {
            60925aa29ccb1d3420efabf7: true,
            60925aa29ccb1d3420efabfe: true,
            60925aa29ccb1d3420efac05: true,
            60925aa29ccb1d3420efac0b: true,
            60925aa29ccb1d3420efac12: true,
            60925aa29ccb1d3420efac19: true,
            60925aa29ccb1d3420efac20: true,
60925aa29ccb1d3420efac27: true,
60925aa29ccb1d3420efac2e: true,
60925aa29ccb1d3420efac36: true,
62092ef7dbaa6007ad004677: true }, vendorGrant: true
5e7ced57b8e05c47e418b73c: purposeGrants: { 60925aa29ccb1d3420efabf7: true, 60925aa29ccb1d3420efabfe: true, 60925aa29ccb1d3420efac05: true, 60925aa29ccb1d3420efac0b: true, 60925aa29ccb1d3420efac12: true, 60925aa29ccb1d3420efac19: true, 60925aa29ccb1d3420efac20: true,
60925aa29ccb1d3420efac27: true,
60925aa29ccb1d3420efac2e: true,
60925aa29ccb1d3420efac36: true,
62092ef7dbaa6007ad004677: true }, vendorGrant: true
5f1aada6b8e05c306c0597d7: purposeGrants: { 60925aa29ccb1d3420efabf7: true, 60925aa29ccb1d3420efabfe: true, 60925aa29ccb1d3420efac0b: true, 60925aa29ccb1d3420efac12: true, 60925aa29ccb1d3420efac19: true, 60925aa29ccb1d3420efac20: true, 60925aa29ccb1d3420efac27: true,
60925aa29ccb1d3420efac2e: true,
60925aa29ccb1d3420efac36: true,
62092ef7dbaa6007ad004677: true
       }, vendorGrant: true
5f3bc0d7b8e05c606f3dfc27: purposeGrants: { 60925aa29ccb1d3420efabf7: true, 60925aa29ccb1d3420efabfe: true, 60925aa29ccb1d3420efac05: true, 60925aa29ccb1d3420efac0b: true, 60925aa29ccb1d3420efac12: true, 60925aa29ccb1d3420efac19: true, 60925aa29ccb1d3420efac20: true,
60925aa29ccb1d3420efac27: true,
60925aa29ccb1d3420efac2e: true,
60925aa29ccb1d3420efac36: true,
62092ef7dbaa6007ad004677: true
       }, vendorGrant: true
5e37fc3e56a5e6614776722e: purposeGrants: { 60925aa29ccb1d3420efac2e: true, 60925aa29ccb1d3420efac36: true, 62092ef7dbaa6007ad004677: true
       }, vendorGrant: true legIntPurposes: Array(6) 0: {_id: "6011ea75c5d9c787531b3ede", name: "Apply market research to generate audience insights"} 1: {_id: "6011ea75c5d9c787531b3ee6", name: "Select personalised content"} 2: {_id: "6011ea75c5d9c787531b3eed", name: "Create a personalised content profile"} 3: {_id: "6011ea75c5d9c787531b3ef5", name: "Measure content performance"} 4: {_id: "6011ea75c5d9c787531b3f05", name: "Create a personalised ads profile"} 5: {_id: "6011ea75c5d9c787531b3f18", name: "Develop and improve products"} }
Was this article helpful?
0 out of 0 found this helpful