Generate API Tokens and Create Webhooks
  • 08 Jul 2022
  • 4 Minutes To Read
  • PDF

Generate API Tokens and Create Webhooks

  • PDF

REQUIRED USER ROLE
Administrator and API User

API tokens are required to use Gladly APIs for security and authentication purposes. Tokens can be accessed and created by users who at least have an API user role.

Before you start

  • For integrations not built by Gladly, a Gladly Administrator should create a new user with an API User role + Agent and/or Administrator (check with your integration partner to confirm the required roles) account for each integration. This account is used to access Gladly to create the API Tokens or create webhooks.
    • The integration partner should provide the email address to be used with the integration's user account in Gladly. They also need to access emails from this account to activate their Gladly account to create API Tokens or create webhooks.
  • API tokens are tied to a single user account and a particular environment. For example, an API token attached to Gladly user developer@customer.com in the Sandbox environment is not valid for developer@customer.comin the Production environment.
    • We recommend creating a dedicated Gladly user to make API calls whose account won't be used for Agent and organization management. This will help you with any future audits of API activity vs. Agent activity.

Create a unique user account for an integration

  1. As an Administrator, review how to add new users here.
    • Be sure to add the user with at least an API User role + Agent and/or Administrator (check with your integration partner to confirm the required roles). If this user needs access to reports, they'll need Administrator access. For a complete list of user permissions, click here.
    • We recommend creating a dedicated user to make API calls.
      • Use the email address provided by the integration partner if you're given one.
    • Use a name to help you easily identify the integration user. For example, "Retale Integration."
  2. An email will be sent to the email used for the integration account. Someone will need to complete the registration and sign in to Gladly to create API Tokens or create webhooks. They'll have 24 hours to accept the user invitation before it expires.
Watch Out - Deactivating an API User
 If a user account with API Tokens or webhooks attached to it is deactivated, the integration will stop working.

Create API Tokens

Once the partner account is set up, they can log into Gladly to access API Tokens and webhooks. You must have Administrator and API User roles to generate tokens.

  1. Click the menu icon on the top left corner of the screen.
  2. Click Settings.
  3. Under the App Developer Tools category, click API Tokens. The API Tokens page will show you a list of API Tokens you currently have.
  4. Click Create Token.
  5. A new token is immediately generated within the page.
    • Copy and secure the token under the Token column. The token is only shown once so make sure to save it in a secure location.
    • Click the token name (e.g., Token 1) to rename the token to make it easy to identify how the token is used.
    • To delete a token, hover over the koken and click the trash icon.

Create Webhooks

Create up to 20 webhooks for your organization. See our developer site for more information about webhooks.

  1. Click the menu icon on the top left corner of the screen.
  2. Click Settings.
  3. Under the App Developer Tools category, click Webhooks. The Webhooks page will show you a list of webhooks you currently have configured.
  4. Click Create Webhook.
  5. From the Create Webhook page, enter the following information:
    • Name – Enter a name that will help you identify the app using a webhook.
    • Enabled (toggle) – Allows you to activate/deactivate the webhook. Click the toggle, so it's green to activate the webhook.
    • Webhook URL – Enter the URL where you'd like to send events.
      • If you get an "unable to ping URL" error, double-check the URL and make sure it's correct. 
    • Events – From the search picklist, select the events you'd like to use. The Webhook Events you select are added below the search bar. For more information about Webhook Events, please visit our developer site.
    • Username (Optional) – Enter the username for the app you are integrating.
    • Password (Optional) – Enter the password for the app you are integrating.
    • Realm (Optional) – Enter realm to run basic auth against.
    • HTTP Headers (Optional) – There are two columns (Header, Value) required for HTTP Headers (e.g., X-API-Key) to include in every request.
      • Click Add a Header to add a new line.
      • Click the trash icon to delete a line.
  6. Click Save. This will take you back to the Webhooks page, where the webhook you just added is visible.

Activate/Deactivate a Webhook

Below the Status column, click the toggle next to the webhook you want to activate/deactivate. The toggle turns gray when it's deactivated and green when activated. 

Delete a Webhook

To delete a webhook, hover over the webhook and click the trash icon on the right.

Replace or rotate API Tokens

Should you lose this token or wish to rotate your application keys, you can do the following:

  1. Generate a new token.
  2. Store the new token in a secure location.
  3. Delete the old token.
  4. Update your applications/scripts with the new token.

Was this article helpful?