Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
olja
Contributor
Contributor

How to use chain calls with tRest? To us auth token in Rest-Calls

Hi,

I am trying to chain some tRest Calls. For authentication purpose I need to chain my rest calls, so first I have to call a REST-Api with http://foobar/auth and a user in its body, this works and it returns a JSON String 

{
    "token""myJWTToken"
}
Now with this I have an authentication token which I need to use in my next tRest-Call. But how can I extract this json data and use it in my next tRest Call in its body? 
Labels (3)
1 Reply
uzix
Creator
Creator

hello,

 

you use tExtractJSONFields to get the token value, set a globalVar .

key:token

value:row.token

to use the extracted value set in globalvar for the next call  -> globalMap.get("token")