Skip to content

Fetch collection point details

A collection point is a named location where consent is requested (e.g. “Main Cookie Banner”). Its display_id is the bannerId you pass to TruConsentModal.

Use the assetId you discovered in Step 2.

Terminal window
curl -X GET "https://truapi-dev.truconsent.io/api/v1/external/public/collection-points?asset_id=$VITE_TRU_CONSENT_ASSET_ID" \
-H "X-API-Key: $VITE_TRU_CONSENT_ADMIN_API_KEY" \
-H "X-Org-Id: $VITE_TRU_CONSENT_ORGANIZATION_ID"
{
"data": [
{
"asset_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
"name": "Main Cookie Banner",
"display_id": "CP010",
"description": "Main consent banner for website visitors",
"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": "Signup Form Banner",
"display_id": "CP011",
"description": "Consent banner shown on signup",
"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.

Terminal window
VITE_TRU_CONSENT_BANNER_ID=CP010

Your .env is now fully populated.