Return consent information for the subject.

GET /v1/subjects/{type}/{subjectId}/consents?queryParameters

Returns consent information known for the subject for selected or all granules, and/or scopes. The query accepts the following parameters:

granules
A comma-separated list of granules to list. If omitted, all granules will be listed.
scopes
A comma-separated list of scopes to list. If specified, the resulting report will only include granules with these scopes.
status
A comma-separated list of consent statuses to list. Possible values are active, pending, and canceled. If omitted, consents with all statuses will be listed.
from
0-based offset into the result set.
max
Number of results to return. The maximum number of results that can be returned by a single API call is 100.

type determines the subject type, usually user.

Response

200 Ok

The response contains the total number of records matching the query, and the selected range of records.

{
 "total":120,
 "consents": [{
 {
   "id":"5398fstre4358923",
   "uri": "https://consentgrid.io/consent/v1/c?id=5398fstre435892",   
   "version": 2,
   "owner": {   
      "type": "user",
      "id": "358238768ef490"
      }
   "timestamp": "2009-11-10T23:00:00Z",
   "choices": { JSON object describing user choices },
   "status": "active",
   "granule": "granule1",
   "scopes": [ ... ],
   "value": true
  },...
  ]
}
400 Bad Request

Malformed request, invalid value, etc. The return value is a JSON error object containing diagnostic information.

403 Forbidden

The authenticated key does not have the privileges for this operation. The return value is a JSON error object containing diagnostic information.

404 Not Found

Subject not found.