/
1300: Fetch consent stream data

1300: Fetch consent stream data

Fetches a selection of consent data as a stream of actions
Endpoint ID:

1300

Method
POST
URLs:

/insights/consent
/insights/consent/entity/id/{entity-id}
/insights/consent/entity/ext-key/{ext-key}/{ext-type}


entity-idRubiq entity ID specifying the Rubiq Profile for which to fetch consent stream data

ext-keyExternal key, uniquely identifying the Rubiq Profile for which to fetch consent stream data

ext-typeType of external key
Request body:

OPTIONAL: JSON body containing filtering options for the request

{
	"afterID": 100,
	"beforeID": 103,
	"since": "2025-03-01T12:55:02"
}

beforeID and afterID are both eventIDs, and a combination of these may be used to filter the fetch request, allowing requests to be paged. 

Response body:

The response is a JSON object containing an "events" array of Event objects, where each event describes a particular consent event, plus a "paging" object describing which events have been returned, and if there are more that can be fetched.

The "event" property of the Event object may be one of the following:

  • "accept": A profile's first acceptance ever, or first acceptance after a previous withdrawal
  • "renew": A renewal of the same version of the terms
  • "upgrade": The acceptance was upgraded from "prevVersion" to "version"
  • "withdrawal": The acceptance was withdrawn
  • "expire": The acceptance has expired

The Event "object" property is either of "type" "consent" or "terms". When the type is "consent", the properties "version" and "prevVersion" are omitted.

The Event "contextData" contains key/value pairs of all context data associated with the event.

{
	"events": [
		{
			"event": "accept | renew | upgrade | withdraw | expire",
			"eventID": 1234,
			"entityID": 9876,
			"data": {},
			"timestamp": "2012-04-23T18:25:43.000Z",
			"object": {
				"id": "509b9d1e-46f9-4d6f-a34f-9c6678c95bdf",
				"type": "terms | consent",
				"name": "Name of object",
				"version": "null | x.x",
				"prevVersion": "null | x.x"
			},
			"source": {
				"id": "8d68a9f6-fd00-4003-b77a-068c0267b066",
				"name": "Name of source"
			},
			"contextData": {}
		}
	],
	"paging": {
		"fromID": 1234,
		"toID": 4567,
		"pageSize": 2,
		"more": true
	}
}

Optionally, the Event may be configured in Rubiq Cloud to include a "data" property, containing pre-configured Profile data. If needed, contact Fluid to configure which data to return.

Status codes:

HttpStatusCode
ApiStatusSubCode
Description
200
Consent stream data successfully returned
404404.1

EntityID not found

404404.2External relation key not recognized

Related content