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
  • Common Entitlements Sequence Types
  • Add a New Entitlements Sequence
  • Possible Errors
  • Get an Entitlements Sequence
  • Possible Errors
  • List all Entitlements Sequences
  • Possible Errors
  • Update an Existing Entitlements Sequence
  • Possible Errors
  • Remove an Entitlements Sequence
  • Possible Errors
  1. Guides
  2. Entitlements
  3. Administrative API

Managing Entitlements Sequences

Administrative APIs for managing entitlements sequences

The standard create, read, update and delete management operations are performed by calling the addEntitlementsSeqence, getEntitlementsSequence or listEntitlementsSetquences, setEntitlementsSequence and removeEntitlementsSequence APIs respectively.

Common Entitlements Sequence Types

# A transition within an entitlements sequence
type EntitlementsSequenceTransition {
  # Name of entitlements set
  entitlementsSetName: String!

  # ISO8601 period string - if not specified then this transition
  # is the final state for all users on the sequence.
  duration: String
}

# A sequence of entitlements set transitions
type EntitlementsSequence {
  # Name of the entitlements sequence
  name: String!

  # Description of the entitlements sequence
  description: String

  # Time of initial creation of an entitlements sequence in milliseconds
  # since epoch. Number is integral, float type provides sufficient
  # precision.
  createdAtEpochMs: Float!

  # Time of most recent update of an entitlements sequence in milliseconds
  # since epoch. Number is integral, float type provides sufficient
  # precision.
  updatedAtEpochMs: Float!

  # Version of the entitlements sequence. Incremented each time an update is made.
  version: Int!

  # Sequence of transitions a user will go through in order. Must not be empty.
  transitions: [EntitlementsSequenceTransition!]!
}

Add a New Entitlements Sequence

A new entitlements sequence can be added to the system by calling the addEntitlementsSequence mutation. All entitlements sets referenced by the transitions in the sequence must exist prior to adding the entitlements sequence.

# Input of a single transition within an entitlements sequence
input EntitlementsSequenceTransitionInput {
  # Name of entitlements set
  entitlementsSetName: String!

  # ISO8601 period string - if not specified then this transition
  # is the final state for all users on the sequence. If the
  # final transition has a duration, then when that duration passed
  # the user becomes unentitled for all entitlements.
  duration: String
}

# Input for the addEntitlementsSequence mutation
input AddEntitlementsSequenceInput {
  # Name of the entitlements sequence
  name: String!

  # Description of the entitlements sequence
  description: String

  # Sequence of transitions a user will go through in order. Must not be empty.
  transitions: [EntitlementsSequenceTransitionInput!]!
}

type Mutation {
  # Adds an entitlement sequence
  addEntitlementsSequence(
    input: AddEntitlementsSequenceInput!
  ): EntitlementsSequence!
}

Possible Errors

  • InvalidArgumentError will be returned if the transitions array is empty or any transitions earlier in the list than the last transition do not specify a duration.

  • EntitlementsSetNotFoundError will be returned if any of the referenced entitlements sets do not exist

  • ServiceError will be returned for internal errors.

Adding a new entitlements sequence using SDK.

do {
    let entitlementsSetquence = try await client.addEntitlementsSequenceWithName(
        name: "premium_subscription",
        description: "Premium subscription plan",
        transitions: [
            EntitlementSequenceTransition(
                entitlementsSetName: "initial_entitlements_set",
                duration: "P3M"
            ),
            EntitlementSequenceTransition(
                entitlementsSetName: "second_entitlements_set",
                duration: "P1M"
            )
        ]
    )
} catch {    
    // Handle error. An error may be thrown if the backend is unable perform
    // the operation due to invalid input, availability or security issues.
}
val entitlementsSequence =
    client.addEntitlementsSequence(
        "premium_subscription", 
        "Premium subscription plan",
        listOf(
            EntitlementSequenceTransition("initial_entitlements_set", "P3M"),
            EntitlementSequenceTransition("second_entitlements_set", "P1M")
        )
    )
const input = {
  name: 'premium_subscription',
  description: "Premium subscription plan',
  transitions: [
    {
      entitlementsSetName: 'initial_entitlements_set',
      duration: 'P3M',
    },
    {
      entitlementsSetName: 'second_entitlements_set',
      duration: 'P1M',
    },
  ],
}
const entitlementsSequence = await client.addEntitlementsSequence(input)

Get an Entitlements Sequence

Call the getEntitlementsSequence query to retrieve an entitlements set by name.

# Input for the getEntitlementsSequence query
input GetEntitlementsSequenceInput {
  name: String!
}

type Query {
  # Gets an entitlement sequence.
  getEntitlementsSequenc(
    input: GetEntitlementsSequenceInput!
  ): EntitlementsSequence
}

Possible Errors

  • ServiceError will be returned for internal errors.

Retrieving an entitlements sequence using SDK.

do {
    let entitlementsSequence = try await client.getEntitlementsSequenceWithName(
        name: "premium_subscription_plan"
    ) 
} catch {
    // Handle error. An error may be thrown if the backend is unable perform
    // the operation due to invalid input, availability or security issues.
}
val entitlementsSequence =
    client.getEntitlementsSequence(
        "premium_subscription_plan"
    )
const input = {
  name: 'premium_subscription_plan',
}
const entitlementsSequence = await client.getEntitlementsSequence(input)

List all Entitlements Sequences

Call the listEntitlementsSequences query to list all of the entitlements setquences in the system. The results list is paginated with a page size of 10. To retrieve all results your application must implement the following algorithm.

1. Call listEntitlementsSequences query with nextToken set to null
2. If nextToken in the returned EntitlementsSequencessConnection is null, 
   there are no more results to retrieve
3. Call listEntitlementsSequences query with nextToken set to the value
   returned from the previous call
4. Go to step 2
# Pagination connection for use when listing entitlements sequences
type EntitlementsSequencesConnection {
  items: [EntitlementsSequence!]!
  nextToken: String
}

# Input for the listEntitlementsSequences query
input ListEntitlementsSequencesInput {
  token: String!
}

type Query {
# Retrieves all entitlements sequences.
listEntitlementsSequences(
  nextToken: String
): EntitlementsSequencesConnection!
}

Possible Errors

  • ServiceError will be returned for internal errors.

Listing entitlements sequences using SDK.

do {
    let listOutput = try await client.listEntitlementsSequencesWithNextToken(
        nextToken: nil
    ) 
} catch {
    // Handle error. An error may be thrown if the backend is unable perform
    // the operation due to invalid input, availability or security issues.
}
val listOutput =
    client.listEntitlementsSequences(
        null 
    )
const listOutput = await client.listEntitlementsSequences()

Update an Existing Entitlements Sequence

Call the setEntitlementsSequence mutation to update the contents of an existing entitlements sequence. The updated entitlements sequence is returned.

# Input of a single transition within an entitlements sequence
input EntitlementsSequenceTransitionInput {
  # Name of entitlements set
  entitlementsSetName: String!

  # ISO8601 period string - if not specified then this transition
  # is the final state for all users on the sequence. If the
  # final transition has a duration, then when that duration passed
  # the user becomes unentitled for all entitlements.
  duration: String
}

# Input for the setEntitlementsSequence mutation
input SetEntitlementsSequenceInput {
  name: String!
  description: String
  transitions: [EntitlementSequenceTransitionInput!]!
}

type Mutation {
  # Change the entitlements set transitions represented by an entitlements sequence.
  setEntitlementsSequence(input: SetEntitlementsSequenceInput!): EntitlementsSequence!
}

Possible Errors

  • InvalidArgumentError will be returned if the transitions array is empty or any transitions earlier in the list than the last transition do not specify a duration.

  • EntitlementsSetNotFoundError will be returned if any of the referenced entitlements sets do not exist

  • ServiceError will be returned for internal errors.

Updating an entitlements sequence using SDK.

do {
    let entitlementsSequence = try await client.setEntitlementsSequenceWithName(
        name: "premium_subscription",
        description: "Preumium subscription plan",
        transitions: [
            EntitlementSequenceTransition(
                entitlementsSetName: "initial_entitlements_set",
                duration: "P3M"
            ),
            EntitlementSequenceTransition(
                entitlementsSetName: "second_entitlements_set",
                duration: "P1M"
            )
        ]

    ) 
} catch {
    // Handle error. An error may be thrown if the backend is unable perform
    // the operation due to invalid input, availability or security issues.
}    
val entitlementsSequence =
    client.setEntitlementsSequence(
        "premium_subscription", 
        "Preumium subscription plan",
        listOf(
            EntitlementSequenceTransition("initial_entitlements_set", "P3M"),
            EntitlementSequenceTransition("second_entitlements_set", "P1M")
        )
    )
const input = {
  name: 'premium_subscription',
  description: "Premium subscription plan',
  transitions: [
    {
      entitlementsSetName: 'initial_entitlements_set',
      duration: 'P3M',
    },
    {
      entitlementsSetName: 'second_entitlements_set',
      duration: 'P1M',
    },
  ],
}
const entitlementsSequence = await client.setEntitlementsSequence(input)

Remove an Entitlements Sequence

Call the removeEntitlementsSequence mutation to remove an existing entitlements sequence by name. The removed entitlements sequence is returned on success. null is returned if the named entitlements sequence cannot be found.

# Input for the removeEntitlementsSequence mutation
input RemoveEntitlementsSequenceInput {
  name: String!
}

type Mutation {
  # Remove an entitlements sequence. Any users configured against this
  # entitlements sequence will become unentitled.
  removeEntitlementsSequence(input: RemoveEntitlementsSequenceInput!): EntitlementsSequence
}

Possible Errors

  • ServiceError will be returned for internal errors.

Removing an entitlements sequence using SDK.

do {
    let entitlementsSequence = try await client.removeEntitlementsSequenceWithName(
        name: "premium_subscription"
    )
} catch {
    // Handle error. An error may be thrown if the backend is unable perform
    // the operation due to invalid input, availability or security issues.
} 
val entitlementsSequence =
    client.removeEntitlementsSequence(
        "premium_subscription"
    )
const input = {
  name: 'premium_subscription',
}
const entitlementsSequence = await client.removeEntitlementsSequence(input)

PreviousManaging Entitlements SetsNextManaging User Entitlements

Last updated 28 days ago

🗺️