Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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
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
Thank you!