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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
zalibra
Contributor III
Contributor III

tRest output for tHttpRequest input

Wondering if it's possible to use the output of tRest as an input for tHttpRequest.

 

I'm using tRest to generate a dynamic Bearer token (this token expires every 10 minutes, so I need to generate a new one whenever I run the job). I then need to use that Bearer token in tHttpRequest to hit an exchange API to download trade data. 

 

I'm trying to figure out how to configure tHttpRequest to take the output of tRest and then make the http call. Screenshots attached. 

 

 

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Store your access token in a global using tSetGlobalVar after you tmap.

(Alternatively you can use a tJavaRow and just write the code yourself)

globalMap.put("whateverYouNamedIt", test.tokenName)

Whatever you use as the key, you can then pass to the value in the tHttpRequest component, you can access it using this convention

 

"Bearer " + (String)globalMap.get("whateverYouNamedIt")

Make sure to connect tRest to tHttpRequest via a onSubjobOK to ensure correct execution order

View solution in original post

2 Replies
Anonymous
Not applicable

Store your access token in a global using tSetGlobalVar after you tmap.

(Alternatively you can use a tJavaRow and just write the code yourself)

globalMap.put("whateverYouNamedIt", test.tokenName)

Whatever you use as the key, you can then pass to the value in the tHttpRequest component, you can access it using this convention

 

"Bearer " + (String)globalMap.get("whateverYouNamedIt")

Make sure to connect tRest to tHttpRequest via a onSubjobOK to ensure correct execution order

zalibra
Contributor III
Contributor III
Author

Thank you!