API Reference

getUserConsentsUsnat

The getUserConsents command enables your organization to retrieve a list of privacy choices and their opt-in status. This command can be used for properties associated with a U.S. Multi-State Privacy (National) vendor list.

Command

//call the __gpp() function with the getUserConsentsUsnat command 
__gpp('getUserConsentsUsnat', function(consents, success){ console.log(consents) })
...
function getUserConsentsUsnat() {
  console.log("getUserConsentsUsnat called:");
  __gpp("getUserConsentsUsnat", (consents, success) => {
    if (success) {
      // do something with GPPData
      console.log(consents);
      console.log("getUserConsentsUsnat request was successful: " + success);
    } else {
      // do something else
      console.log("gpp call was not successful!");
    }
  });
}
...

Response

{
  "applies": true,
  "categories": [
    {
      "id": "655dde122889126b8bfcdb43",
      "consented": true
    }
  ],
  "vendors": [
    {
      "_id": "644b260b593fbd5396b01234",
      "consented": true
    }
  ]
}
schema:
  description: getUserConsentsUsnat return
  type: object
  properties:
    applies:
      type: boolean
      description: "true: end-user's region is in the framework territories | false: end-user's region is not in the framework territories"
    categories:
      type: array
      description: "Privacy choices that are applicable to the end-users region and opt-in status for each"
      items:
        type: object
        description: "Individual privacy choices that are applicable to the end-users region and opt-in status for each"
        properties:
          id:
            type: string
            description: "ID of the privacy choice"
            example: 655dde122889126b8bfcdb43
          consented:
            type: boolean
            description: "Whether privacy choice was opted into by the end-user"
            example: true
    vendors:
      type: array
      description: "Vendors configured in your U.S. Multi-State Privacy (National/State) vendor list and their consent status"
      items:
        type: object
        description: "Individual vendors configured in your U.S. Multi-State Privacy (National/State) vendor list and their opt-in status."
        properties:
          _id:
            type: string
            description: "ID of the vendor"
            example: "644b260b593fbd5396b01234"
          consented:
            type: string
            description: "Whether the vendor was opted into by the end-user"
            example: true