Unified.to
Blog

How to get your Discord OAuth 2 credentials and bot token


May 21, 2024

This guide explains how to register your application with Discord and obtain your OAuth 2 credentials and bot token. You'll need these credentials to activate the Discord integration and access Discord's APIs through our unified API.

Register your application in Discord

  • Sign into Discord and navigate to the Developer Portal.
  • Click New Application at the top right of the page.
  • In the Create an application window:
    • Enter a name for your application
    • Check the box to agree to Discord's terms of service and developer policy
    • Click Create
  1. Discord will create a new application, after which you will be taken to the General Information tab for your application's page.

Get your Discord OAuth 2 credentials

Once your application is registered, you can obtain its OAuth 2 credentials. These will be used to authenticate your app and access the Discord APIs.

  • On your application's page, select the OAuth2 tab from the left sidebar.
  • Make note of your Client ID and Client Secret. You'll need these later.
  • Under Redirects, click Add Redirect.
  • Enter https://api.unified.to/oauth/code as the redirect URL.
  • Click Save changes at the bottom of the page.

Retrieve your Discord bot token

The Discord integration also requires a Bot Token to access the Discord API.

  1. Select Bot from the left sidebar.
  2. Under Build-A-Bot > Token, copy the Bot Token.
  3. If you don't see the token, click Reset Token.
    1. Click Yes, do it! in the confirmation dialog.
    2. Copy the new token that appears.
    3. Note: You won't be able to view this token again, so store it securely.

Set bot permissions

If you plan to use specific Unified.to API endpoints, you'll need to enable certain bot permissions:

  1. For listing guild members (using our HRIS List Employees API):
    • Enable Server Members Intent under Privileged Gateway Intents
  2. For listing channels:
    • Enable Message Content Intent under Privileged Gateway Intents
  3. Click Save Changes at the bottom of the page.

Activate Discord in Unified.to

  1. Navigate to Integrations in Unified.to.
  2. Find and click on the Discord integration card.
  3. On the integration details page:
    • Select Your OAuth 2 credentials.
    • First, enter your Discord Client ID.
    • Enter your Discord Client Secret.
    • Enter your Discord Bot Token.
  4. Click Activate to save your changes and enable the Discord integration.

You can now use the Unified API to create new experiences with Discord. Happy building!

Blog