Check user consent.

GET https://api.consentgrid.io/v1/checkconsent/{type}/{subjectId}/{consents}?detail=false
Authorization: Bearer apiKey
GET https://api.consentgrid.io/v1/my/checkconsent/{acct}/{consents}?detail=false
cookie cgs_{accountURL}: session

Check user consent using a GET request. The subject type, subject ID, and comma-separated list of SmartConsents are provided as path parameters.

type
Subject type, usually user.
subjectId
The identifier of the user the consent belongs to.
consents
One or more comma-separated SmartConsents for which to check consent.
detail
Optional query parameter to return template and consent information along with the consent value.
context.*
Optional context fields as query parameters.

This API will check the active user consent for the SmartConsent with given context. The output contains the results and optionally form and consent details :

If detail=false or not specified:

{ 
  "SmartConsent1": {
    "value": true
  },
  "SmartConsent2": {  
    "value": false,
  },
  ...
}

If detail=true, the output will contain consent detail information:

{
  "SmartConsent1": {
    "value": true,
    "consentDetail": [
      {
        "uri":"https://api.consentgrid.io/consent/v1/c?handle=1a78b468727647ffeefe",
        "data" {
          "uri":"https://api.consentgrid.io/template/v1/d?id=3a0b468728763ce56fe",
          "name": "resourceName",
          "lastVersion": 2,
          "consentVersion": 1
        }
      },...
    ],
  ...
  },
 }

Every element of consentDetail contains a consent record for this consent, and the template and template data recorded when the consent was recorded. The lastVersion is the current latest version of the template used to accept/reject the consent. The consentVersion is the version of the template used to display the end-user terms and conditions, disclosures, etc. These two can be used to check if the template has been modified since the consent has been recorded.

Example

The following calls retrieve the consent "email", with purpose "marketing":

GET /v1/checkconsent/user/123abhdsf/email?context.purpose=marketing