Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

How to use bitly api with oauth token?


Asked by Briella Conner on Dec 08, 2021 OAuth 2.0 Series



This API endpoint will return an OAuth access token, as well as the specified Bitly user's login and API key, allowing your application to use the Bitly API on their behalf. And the example response: client_id - your application's Bitly client id.
Keeping this in consideration,
To use the Bitly API, you'll need an OAuth access token to authorize and authenticate the connection to Bitly. Click the profile menu. Click Profile Settings. Click Generic Access Token. Enter your Bitly account password. Click Generate Token. Click Copy to copy the token.
Consequently, Click on the top-right settings menu and then select your username/email. On the next page, you will see the option for ‘Generic Access Token’. Click on it and copy your access token which we need in a moment. In order to create a short link with Bitly, it needs to send the HTTP POST request to the API endpoint.
Likewise,
How you authenticate to the Bitly API has changed with V4. Previously your authentication token would be provided as the access_token query parameter on each request. V4 instead requires that the token be provided as part of the Authorization header on each request.
Additionally,
And the example response: client_id - your application's Bitly client id. client_secret - your application's Bitly client secret. code - the OAuth verification code acquired via OAuth's web authentication protocol.