Get collection point ID
GET /api/v1/external/public/collection-points
A collection point is a named location where consent is requested (e.g. “Signup Form” or “In-App Purchase Flow”). Its display_id is the bannerId you pass to the SDK.
Use the assetId you discovered in the previous step.
Fetch collection points for an asset
Section titled “Fetch collection points for an asset”curl -X GET "https://truapi-dev.truconsent.io/api/v1/external/public/collection-points?asset_id=$ASSET_ID" \ -H "X-API-Key: $ADMIN_API_KEY" \ -H "X-Org-Id: $ORGANIZATION_ID"const response = await fetch( "https://truapi-dev.truconsent.io/api/v1/external/public/collection-points?asset_id=" + ASSET_ID, { headers: { "X-API-Key": ADMIN_API_KEY, "X-Org-Id": ORGANIZATION_ID, }, });const { data } = await response.json();interface CollectionPoint { id: string; display_id: string; name: string; status: "active" | "draft" | "archived"; asset_id: string; version: string; purposes: string[];}
const response = await fetch( "https://truapi-dev.truconsent.io/api/v1/external/public/collection-points?asset_id=" + ASSET_ID, { headers: { "X-API-Key": ADMIN_API_KEY, "X-Org-Id": ORGANIZATION_ID, }, });const { data }: { data: CollectionPoint[] } = await response.json();import osimport requests
asset_id = os.environ["ASSET_ID"]url = "https://truapi-dev.truconsent.io/api/v1/external/public/collection-points"params = {"asset_id": asset_id}headers = { "X-API-Key": os.environ["ADMIN_API_KEY"], "X-Org-Id": os.environ["ORGANIZATION_ID"],}response = requests.get(url, params=params, headers=headers)data = response.json()["data"]Invoke-RestMethod -Method Get ` -Uri "https://truapi-dev.truconsent.io/api/v1/external/public/collection-points?asset_id=$env:ASSET_ID" ` -Headers @{ "X-API-Key" = $env:ADMIN_API_KEY "X-Org-Id" = $env:ORGANIZATION_ID }Sample response
Section titled “Sample response”{ "data": [ { "asset_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", "name": "Signup Form Banner", "display_id": "CP010", "description": "Consent banner shown at user signup", "status": "active", "version": "v1.0.0", "purposes": [ "pppppppp-pppp-pppp-pppp-pppppppppppp", "qqqqqqqq-qqqq-qqqq-qqqq-qqqqqqqqqqqq" ] }, { "asset_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb", "name": "In-App Purchase Flow", "display_id": "CP011", "description": "Consent for purchase-related data collection", "status": "draft", "version": "v1.0.1", "purposes": [ "rrrrrrrr-rrrr-rrrr-rrrr-rrrrrrrrrrrr" ] } ], "count": 2}The display_id (e.g. CP010) is your bannerId. Use the collection point whose status is active and whose name matches the consent flow you are integrating.
Responses
Section titled “Responses”Returns all collection points for the specified asset.
{ "data": [ { "asset_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", "name": "Signup Form Banner", "display_id": "CP010", "description": "Consent banner shown at user signup", "status": "active", "version": "v1.0.0", "purposes": [ "pppppppp-pppp-pppp-pppp-pppppppppppp", "qqqqqqqq-qqqq-qqqq-qqqq-qqqqqqqqqqqq" ] }, { "asset_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb", "name": "In-App Purchase Flow", "display_id": "CP011", "description": "Consent for purchase-related data collection", "status": "draft", "version": "v1.0.1", "purposes": [ "rrrrrrrr-rrrr-rrrr-rrrr-rrrrrrrrrrrr" ] } ], "count": 2}| Field | Description |
|---|---|
id | Collection point UUID. |
display_id | Short identifier used as bannerId in the SDK (e.g. CP010). |
name | Human-readable name set in the dashboard. |
status | active, draft, or archived. Only active collection points accept consent submissions. |
version | Version string of the collection point configuration. |
purposes | Array of purpose UUIDs associated with this collection point. |
asset_id | UUID of the parent asset. |
Missing asset_id query parameter:
{ "detail": "asset_id query parameter is required" }Missing or invalid X-API-Key:
{ "detail": "Invalid or inactive API key" }API key does not have the admin scope:
{ "detail": "API key does not have the required scope" }Result
Section titled “Result”BANNER_ID=CP010You now have everything required to mount the consent banner. Choose your platform: