# How can I quickly replace the Authorization token within the HTTP Header for all my API Calls?

**URL:** <https://forum.katalon.com/t/how-can-i-quickly-replace-the-authorization-token-within-the-http-header-for-all-my-api-calls/35091>\
**Category:** API Testing\
**Tags:** api-testing, katalon-studio\
**Created:** [October 22, 2019, 2:23pm UTC](https://forum.katalon.com/t/how-can-i-quickly-replace-the-authorization-token-within-the-http-header-for-all-my-api-calls/35091 "2019-10-22T14:23:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mkleyn](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/mkleyn/32/16104_2.png) [@mkleyn](https://forum.katalon.com/u/mkleyn)\
**Post date:** [October 22, 2019, 2:23pm UTC](https://forum.katalon.com/t/how-can-i-quickly-replace-the-authorization-token-within-the-http-header-for-all-my-api-calls/35091/1 "2019-10-22T14:23:48Z")

</div>

Hi All,

I’m new to the API testing category.  
I’ve setup an Object Repositry for API via the following steps…

1. Right Click on Object Reposity
2. From the Option Menu \>\> Click on Import from Swagger
3. Typed in URL
4. Click OK

 ![image](https://europe1.discourse-cdn.com/katalon/original/2X/4/4e226d68dc958dec98230b142f97845925df7ea6.png)

Currently, for every API Call I need to change the Authorization Token manually and it’s very frustrating.  
Is there a way of to pick up the token automatically or set it in a data file?

Any help will be appreciated.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![sang](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/sang/32/6357_2.png) [@sang](https://forum.katalon.com/u/sang)\
**Post date:** [October 23, 2019, 10:51am UTC](https://forum.katalon.com/t/how-can-i-quickly-replace-the-authorization-token-within-the-http-header-for-all-my-api-calls/35091/2 "2019-10-23T10:51:12Z")

</div>

Hi [mkleyn](http://forum.katalon.com/u/mkleyn)

Instead of using the hard code value, you can extract the Token from login API and assign it to another API header.

> [@Store AUTH TOKEN in Global Variable](http://forum.katalon.com/t/store-auth-token-in-global-variable/10743/6):
>
> Hi [Julian\_Wladyczynski](http://forum.katalon.com/u/Julian_Wladyczynski) Please retry by following this step: 1. Assigned access\_token value to the GlobalVariable response = WS.sendRequest(findTestObject('Employees/Login backoffice and get access token')) WS.verifyResponseStatusCode(response, 200) JsonSlurper slurper = new JsonSlurper() Map parsedJson = slurper.parseText(response.getResponseText()) String access\_token = parsedJson.access\_token GlobalVariable.Token = access\_token 2. On the GET request, set the Variable as below.
