Fetch collection point details
A collection point is a named location where consent is requested (e.g. “App Signup Flow”). Its display_id is the bannerId you pass to TruConsentModal.
Use the assetId discovered in Step 2.
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"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"]const assetId = process.env.ASSET_ID;const response = await fetch( "https://truapi-dev.truconsent.io/api/v1/external/public/collection-points?asset_id=" + assetId, { headers: { "X-API-Key": process.env.ADMIN_API_KEY, "X-Org-Id": process.env.ORGANIZATION_ID, }, });const { data } = await response.json();interface CollectionPoint { id: string; name: string; display_id: string; status: string; version: string; purposes: string[];}
const assetId = process.env.ASSET_ID!;const response = await fetch( "https://truapi-dev.truconsent.io/api/v1/external/public/collection-points?asset_id=" + assetId, { headers: { "X-API-Key": process.env.ADMIN_API_KEY!, "X-Org-Id": process.env.ORGANIZATION_ID!, }, });const { data }: { data: CollectionPoint[] } = await response.json();const cp = data.find(c => c.name === "App Signup Flow");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": "App Signup Flow", "display_id": "CP003", "description": "Consent banner shown at app signup", "status": "active", "version": "v1.0.0", "purposes": [ "pppppppp-pppp-pppp-pppp-pppppppppppp" ] }, { "asset_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb", "name": "In-App Purchase Flow", "display_id": "CP007", "description": "Consent for purchase-related data collection", "status": "draft", "version": "v1.0.0", "purposes": [ "rrrrrrrr-rrrr-rrrr-rrrr-rrrrrrrrrrrr" ] } ], "count": 2}The display_id (e.g. CP003) is your bannerId. Use the collection point whose status is active and whose name matches the consent flow you are integrating.
Result
Section titled “Result”Your app.json extra block is now fully populated:
{ "expo": { "extra": { "truConsentApiKey": "your-consent-scope-key", "truConsentOrganizationId": "your-organization-id", "truConsentAssetId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "truConsentApiUrl": "https://trukit-dev.truconsent.io" } }}Pass CP003 (or whichever display_id is active) as bannerId when mounting TruConsentModal.