# Get URL parameters from future GET request

**URL:** <https://community.postman.com/t/get-url-parameters-from-future-get-request/26520>\
**Category:** Help Hub\
**Tags:** authentication, oauth2\
**Created:** [August 6, 2021, 7:03pm UTC](https://community.postman.com/t/get-url-parameters-from-future-get-request/26520 "2021-08-06T19:03:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexca88](https://avatars.discourse-cdn.com/v4/letter/a/b19c9b/32.png) [@alexca88](https://community.postman.com/u/alexca88)\
**Post date:** [August 6, 2021, 7:03pm UTC](https://community.postman.com/t/get-url-parameters-from-future-get-request/26520/1 "2021-08-06T19:03:23Z")

</div>

_My question_:

Hello, I have been trying to get a token from a post request:

Post [https://auth.mysite.com/oxauth/login](https://auth.mysite.com/oxauth/login)

The body includes username and password, when I send this request from the console I can see 4 requests being sent:

Post [https://auth.mysite.com/oxauth/login](https://auth.mysite.com/oxauth/login)  
Get [https://auth.mysite.com/oxauth/authorize?scope](https://auth.mysite.com/oxauth/authorize?scope)…  
Get [https://auth.mysite.com/oxauth/authorize?scope=Email+permission](https://auth.mysite.com/oxauth/authorize?scope=Email+permission)  
Get [https://auth.mysite.com/#/login-callback/&access\_token=9180228c-ef88-43d4-bh83-7fe587542f06](https://auth.mysite.com/#/login-callback/&access_token=9180228c-ef88-43d4-bh83-7fe587542f06)

I need to find a way to get that access\_token and save it in an environment variable, I’m new in postman and I don’t know how to access a chain response like that one.

I have tried with this one

const responseJson = pm.response.headers.get(‘location’);

console.log(`Response URL: ${responseJson}`);

console.log(pm.request.url.query.toObject())

but both are empty

---

<div class="post-metadata">

**Author:** ![vdespa](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/vdespa/32/2770_2.png) [@vdespa](https://community.postman.com/u/vdespa)\
**Post date:** [August 9, 2021, 6:31pm UTC](https://community.postman.com/t/get-url-parameters-from-future-get-request/26520/2 "2021-08-09T18:31:32Z")

</div>

The OAuth flow is a bit more special since it involves a browser and a callback to Postman. I doubt you can grab the callback parameters from scripts with pm.request.

---

<div class="post-metadata">

**Author:** ![alexca88](https://avatars.discourse-cdn.com/v4/letter/a/b19c9b/32.png) [@alexca88](https://community.postman.com/u/alexca88)\
**Post date:** [August 10, 2021, 9:12pm UTC](https://community.postman.com/t/get-url-parameters-from-future-get-request/26520/3 "2021-08-10T21:12:15Z")

</div>

Do you have any other suggestions that I can take a look?

---

<div class="post-metadata">

**Author:** ![vdespa](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/vdespa/32/2770_2.png) [@vdespa](https://community.postman.com/u/vdespa)\
**Post date:** [August 11, 2021, 7:51am UTC](https://community.postman.com/t/get-url-parameters-from-future-get-request/26520/4 "2021-08-11T07:51:52Z")

</div>

It would help if you could add more details regarding what you are _actually_ trying to accomplish with Postman and some screenshots showing what you have tried so far.
