Native applications
This page describes the consent management API. You can use it in native mobile applications.
A native application does not display the web banner: it retrieves the banner configuration, displays its own consent screen, then sends the user's choices to Dastra. Both calls use the public API key.
Requests without an Origin header, such as those of a native application, are accepted without checking the Urls authorized (Allowed origins).
Get the banner configuration
GET https://api.dastra.eu/v1/cookies/public/cookies-widget-settings/{id}?key={key}
This endpoint returns the complete configuration of the banner.
Path parameters
id
number
Identifier of the banner.
Query parameters
key
string
The public API key.
culture
string
The language of the configuration (en, fr, etc.). If missing, Dastra uses the Accept-Language header, then the first language of the banner.
debug
boolean
When true, no visit event is recorded.
Example of a 200 response. The banner texts and some fields are abridged; the content depends on your configuration.
{
"translation": {
"id": "35dddc1a-3ceb-49a8-a8d2-fc343fdb56a3",
"lang": "en",
"startupTitle": "We use cookies",
"startupDisclaimer": "Cookies let us personalize content and ads, provide social media features and analyze our traffic.",
"buttonAcceptLabel": "Accept all",
"buttonSettingsLabel": "Customize",
"buttonLaterLabel": "Refuse all",
"buttonConfirmLabel": "Save my choices",
"innerTitle": "These are our services that use cookies",
"categoryNecessaryLabel": "Strictly necessary",
"categoryPreferenceLabel": "Preferences",
"categoryAnalyticalLabel": "Analytics",
"categoryMarketingLabel": "Marketing",
"successMessage": "Your preferences have been saved."
},
"groups": [
{
"label": "Analytics",
"excerpt": "Analytics cookies help us understand how visitors use the site.",
"purpose": "Analytical",
"services": [
{
"id": "e213aca4-79b7-4b93-2bad-08d897969898",
"name": "Google Analytics",
"slug": "google-analytics",
"domain": "analytics.google.com",
"logoUrl": "https://api.dastra.eu/v1/favicon/analytics.google.com",
"privacyPolicyUrl": "https://policies.google.com/privacy",
"defaultConsent": false,
"requiredConsent": true,
"purpose": "Analytical",
"description": null,
"cookies": [
{
"id": "de529978-3ae0-496d-bf25-daac9d7230c7",
"serviceId": null,
"name": "_ga",
"description": null,
"value": null,
"thirdParty": false,
"path": null,
"domain": null,
"expiryDays": 400
}
],
"lang": "en",
"consentModeV2Permissions": []
}
],
"description": "Analytics cookies help us understand how visitors use the site.",
"requiredConsent": true,
"defaultConsent": false
}
],
"lang": "en",
"availableLocales": ["en", "fr"],
"id": 1,
"versionKey": "36df80ee-235c-4485-b9e2-f28f5568f572",
"lastVersionGeneration": "2026-10-12T14:28:55Z",
"label": "Example banner",
"enabled": true,
"disableBanner": false,
"saveConsentProof": true,
"developerMode": false,
"position": "BottomLeft",
"timerTrigger": 0,
"scrollTrigger": 0,
"showFixedButton": true,
"showCloseButton": true,
"continueWithoutAcceptButton": false,
"enableGlobalPrivacyControl": false,
"hideCopyright": false,
"buttonLayout": "Circle",
"buttonLogoUrl": null,
"autoGeneratedCookieNotice": false,
"cookieNoticeUrl": "",
"bgColor": "#FFFFFF",
"colorTitle": "#0A153B",
"colorBtn": "#687c77",
"colorText": "#0A153B",
"colorPrimary": "#EF4A2A",
"colorSecondary": "#687c77",
"customCSS": "",
"fontFamily": "'Segoe UI', Tahoma, Geneva, Verdana, sans-serif",
"consentStorageMode": "Cookies",
"consentCookieName": null,
"consentCookieDomain": null,
"consentCookieExpiryTime": 180
}The response matches the CookieWidgetPublicDto model. A 400 response means an origin that is not allowed, a disabled banner or an expired subscription.
Record consents
POST https://api.dastra.eu/v1/cookies/public/collect/{id}?key={key}
This method collects cookie consents.
Path parameters
id
number
Identifier of the banner.
Query parameters
key
string
The public API key.
Request body
type
string
The event type: Visit, Quit or Consents.
consents
object
The list of the user's consents (see the example below).
consentId
string
The current consent identifier, if one has already been collected.
referrer
string
The address of the page or the screen the event comes from.
userId
string
Pseudonymous identifier of the user in your systems (optional). See User identification.
Example of a body:
The 200 response contains the identifier of the collected consent, for example 140f213b-de17-4572-99a7-5075ccbcbbec. Keep it in the application for the next calls: it is the identifier of the proof of consent. Events sent by bots are ignored, and the proof is stored only if the Save consent proof option is enabled.
Last updated
Was this helpful?