Skip to content

Fetch asset ID

An asset represents a mobile application or website registered in truConsent (e.g. “My Flutter App”). You need its assetId to mount TruConsentModal and NativeRightCenter.

Use your admin-scope API key and organization ID from Step 1. Run this from your development machine or a secure backend — not from the Flutter app.

Terminal window
curl -X GET "https://truapi-dev.truconsent.io/api/v1/external/public/assets" \
-H "X-API-Key: $ADMIN_API_KEY" \
-H "X-Org-Id: $ORGANIZATION_ID"
{
"data": [
{
"asset_type": "Mobile App",
"name": "My Flutter App",
"id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"description": "Production Flutter application"
},
{
"asset_type": "Mobile App",
"name": "My Flutter App (Staging)",
"id": "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy",
"description": "Staging Flutter application"
}
],
"count": 2
}

Copy the id of the asset that matches your Flutter application — this is your assetId.

ASSET_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

Pass this value as assetId in TruConsentConfig, TruConsentModal, and NativeRightCenter.