Last modified:
Last time, we introduced how to use Postman to access public data from Disqus REST API. The example exercises illustrated a few ways to query the data of discussion threads using the GET method with a public API key. Since Disqus comments are public data, no user authentication is required for most read actions. So, how about post or update actions?
Absolutely, they are different. The API requests to write data must be authenticated. This time, we will learn how to get an OAuth access token for the Disqus REST API using Postman.
Perform OAuth 2.0 authentication with Postman
- In the Postman request builder, click on the Authorization tab.
- Select OAuth 2.0 from the Type dropdown list.
- Click on the Get New Access Token button on the right side to request an access token.
- For the Disqus REST API, enter the following in the dialog:
Field | Value |
---|---|
Token Name | e.g. Disqus API Token The name you want to use for the token |
Grant Type | Authorization code / Implicit Read Postman Docs |
Callback URL | https://<your-domain>/oauth_redirect Redirect URI that points to a trusted domain listed in your application |
Auth URL | https://disqus.com/api/oauth/2.0/authorize/ Disqus authorize endpoint |
Client ID | {{api_key}} Your Disqus API Public key |
Client Secret | {{api_secret}} Your Disqus API Secret key |
Scope | read,write Please refer to Permissions and Scopes |
State | code Temporary exchange parameter |
- Click Request Token to continue. If this is the first time that you are requesting authorization, you will be prompted by Disqus to authorize access for your app by signing in your account.
- If you successfully receive a token from the API, you will see its details, together with the expiry.
Click Use Token to select the returned value.
Next time, we will apply the access token to send authenticated requests, like create, update, and remove a thread from your Disqus.
References
- Authorizing requests | Postman Learning Center
- Disqus API – Authentication
- Disqus API – Permissions and Scopes
FAQ for Postman
If you enjoy this post, please share it on Facebook and Twitter. You might also support us by making a donation through Ko-fi.