Requesting OAtuh2.0 token responds with HTML

Hi all,

First of all I’m a beginner with API’s and postman.
I’m trying to use postman to play around with the Withings API (https://developer.withings.com/)

But I’m stuck on retrieving the OAuth2.0 authorization code. I have configured it like this:

When I press ‘Get New Access Token’ the following happens:

  1. A Whitings pages shows up at which am already logged in. Here is need to accept to share data.

  2. After I accept it this page shows up. From my understanding, this is the callback page from Postman. In the URL it shows the authorization code.

  3. But in postman I see a HTML code and a message that the code is not found.

I understand that I could just copy the code from the URL.
But I would like to use it as an access token in postman or as a variable. What do I do wrong?

Hey @jorian-mellema, welcome to the Postman community! :tada:

I gave it a try and couldn’t get Withings to return the access token properly either. The other option as you mentioned is to get the access token and set is as a variable in Postman, you can do that by:

  • clicking on the name of the collection
  • opening the variables tab
  • setting a new variable with your token as a value

Then, in your request’s OAuth2.0 setting, set the variable as the token value and that should do it!

2 Likes

Hi, thankyou!
Is there a way to automatically set the token as variable ({{withings_token}})?
Instead of copying it from the URL and pasting it.

This is what the authorization helper in Postman is meant to help with, but I’ve been trying to figure out how to get Withings’s auth to work for the last hour and their process really isn’t the friendliest. :sweat_smile:

So for now the answer would be no, I’ll keep on trying to find a way and give an update here if I ever do!

Haha well said :wink: then i’ll use the work-around for now! Thank you :slight_smile: