> For the complete documentation index, see [llms.txt](https://doc.dastra.eu/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.dastra.eu/nl/features/cookies/integration/mobile/native.md). Agents can also search and read this documentation through its [MCP server](https://doc.dastra.eu/~gitbook/mcp).

# Native toepassingen

Deze pagina beschrijft de API voor het beheer van toestemming. U kunt ze gebruiken in native mobiele applicaties.

Een native applicatie toont de webbanner niet: ze haalt de bannerconfiguratie op, toont een eigen toestemmingsscherm en stuurt daarna de keuzes van de gebruiker naar Dastra. Beide aanroepen gebruiken de openbare API-sleutel.

{% hint style="info" %}
Afhankelijk van de hostingregio van uw organisatie verandert het adres van de API (`api-bleu.dastra.eu` in plaats van `api.dastra.eu`). Gebruik het adres van uw organisatie.
{% endhint %}

Verzoeken zonder `Origin`-header, zoals die van een native applicatie, worden geaccepteerd zonder dat de **Geautoriseerde URL's (CORS)** worden gecontroleerd.

## De bannerconfiguratie ophalen

<mark style="color:blue;">`GET`</mark> `https://api.dastra.eu/v1/cookies/public/cookies-widget-settings/{id}?key={key}`

Dit endpoint geeft de volledige configuratie van de banner terug.

### Padparameters

| Naam | Type   | Beschrijving              |
| ---- | ------ | ------------------------- |
| `id` | number | Identifier van de banner. |

### Queryparameters

| Naam      | Type    | Beschrijving                                                                                                                                                        |
| --------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `key`     | string  | De openbare API-sleutel.                                                                                                                                            |
| `culture` | string  | De taal van de configuratie (`en`, `fr` enzovoort). Als de parameter ontbreekt, gebruikt Dastra de header `Accept-Language` en daarna de eerste taal van de banner. |
| `debug`   | boolean | Bij `true` wordt geen bezoekgebeurtenis geregistreerd.                                                                                                              |

Voorbeeld van een `200`-antwoord. De teksten van de banner en sommige velden zijn ingekort; de inhoud hangt af van uw configuratie.

```json
{
  "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
}
```

Het antwoord komt overeen met het model `CookieWidgetPublicDto`. Een `400`-antwoord betekent een niet-toegestane origin, een uitgeschakelde banner of een verlopen abonnement.

## Toestemmingen registreren

<mark style="color:green;">`POST`</mark> `https://api.dastra.eu/v1/cookies/public/collect/{id}?key={key}`

Deze methode verzamelt de cookietoestemmingen.

### Padparameters

| Naam | Type   | Beschrijving              |
| ---- | ------ | ------------------------- |
| `id` | number | Identifier van de banner. |

### Queryparameters

| Naam  | Type   | Beschrijving             |
| ----- | ------ | ------------------------ |
| `key` | string | De openbare API-sleutel. |

### Aanvraagtekst

| Naam        | Type   | Beschrijving                                                                                                                                                                       |
| ----------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `type`      | string | Het type gebeurtenis: `Visit`, `Quit` of `Consents`.                                                                                                                               |
| `consents`  | object | De lijst met toestemmingen van de gebruiker (zie het voorbeeld hieronder).                                                                                                         |
| `consentId` | string | De huidige identifier van de toestemming, als er al een is verzameld.                                                                                                              |
| `referrer`  | string | Het adres van de pagina of het scherm waar de gebeurtenis vandaan komt.                                                                                                            |
| `userId`    | string | Gepseudonimiseerde identifier van de gebruiker in uw systemen (optioneel). Zie [Gebruikersidentificatie](https://doc.dastra.eu/nl/features/cookies/integration/identification.md). |

Voorbeeld van een aanvraagtekst:

```json
{
  "type": "Consents",
  "referrer": "my-app://settings/privacy",
  "userId": "{your_pseudonymous_user_id}",
  "consents": {
    "consentId": "6f47576e-5a0c-4219-8efe-331e72bab73a",
    "lang": "en-US",
    "versionKey": "36df80ee-235c-4485-b9e2-f28f5568f572",
    "cookieConsents": [
      {
        "id": "e213aca4-79b7-4b93-2bad-08d897969898",
        "name": "Google Analytics",
        "slug": "google-analytics",
        "consent": true,
        "date": "2026-10-12T14:00:04.133Z",
        "purpose": "Analytical"
      }
    ]
  }
}
```

Het `200`-antwoord bevat de identifier van de verzamelde toestemming, bijvoorbeeld `140f213b-de17-4572-99a7-5075ccbcbbec`. Bewaar deze identifier in de applicatie voor de volgende aanroepen: het is de identifier van het bewijs van toestemming. Gebeurtenissen die door bots worden verzonden, worden genegeerd en het bewijs wordt alleen opgeslagen als de optie **Bewijs van toestemming opslaan** is ingeschakeld.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://doc.dastra.eu/nl/features/cookies/integration/mobile/native.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
