Skip to content
Get Free Trial

Authorization

Authenticate REST requests with Basic Auth, OAuth 1.0 or OAuth 2.0.

An API that holds private data asks who’s calling. Choose how a request authenticates on the Authorization tab: No Auth, Basic Auth, OAuth 1.0 or OAuth 2.0.

The request is sent without credentials.

Enter the Username and Password the API accepts.

Signs the request with OAuth 1.0. Set:

  • Credentials: choose saved credentials, or Add New. Give them a name you’ll recognise, and enter the Consumer Key, Consumer Secret, Token and Token Secret from the API provider.
  • Signature Method: HMAC-SHA1 or HMAC-SHA256, as the API requires.
  • Version and Realm: as the API requires.
The REST Client opened from Add Step, with the Authorization tab showing OAuth 1.0 chosen: Credentials with Add New, Signature Method HMAC-SHA1, Version and Realm, and the Add Rest Step button at the bottom

If you already have an access token, enter it in Access Token and send the request. Otherwise, click Get Access Token to open the OAuth2 Consent & Access Token Wizard, and choose how to get the token:

Option When to use it
Get Access Token without playback or recording the consent The token can be obtained without a user signing in and giving consent
Playback of already recorded consent script You already recorded the steps of signing in and giving consent
Record a new consent script You haven’t recorded those steps yet
Get Access Token from Refresh Token You have a refresh token to exchange for a new access token
The OAuth2 Consent and Access Token Wizard open in the middle of the REST Client, with four options: Get Access Token without playback or recording the consent, Playback of already recorded consent script, Record a new consent script, and Get Access Token from Refresh Token, with Cancel and Proceed; the Add Rest Step button shows at the bottom of the REST Client

Many APIs only give a token after a user signs in and agrees to share their data. A consent script records those steps once, so later runs get a fresh token without anyone signing in by hand:

  1. In the wizard, choose Record a new consent script and name it.
  2. Click Proceed. A browser window opens and asks for the authorization details from the API provider.
  3. On the provider’s sign-in page, enter the user name and password, and allow the permissions it asks for.
  4. The Access Token Request form opens with the authorization code filled in. Fill in the other details and click Get Access Token.
  5. The Access Token field in the REST Client is filled in. Click Send Request: the API now answers with its result.

To test other APIs from the same provider, choose Playback of already recorded consent script next time.