LogoLogo
  • Platform Overview
  • 🗺️Guides
    • Getting Started
    • Users
      • Integrate the User SDK
      • Registration
      • Authentication
      • SDK Releases
      • API Reference
    • Entitlements
      • Administrative API
        • Integrating the Administrative API
        • Entitlement Definitions
        • Managing Entitlements Sets
        • Managing Entitlements Sequences
        • Managing User Entitlements
        • API Schema
      • End-user API
        • Integrate the Entitlements SDK
        • Redeeming Entitlements
        • Retrieving Entitlements
        • SDK Releases
        • API Reference
    • Sudos
      • Integrate the Sudo Profiles SDK
      • Sudo Entitlements
      • Manage Sudos
      • SDK Releases
      • API Reference
    • Telephony
      • Integrate the Telephony SDK
      • Manage Phone Numbers
      • Text Messaging
      • Voice Calling
      • Telephony Simulator
      • SDK Releases
      • API Reference
    • Email
      • Integrate the Email SDK
      • Email Entitlements
      • Manage Email Addresses
      • Sending & Receiving Email
      • Manage Email Folders
      • Draft Email Messages
      • Manage Email Address Blocklists
      • Email Address Public Information
      • Pagination
      • Caching
      • Configuration Data
      • Email Notifications
      • SDK Releases
      • API Reference
    • Decentralized Identity
      • Edge Agent
        • Relay SDK
          • Integrate the Relay SDK
          • Relay Entitlements
          • Manage Relay Postboxes
          • Manage Relay Messages
          • Receiving Messages
          • SDK Releases
        • Edge Agent SDK
          • Integrate the Edge Agent SDK
          • Agent Management
          • Manage Wallets
          • Establishing Connections
          • Manage Connections
          • Messaging
          • Manage DIDs
          • Accepting New Credentials
          • Manage Credentials
          • Present Credentials for Verification
          • Utilize Alternative Cryptography Providers
          • SDK Releases
          • Standards and Protocols
      • Cloud Agent
        • Cloud Agent Admin API
          • Integrate the Cloud Agent Admin API
          • Aries Interop Profile (AIP)
            • Connection Exchanges
            • Credential Exchanges
            • Proof Exchanges
          • Connections
          • Basic Messages
          • Credentials
            • Anoncreds Credentials
              • Schemas
              • Credential Definitions
            • W3C Credentials
          • Audit Logs
          • API Schema
          • Error Codes
          • Standards and Protocols
    • Virtual Cards
      • Integrate the Virtual Cards SDK
      • Virtual Cards Entitlements
      • Virtual Cards Transaction Velocity Constraints
      • Key Management
      • Manage Funding Sources
      • Manage Virtual Cards
      • Manage Transactions
      • Configuration Data
      • Pagination
      • Caching
      • SDK Releases
      • API Reference
    • Virtual Cards Simulator
      • Integrate the Virtual Cards Simulator SDK
      • Simulate Authorizations
      • Simulate Debits
      • Simulate Refunds
      • Simulate Reversals
      • Merchants and Currencies
      • SDK Releases
      • API Reference
    • Virtual Private Network
      • Integrate the VPN SDK
      • VPN Entitlements
      • Manage Servers
      • Manage Connection
      • Observe VPN Related Events
      • SDK Releases
      • API Reference
      • Frequently Asked Questions
    • Secure ID Verification
      • Integrate the Secure ID Verification SDK
      • List Supported Countries
      • Verify an Identity
      • Check Secure ID Verification Status
      • Use the Secure ID Verification Simulator
      • SDK Releases
      • API Reference
    • Password Manager
      • Integrate the Password Manager SDK
      • Accessing the Password Manager
      • Managing Password Vaults
      • Managing Password Vault Items
      • Vault Import and Export
      • Password Utilities
      • Password Manager Entitlements
      • Password Vault Security
      • SDK Releases
      • API Reference
    • Ad/Tracker Blocker
      • Integrate the Ad/Tracker Blocker SDK
      • Manage Rulesets
      • Blocking Ads and Trackers
      • Manage Exceptions
      • SDK Releases
      • API Reference
    • Site Reputation
      • Integrate the Site Reputation SDK
      • Use the Site Reputation SDK
      • SDK Releases
      • API Reference
  • 💡Concepts
    • Sudo Digital Identities
  • 🧱Development
    • Versioning
  • 🏢Administration
    • Admin Console Roles
  • ❓Get Help
    • Request a Demo
    • Report an Issue
Powered by GitBook
On this page
  • getEntitlementsConsumption
  • Errors
  1. Guides
  2. Entitlements
  3. End-user API

Retrieving Entitlements

Entitlements APIs for retrieving user entitlements information

getEntitlementsConsumption

The user's current entitlement status can be retrieved by calling the getEntitlementsConsumption method. This retrieves information about the user's current level of entitlement as well as information about any entitlements consumed.

do {
  let entitlements = try await entitlementsClient.getEntitlementsConsumption()
  // Handle entitlements
} catch {
  // Handle error
}
try {
  val consumption = entitlementsClient.getEntitlementsConsumption()
  // Handle consumption
}
catch (e: SudoEntitlements.EntitlementsException) {
  // Handle error
}
try {
  const consumption = await entitlementsClient.getEntitlementsConsumption()
  // Handle consumption
}
catch (err) {
  // Handle error
}

The getEntitlementsConsumption method returns an EntitlementsConsumption object that specifies both the user's entitlements and any consumption of those entitlements.

Entitlements may be consumed by the user themselves or may be consumed by sub-resources of the user.

For example the sudoplatform.sudo.max entitlement controls the maximum number of Sudo Profiles a user may have at any one time. This entitlement is consumed at the user level. Conversely the sudoplatform.virtual-cards.virtual-cardMaxPerSudo specifies how many Sudo Virtual Cards may be active for any single Sudo Profile. Each Sudo Profile's consumption of this entitlement is listed separately in the EntitlementsConsumption object. Consumers are identified by an id (in the case of a Sudo Profile this is the Sudo Profile's ID) and the issuer of the ID (sudoplatform.sudoservice for Sudo Profile IDs).

Errors

The getEntitlementsConsumption API will throw errors in the the following circumstances:

Exception

Condition

Action

.notSignedIn

User was not signed in when getEntitlements was invoked.

Ensure user is signed in prior to invoking getEntitlements

.invalidToken

The user's token does not contain a claim that can be mapped to an entitlements set, or the user has not been pre-configured with initial entitlements.

Ensure your identity provider has been set up to include an expected claim when federating sign-on or pre-configure the user with entitlements.

.noEntitlementsError

The user has not called redeemEntitlements yet and so their identity is not bound to any entitlements

Ensure redeemEntitlements has been called prior to attempting to retrieve entitlements consumption information

.serviceError

A transient error occurred in the service while retrieving entitlements.

Errors in Kotlin are thrown as exceptions in the SudoEntitlementsClient.EntitlementsException class name space.

Exception

Condition

Action

NotSignedInException

User was not signed in when getEntitlementsConsumption was invoked.

Ensure user is signed in prior to invoking getEntitlementConsumption

InvalidTokenException

The user's token does not contain a claim that can be mapped to an entitlements set, or has the user been pre-configured with initial entitlements.

Ensure your identity provider has been set up to include an expected claim when federating sign-on or pre-configure the user with entitlements.

NoEntitlementsException

The user has not called redeemEntitlements yet and so their identity is not bound to any entitlements

Ensure redeemEntitlements has been called prior to attempting to retrieve entitlements consumption information

UnknownException

A transient error occurred in the service while retrieving entitlements.

Error

Condition

Action

NotSignedInError

User was not signed in when getEntitlements was invoked.

Ensure user is signed in prior to invoking getEntitlements

InvalidTokenError

The user's token does not contain a claim that can be mapped to an entitlements set, or has the user been pre-configured with initial entitlements.

Ensure your identity provider has been set up to include an expected claim when federating sign-on or pre-configure the user with entitlements.

NoEntitlementsError

The user has not called redeemEntitlements yet and so their identity is not bound to any entitlements

Ensure redeemEntitlements has been called prior to attempting to retrieve entitlements consumption information

ServiceError

A transient error occurred in the service while retrieving entitlements.

PreviousRedeeming EntitlementsNextSDK Releases

Last updated 28 days ago

Retry the request. If the problem persists,

Retry the request. If the problem persists,

Retry the request. If the problem persists,

🗺️
ask us for help
ask us for help
ask us for help