# Requesting OAtuh2.0 token responds with HTML

**URL:** <https://community.postman.com/t/requesting-oatuh2-0-token-responds-with-html/35287>\
**Category:** Help Hub\
**Tags:** authentication, oauth2-token\
**Created:** [May 13, 2022, 1:39pm UTC](https://community.postman.com/t/requesting-oatuh2-0-token-responds-with-html/35287 "2022-05-13T13:39:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jorian-mellema](https://avatars.discourse-cdn.com/v4/letter/j/f1d935/32.png) [@jorian-mellema](https://community.postman.com/u/jorian-mellema)\
**Post date:** [May 13, 2022, 1:39pm UTC](https://community.postman.com/t/requesting-oatuh2-0-token-responds-with-html/35287/1 "2022-05-13T13:39:02Z")

</div>

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/](https://developer.withings.com/))

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

 ![image](https://us1.discourse-cdn.com/getpostman/original/2X/c/c22dea0ab867ff0aa62747cc03b6c66e094de1f4.png)

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?

---

<div class="post-metadata">

**Author:** ![arlem](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/arlem/32/3078_2.png) [@arlem](https://community.postman.com/u/arlem)\
**Post date:** [May 17, 2022, 9:58am UTC](https://community.postman.com/t/requesting-oatuh2-0-token-responds-with-html/35287/2 "2022-05-17T09:58:18Z")

</div>

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

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

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/c/9/c996c9308a5dbde2bebfbf5b8263a77d928dfa9c.png)

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

 ![image](https://us1.discourse-cdn.com/getpostman/original/2X/d/d1c85fb6c14b2cea0c51587ca0fab9bc68ed192b.png)

---

<div class="post-metadata">

**Author:** ![jorian-mellema](https://avatars.discourse-cdn.com/v4/letter/j/f1d935/32.png) [@jorian-mellema](https://community.postman.com/u/jorian-mellema)\
**Post date:** [May 18, 2022, 10:33am UTC](https://community.postman.com/t/requesting-oatuh2-0-token-responds-with-html/35287/3 "2022-05-18T10:33:45Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![arlem](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/arlem/32/3078_2.png) [@arlem](https://community.postman.com/u/arlem)\
**Post date:** [May 23, 2022, 10:25am UTC](https://community.postman.com/t/requesting-oatuh2-0-token-responds-with-html/35287/4 "2022-05-23T10:25:27Z")

</div>

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. 😅

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!

---

<div class="post-metadata">

**Author:** ![jorian-mellema](https://avatars.discourse-cdn.com/v4/letter/j/f1d935/32.png) [@jorian-mellema](https://community.postman.com/u/jorian-mellema)\
**Post date:** [May 23, 2022, 11:05am UTC](https://community.postman.com/t/requesting-oatuh2-0-token-responds-with-html/35287/5 "2022-05-23T11:05:19Z")

</div>

Haha well said 😉 then i’ll use the work-around for now! Thank you 🙂
