This article explains how to generate an OAuth access token, which is required to authenticate your connection to the Bitly API.
Before you begin: If you log in using SSO (such as Google), see the SSO workaround section below before starting.
Steps to generate your OAuth access token
An OAuth access token is required to authorize and authenticate a connection to the Bitly API.
To generate your OAuth access token:
- Log in to your Bitly account.
-
Click Settings in the left sidebar.
-
Click API.
- In the access token section, enter your Bitly account password and click Generate token.
- Copy the token. If you leave this page and then return, you'll be prompted to enter your password again to view the token.
You can now paste the token into your code or settings to connect via the API.
Protect your token. If it does get exposed to anyone outside your organization, you can always manually disable this one and generate a new one.
SSO users: How to generate an API token
If you log in to Bitly using an SSO provider like Google, you may not have a Bitly password set — which means you'll run into an issue when the API token flow prompts you for one.
Use the steps below to set a Bitly password, which will let you complete the token generation flow.
-
Sign out of your account from the profile menu on the upper right side.
-
From the main Bitly page, click Log in.
-
On the login page, click Forgot your password?
- Enter your email address and click Reset.
We'll immediately send a password reset request to the email address associated with your account. This link is valid for 30 minutes, after which you'll need to request a new link. -
Open the password reset email from Bitly and click Reset Password.
-
Set a new password for your account and click Reset password.
- Log back in to Bitly using SSO.
- Follow the steps above to generate your OAuth access token using the password you set for your account.
After setting a password this way, you can continue to use SSO to log in — having a password set doesn't change how you sign in. This is a temporary workaround while an in-app improvement is in progress.