Didomi - Developers documentation
  • Introduction
  • SDKs
    • Introduction
    • Web SDK
      • Getting started
      • Tags and vendors management
        • Tags management
          • Events & Variables
            • Deprecated
            • Custom events
          • Tag managers
            • Adobe Launch/DTM
            • Eulerian
            • Google Tag Manager
              • Configure the Didomi / GTM integration
              • Didomi's GTM template
            • Tealium
            • Other tag managers
        • Custom Didomi <script> tags
        • Third-party integrations
          • Google Ad Manager / AdSense
            • GDPR via Non-Personalized Ads
              • Share consent and load/refresh ads
              • Share consent without loading or refreshing ads
            • US states laws
          • Google Consent Mode V2
          • Kameleoon
          • Piano Analytics (AT Internet)
          • Prebid
            • GDPR via IAB TCF
            • US states laws
          • Salesforce DMP (Krux)
        • IAB frameworks
        • Programmatic API
      • Configuration
        • Bots (SEO & Performance tools)
        • Configuration by URL
        • Cookies and storage
        • Custom domains for events
        • Notice
          • Behavior
          • Interactions
          • Look and feel
        • Preferences
        • Theme
      • AB tests
      • Custom domain
        • Domain delegation
        • Reverse proxy
      • Share consents between domains
      • Share consents across devices
      • Pass user choices in query string
      • Serve Didomi assets from your domain
      • Reference
        • API
          • Deprecated
        • Events
      • Performance
      • Versions
    • Mobile and TV SDKs
      • Android and Android TV
        • Setup
        • Logging
        • Reference
          • API
            • Deprecated
          • Events
        • Versions
      • iOS and tvOS
        • Setup
        • Logging
        • App Tracking Transparency (iOS 14.5+)
        • Reference
          • API
            • Deprecated
          • Events
        • Versions
      • Unity
        • Setup
        • Reference
        • Versions
        • Troubleshooting
      • React Native
        • Setup
        • Reference
          • Deprecated
        • Versions
      • Flutter
        • Setup
        • Reference
        • Versions
      • Consent notice
        • Getting started
        • Customize the notice
        • Customize the preferences popup
        • Customize the theme & UI
        • Load notice by ID
      • Third-party SDKs
      • Share consents across devices
      • Share consent with WebViews
      • Google Consent Mode v2
      • FAQ
    • AMP SDK
      • Blocking Behaviors
        • Load immediately on page load
        • Load only after consent (positive or negative)
        • Load only after positive consent
      • Consent status for vendors
    • Help & Support
  • API
    • Introduction
      • Authentication
      • Errors
      • Pagination
      • Filters
      • Caching
      • Rate limiting
      • Quotas
      • Translations
    • Data Manager
      • Regulations
      • Configuration Tree
      • Purposes
        • Purposes & Vendors Numerical IDs
      • Preferences Library
      • User Rights
    • Widgets
      • Consent notices
        • Notices
        • Configurations
        • Multi-Regulation Configurations
          • Migration of Existing Notices and API Updates
        • Deployments
        • Tutorials
          • Create and publish a consent notice
          • Create and publish a multi-regulation consent notice
      • Privacy widgets
        • Create a widget
        • Retrieve widgets
        • Edit a widget
          • Content & Design
            • Themes & Shapes
            • Components
              • auth
              • dsar_form
              • footer
              • header
              • preference
              • preference_value
              • save
              • section
              • sections
            • Options
          • Purposes & preferences
          • Settings
        • Deploy a Widget
          • Use your own subdomain
          • Use your own domain
          • Implement an embeddable widget on your website
        • Authentication
          • Manage authentication providers
          • Authenticate your end-user
        • Archive a widget
        • Headless widgets
          • Public Methods
          • Custom elements
          • Custom events
          • Event listeners
        • Tutorial
          • Launch a Preference Center from a mobile app
    • Compliance Reports
      • Properties
      • Reports
      • CSV format reference
      • Websites
    • Consents and Preferences
      • Events
        • Generate IAB TCF consent string
      • Links
      • Proofs
      • Tokens
      • Secrets
      • Users
      • Tutorial
        • Collect and operate data
    • Privacy Requests
      • Requests
      • Notes
      • Links
      • Emails
  • Integrations
    • Introduction
      • Quotas
    • Generic integrations
      • Batch export
        • Destinations
          • AWS S3 Bucket (owned by Didomi)
          • GCP Storage Bucket
        • Exported data
          • Notices consents
        • Logs
      • Webhooks
      • Batch import
      • Analytics export
        • Destinations
          • AWS S3 Bucket (owned by Didomi)
          • GCP Storage Bucket
    • Third-party apps
      • CMP integrations
        • Didomi-mParticle integration for your CMP
        • Deploy Didomi’s SDK for your Adobe Commerce website
      • Preference Management Platform integrations
        • Actito
        • Adobe Campaign Classic
        • Adobe Experience Cloud
        • Adobe Marketo Engage
        • Adobe Source Connector
        • Braze
        • Dotdigital
        • Hubspot
        • Mailchimp
        • Microsoft Dynamics 365
        • Salesforce Marketing Cloud
        • Salesforce Sales & Service Cloud
        • Selligent
        • Brevo (ex Sendinblue)
    • Tutorials
      • Configure a HTTP webhook
      • Configure a batch export
      • Configure an analytics export
    • Emailing
      • Configurations
        • Actito Email
        • Actito SMS
        • Adobe Campaign Classic
        • Adobe Campaign Standard
      • Emails
        • Templates
        • Manage your templates
Powered by GitBook
On this page
  • Notice Config
  • getDisabledPurposes
  • getDisabledPurposeIds
  • getDisabledVendors
  • getDisabledVendorIds
  • getEnabledPurposes
  • getEnabledPurposeIds
  • getEnabledVendors
  • getEnabledVendorIds
  • getRequiredPurposeIds
  • getRequiredVendorIds
  • User Status
  • getUserConsentStatusForPurpose
  • getUserConsentStatusForVendor
  • getUserConsentStatusForVendorAndRequiredPurposes
  • getUserLegitimateInterestStatusForPurpose
  • getUserLegitimateInterestForVendor
  • getUserLegitimateInterestStatusForVendorAndRequiredPurposes
  • getUserStatus
  • getUserStatusForVendor
  • isConsentRequired
  • isUserConsentStatusPartial
  • isUserLegitimateInterestStatusPartial
  • setUserConsentStatus
  • setUserStatus
  • shouldConsentBeCollected
  • setUser
  1. SDKs
  2. Mobile and TV SDKs
  3. Android and Android TV
  4. Reference
  5. API

Deprecated

PreviousAPINextEvents

Last updated 4 months ago

Notice Config

getDisabledPurposes

Removed since version 2.0.0, use instead.

getDisabledPurposeIds

Removed since version 2.0.0, use instead.

getDisabledVendors

Removed since version 2.0.0, use instead.

getDisabledVendorIds

Removed since version 2.0.0, use instead.

getEnabledPurposes

Removed since version 2.0.0, use instead.

getEnabledPurposeIds

getEnabledVendors

getEnabledVendorIds

getRequiredPurposeIds

Get the list of purpose IDs that are required (automatically determined from the list of required vendors).

Requires SDK to be initialized

Yes.

Parameters

No parameter.

Throws

Type

Description

DidomiNotReadyException

Exception thrown when a method that requires the Didomi SDK to be ready is called before that. Developers can call this method within a try/catch or within a lambda expression passed into the onReady method.

Returns

Type
Description

Set<String>

A set of type String containing the IDs of required purposes.

Example

Didomi.getInstance().getRequiredPurposeIds();
Didomi.getInstance().requiredPurposeIds

getRequiredVendorIds

Get the list of vendor IDs that are required (determined from the configuration).

Requires SDK to be initialized

Yes.

Parameters

No parameter.

Throws

Type

Description

DidomiNotReadyException

Exception thrown when a method that requires the Didomi SDK to be ready is called before that. Developers can call this method within a try/catch or within a lambda expression passed into the onReady method.

Returns

Type
Description

Set<String>

A set of type String containing the IDs of required vendors.

Example

Didomi.getInstance().getRequiredVendorIds();
Didomi.getInstance().requiredVendorIds


User Status

getUserConsentStatusForPurpose

getUserConsentStatusForVendor

getUserConsentStatusForVendorAndRequiredPurposes

getUserLegitimateInterestStatusForPurpose

getUserLegitimateInterestForVendor

getUserLegitimateInterestStatusForVendorAndRequiredPurposes

getUserStatus

Get all the user consent status.

Throws

Type

Description

DidomiNotReadyException

Exception thrown when a method that requires the Didomi SDK to be ready is called before that. Developers can call this method within a try/catch or within a lambda expression passed into the onReady method.

Returns

A UserStatus object describing all the available and computed user information.

Parameter

Type

Description

purposes.global.disabled

Set<String>

Computed sets/lists of disabled IDs of purposes that have been chosen by the user regarding the consent or legitimate interest Legal Basis.

purposes.global.enabled

Set<String>

Computed sets/lists of enabled IDs of purposes that have been chosen by the user regarding the consent or legitimate interest Legal Basis. Purposes considered as essential will be part of the enabled IDs.

purposes.consent.disabled

Set<String>

Disabled IDs of purposes that have been explicitly chosen by the user regarding the consent Legal Basis.

purposes.consent.enabled

Set<String>

Enabled IDs of purposes that have been explicitly chosen by the user regarding the consent Legal Basis.

purposes.legitimateInterest.disabled

Set<String>

Disabled IDs of purposes that have been explicitly chosen by the user regarding the legitimate interest Legal Basis.

purposes.legitimateInterest.enabled

Set<String>

Enabled IDs of purposes that have been explicitly chosen by the user regarding the legitimate interest Legal Basis.

purposes.essential

Set<String>

IDs of purposes that are considered essential.

vendors.global.disabled

Set<String>

Computed sets/lists of disabled IDs of vendors that have been chosen by the user regarding the consent or legitimate interest Legal Basis. This takes into account the consent and legitimate interest required purposes linked to vendors. When computing this property, essential purposes will be considered as enabled.

vendors.global.enabled

Set<String>

Computed sets/lists of enabled IDs of vendors that have been chosen by the user regarding the consent or legitimate interest Legal Basis. This takes into account the consent and legitimate interest required purposes linked to vendors. When computing this property, essential purposes will be considered as enabled.

vendors.globalConsent.disabled

Set<String>

Computed sets/lists of disabled IDs of vendors that have been chosen by the user regarding the consent Legal Basis. This takes into account the consent required purposes linked to vendors. When computing this property, essential purposes will be considered as enabled.

vendors.globalConsent.enabled

Set<String>

Computed sets/lists of enabled IDs of vendors that have been chosen by the user regarding the consent Legal Basis. This takes into account the consent required purposes linked to vendors. When computing this property, essential purposes will be considered as enabled.

vendors.globalLegitimateInterest.disabled

Set<String>

Computed sets/lists of disabled IDs of vendors that have been chosen by the user regarding the legitimate interest Legal Basis. This takes into account the legitimate interest required purposes linked to vendors. When computing this property, essential purposes will be considered as enabled.

vendors.globalLegitimateInterest.enabled

Set<String>

Computed sets/lists of enabled IDs of vendors that have been chosen by the user regarding the legitimate interest Legal Basis. This takes into account the legitimate interest required purposes linked to vendors. When computing this property, essential purposes will be considered as enabled.

vendors.consent.disabled

Set<String>

Disabled IDs of vendors that have been explicitly chosen by the user regarding the consent Legal Basis.

vendors.consent.enabled

Set<String>

Enabled IDs of vendors that have been explicitly chosen by the user regarding the consent Legal Basis.

vendors.legitimateInterest.disabled

Set<String>

Disabled IDs of vendors that have been explicitly chosen by the user regarding the legitimate interest Legal Basis.

vendors.legitimateInterest.enabled

Set<String>

Enabled IDs of vendors that have been explicitly chosen by the user regarding the legitimate interest Legal Basis.

userId

String

Didomi user id.

created

String

User choices creation date.

updated

String

User choices update date.

consentString

String

TFC consent as string.

additionalConsent

String

regulation

Regulation

Representation of the current regulation as a Regulation enum value, such as GDPR, CCPA, CPRA, or NONE. Note that some regulations present as enum values are not available yet.

Example

UserStatus userStatus = Didomi.getInstance().getUserStatus();

// Enabled consent ids for vendors
Set<String> enabledVendorsConsentIds = userStatus.getVendors().getConsent().getEnabled();
val userStatus = Didomi.getInstance().userStatus

// Enabled consent ids for vendors
val enabledVendorsConsentIds = userStatus.vendors.consent.enabled

getUserStatusForVendor

isConsentRequired

Determine if consent is required for the user. This takes into account the location of the user and the configuration of the SDK:

  • If your app is configured to apply GDPR to all users then this function always returns true.

  • If your app is configured to apply GDPR to EU users only then this function returns true only if the user in the EU.

Parameters

No parameter.

Throws

Type

Description

DidomiNotReadyException

Exception thrown when a method that requires the Didomi SDK to be ready is called before that. Developers can call this method within a try/catch or within a lambda expression passed into the onReady method.

Returns

boolean

Example

Didomi.getInstance().isConsentRequired();
Didomi.getInstance().isConsentRequired

isUserConsentStatusPartial

Determine if all consent information is available for the user.

This function returns true if and only if:

  • Consent is required for the user (ie the user is in the EU or your tag is configured to apply GDPR to all users)

  • At least one vendor is configured (if there is no vendor configured, this function always returns false as there is no consent to collect)

  • We miss consent information for some vendors or purposes

If there is at least one piece of consent information missing for a single vendor/purpose, this function will return true. The consent notice is usually displayed when this function returns true although there is no guarantee of the direct mapping between the two.

An important edge case is when you add new vendors or if configured vendors ask for new purposes: the consent notice will be displayed again and this function will return true until the user has given or denied consent. Vendors that already had consent before will still operate normally as we only recollect consent for additional vendors/purposes.

Parameters

No parameter.

Throws

Type

Description

DidomiNotReadyException

Exception thrown when a method that requires the Didomi SDK to be ready is called before that. Developers can call this method within a try/catch or within a lambda expression passed into the onReady method.

Returns

boolean

Example

Didomi.getInstance().isUserConsentStatusPartial();
Didomi.getInstance().isUserConsentStatusPartial

isUserLegitimateInterestStatusPartial

Determine if all Legitimate Interest information is available for the user.

This function returns true if and only if:

  • Legitimate Interest is required for the user (ie the user is in the EU or your tag is configured to apply GDPR to all users)

  • At least one vendor is configured (if there is no vendor configured, this function always returns false as there is no Legitimate Interest to collect)

  • We miss Legitimate Interest information for some vendors or purposes

If there is at least one piece of Legitimate Interest information missing for a single vendor/purpose, this function will return true. The consent notice is usually displayed when this function returns true although there is no guarantee of the direct mapping between the two.

An important edge case is when you add new vendors or if configured vendors ask for new purposes: the consent notice will be displayed again and this function will return true until the user has given or denied consent. Vendors that already had Legitimate Interest before will still operate normally as we only recollect Legitimate Interest for additional vendors/purposes.

Parameters

No parameter.

Throws

Type

Description

DidomiNotReadyException

Exception thrown when a method that requires the Didomi SDK to be ready is called before that. Developers can call this method within a try/catch or within a lambda expression passed into the onReady method.

Returns

boolean

Example

Didomi.getInstance().isUserLegitimateInterestStatusPartial();
Didomi.getInstance().isUserLegitimateInterestStatusPartial

setUserConsentStatus

setUserStatus

Set the user status for purposes and vendors. This function will trigger events and API calls every time it is called (and the user status changes) so make sure to push all user choices at once and not one by one.

Parameters

Global method:

Define a global status for consent purposes, legitimate interest purposes, consent vendors, legitimate interest vendors

Name
Type
Description

purposesConsentStatus

boolean

true if purposes on a consent basis should be enabled, false if they should be disabled

purposesLIStatus

boolean

true if purposes on a legitimate interest basis should be enabled, false if they should be disabled

vendorsConsentStatus

boolean

true if vendors on a consent basis should be enabled, false if they should be disabled

vendorsLIStatus

boolean

true if vendors on a legitimate interest basis should be enabled, false if they should be disabled

Example

// Disable everything except vendors legitimate interest
Didomi.getInstance().setUserStatus(
    false, true, false, true
);
// Disable everything except vendors legitimate interest
Didomi.getInstance().setUserStatus(
    purposesConsentStatus = false,
    purposesLIStatus = true,
    vendorsConsentStatus = false,
    vendorsLIStatus = true
)

Individual purposes/vendors method:

Allows to define precisely which purposes and vendors are enabled / disabled

Name
Type
Description

enabledConsentPurposeIds

Set<String>

Set of purpose IDs that the user has given consent to

disabledConsentPurposeIds

Set<String>

Set of purpose IDs that the user has not given consent to

enabledLIPurposeIds

Set<String>

Set of purpose IDs that the user has allowed legitimate interest processing to

disabledLIPurposeIds

Set<String>

Set of purpose IDs that the user has disallowed legitimate interest processing to

enabledConsentVendorIds

Set<String>

Set of vendor IDs that the user has given consent to.

Prefix custom vendor IDs with c:.

disabledConsentVendorIds

Set<String>

Set of vendor IDs that the user has not given consent to

enabledLIVendorIds

Set<String>

Set of vendor IDs that the user has allowed legitimate interest processing to.

Prefix custom vendor IDs with c:.

disabledLIVendorIds

Set<String>

Set of vendor IDs that the user has not allowed legitimate interest processing to

Throws

Type

Description

DidomiNotReadyException

Exception thrown when a method that requires the Didomi SDK to be ready is called before that. Developers can call this method within a try/catch or within a lambda expression passed into the onReady method.

Returns

boolean

true if the user choices have changed (i.e. the user had made different choices before this function got called).

Example

Didomi.getInstance().setUserStatus(
    new HashSet<String>(Arrays.asList("cookies", "ad_delivery")),
    new HashSet<String>(Arrays.asList("market_research")),
    new HashSet<String>(Arrays.asList("cookies", "market_research"),
    new HashSet<String>(Arrays.asList("ad_delivery"),
    new HashSet<String>(Arrays.asList("123", "c:custom-vendor-id")),
    new HashSet<String>(Arrays.asList("125")),
    new HashSet<String>(Arrays.asList("123", "125", "c:custom-vendor-id")),
    new HashSet<String>()
);
Didomi.getInstance().setUserStatus(
    enabledConsentPurposeIds = setOf("cookies", "ad_delivery"),
    disabledConsentPurposeIds = setOf("market_research"),
    enabledLIPurposeIds = setOf("cookies", "market_research"),
    disabledLIPurposeIds = setOf("ad_delivery"),
    enabledConsentVendorIds = setOf("123", "c:custom-vendor-id"),
    disabledConsentVendorIds = setOf("125"),
    enabledLIVendorIds = setOf("123", "125", "c:custom-vendor-id"),
    disabledConsentVendorIds = emptySet()
);

shouldConsentBeCollected

Determine if consent should be collected for the visitor. Returns true if consent is required for the current user and one of following two conditions is met:

  • Consent has never been collected for this visitor yet

  • New consents should be collected (as new vendors have been added) AND the number of days before recollecting them has exceeded

If none of these two conditions is met, the function returns false. This function is mainly present to allow you to know when to display your own notice if you have disabled our standard notice.

Parameters

No parameter.

Throws

Type

Description

DidomiNotReadyException

Exception thrown when a method that requires the Didomi SDK to be ready is called before that. Developers can call this method within a try/catch or within a lambda expression passed into the onReady method.

Returns

boolean

Example

Didomi.getInstance().shouldConsentBeCollected();
Didomi.getInstance().shouldConsentBeCollected()

setUser

Parameters

Method without authentication:

Name
Type
Description

organizationUserId

String

Organization ID to associate with the user

activity

FragmentActivity

Optional. When present, notice will be displayed if synchronized user has partial consents.

Method with Encrypted authentication:

Name
Type
Description

userAuthParams

UserAuthWithEncryptionParams

User authentication with encryption

activity

FragmentActivity

Optional. When present, notice will be displayed if synchronized user has partial consents.

Parameters for UserAuthWithEncryptionParams :

Name
Type
Description

id

String

Organization ID to associate with the user

algorithm

String

Algorithm used for computing the user ID

secretId

String

ID of the secret used for the computing the user ID

initializationVector

String

Initialization Vector used for encrypting the message

expiration

Long

Expiration time as UNIX timestamp (optional - must be > 0)

Method with Hash authentication:

Name
Type
Description

userAuthParams

UserAuthWithHashParams

User authentication with encryption

Parameters for UserAuthWithHashParams :

Name
Type
Description

id

String

Organization ID to associate with the user

algorithm

String

Algorithm used for computing the user ID

secretId

String

ID of the secret used for the computing the user ID

digest

String

Digest used for representing the user ID

salt

String

Salt used for computing the user ID (optional)

expiration

Long

Expiration time as UNIX timestamp (optional - must be > 0)

Returns

Nothing

Example

Didomi.getInstance().setUser("e3222031-7c45-4f4a-8851-ffd57dbf0a2a");

Didomi.getInstance().setUser(new UserAuthWithEncryptionParams(
            "e3222031-7c45-4f4a-8851-ffd57dbf0a2a",
            "algorithm",
            "secret_id",
            "initialization_vector",
            10000L // or null
));

Didomi.getInstance().setUser(new UserAuthWithHashParams(
            "e3222031-7c45-4f4a-8851-ffd57dbf0a2a",
            "algorithm",
            "secret_id",
            "digest",
            "salt", // or null
            10000L // or null
));
Didomi.getInstance().setUser("e3222031-7c45-4f4a-8851-ffd57dbf0a2a")

Didomi.getInstance().setUser(
    UserAuthWithEncryptionParams(
        id = "e3222031-7c45-4f4a-8851-ffd57dbf0a2a",
        algorithm = "algorithm",
        secretId = "secret_id",
        initializationVector = "initialization_vector",
        expiration = 10000L // or null
    )
)

Didomi.getInstance().setUser(
    UserAuthWithHashParams(
        id = "e3222031-7c45-4f4a-8851-ffd57dbf0a2a",
        algorithm = "algorithm",
        secretId = "secret_id",
        digest = "digest",
        salt = "salt", // or null
        expiration = 10000L // or null
    )
)

Removed since version 2.0.0, use instead.

Removed since version 2.0.0, use instead.

Removed since version 2.0.0, use instead.

Removed since version 2.0.0, use instead.

Removed since version 2.0.0, use instead.

Removed since version 2.0.0, use instead.

Removed since version 2.0.0, use instead.

Removed since version 2.0.0, use instead.

Removed since version 2.0.0, use instead.

Removed since version 2.0.0, use instead.

Removed since version 2.0.0, use instead.

Deprecated, use instead.

Additional consent for .

Removed since version 2.0.0, use instead.

Deprecated, use and check that the field regulationis not Regulation.NONE.

Deprecated, use instead.

Deprecated, use instead.

Deprecated, use instead.

Removed since version 2.0.0, use instead.

Please read on what to expect from your analytics when setting a custom behavior for your consent notice.

Deprecated, use instead.

Deprecated, use with DidomiUserParameters instead.

Set user information from organization for cross device functionality. For detailed information, see .

our article
documentation
getCurrentUserStatus
getCurrentUserStatus
getCurrentUserStatus
getCurrentUserStatus
getCurrentUserStatus
getCurrentUserStatus
getCurrentUserStatus
getCurrentUserStatus
getRequiredPurposes
getRequiredVendors
getCurrentUserStatus
getCurrentUserStatus
getCurrentUserStatus
getCurrentUserStatus
getCurrentUserStatus
getCurrentUserStatus
getCurrentUserStatus
getCurrentUserStatus
isUserStatusPartial
isUserStatusPartial
setCurrentUserStatus
setCurrentUserStatus
shouldUserStatusBeCollected
setUser
getCurrentUserStatus
Google Additional Consent Mode