Links

API tokens

Introduction

Duplo supports two kinds of API tokens, temporary API tokens and permanent API tokens. For normal use cases, we recommend using a temporary API token. For CI/CD or other DevOps automation, a permanent API token is warranted.
Permanent API tokens will expire after one year.

Temporary API tokens

Every time a user logs in to Duplo, a temporary API token is created for that user that only lasts for the duration of their session.

Getting a Temporary API token

Any user can retrieve their own temporary API token from Duplo. Navigate to the User -> Profile page. Click the copy icon
in the Temporary API Token pane.
Could not load image

Permanent API tokens

Only administrators can create permanent API tokens. Permanent tokens are always associated with a specific Duplo user.
Note: Permanent API tokens will expire after one year.

Creating a permanent API token

Navigate to the Administrator -> Users page. Click the username in the list, to go to a specific user's page. Click the Tokens tab.
Could not load image
Click the blue + Add button. Give your token a memorable name and click Create.
Click the Copy button to copy your token to the clipboard. Save it somewhere safe, you will not be able to retrieve it from Duplo later.
Caution: Always save your token somewhere safe. You will not be able to retrieve it again from Duplo after you have created it. However, if you lose your token, you can always create a new one.

Configuring notifications for API tokens nearing expiration

You can configure DuploCloud system settings to generate faults and send notification emails when API tokens are nearing expiration.

Generate a fault when API tokens are near expiration:

  1. 1.
    From the DuploCloud portal, navigate to Administrator -> Systems Settings. Select the Config tab, and click Add.
  2. 2.
    For Config Type select App Config, for Key, select Enable User Token Notification, and in the Value field, enter the number of days before token expiration when faults should show.
Add Config pane configured to generate faults when API tokens will expire in 15 days.
  1. 3.
    Click Submit. DuploCloud will generate a fault when an API token is the set number of days from expiration.

Sending notification emails when API tokens are near expiration:

  1. 1.
    From the DuploCloud portal, navigate to Administrator -> Systems Settings. Select the Config tab, and click Add.
  2. 2.
    For Config Type select App Config, for Key, select User Token Expiration Notification Emails, and in the Value field, enter the user email addresses (separated by semicolons) to which notification emails will be sent.
    Add Config pane configured to send a notification email when API tokens will expire in 15 days.
  3. 3.
    Click Submit. DuploCloud will send an email to the listed email address(es) when an API token is the set number of days from expiration.