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
- 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.
- Select Bot from the left sidebar.
- Under Build-A-Bot > Token, copy the Bot Token.
- If you don't see the token, click Reset Token.
- Click Yes, do it! in the confirmation dialog.
- Copy the new token that appears.
- 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:
- For listing guild members (using our HRIS List Employees API):
- Enable Server Members Intent under Privileged Gateway Intents
- Enable Server Members Intent under Privileged Gateway Intents
- For listing channels:
- Enable Message Content Intent under Privileged Gateway Intents
- Enable Message Content Intent under Privileged Gateway Intents
- Click Save Changes at the bottom of the page.
Activate Discord in Unified.to
- Navigate to Integrations in Unified.to.
- Find and click on the Discord integration card.
- 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.
- 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!