Return subject consent records for a consent granule.

GET /v1/subjects/{type}/{subjectId}/granules/{granule}/consents?status=active,canceled,pending&from=n&max=n

Returns consent records for a subject for a consent granule. With no query parameters, this API will return active consents that have not expired yet. This behavior can be changed by these query parameters:

status
Comma-separated list of consent statuses. Can include active, canceled and pending. If omitted, only active consents will be returned.

The result set size is controlled by the from and max query parameters:

from
Starting index of the consent record, when ordered by consent date in descending order. Starts from 0.
max
Maximum number of consents to return. Defaults to, and capped at 100.

Response

200 Ok

The response contains the consent 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
  },...]
}
404 Not Found

Subject not found.