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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Consuming API with TREST

Hi Guys 

 

could someone help me to config a tRest component to get Json response from an API (this is my job)

0683p000009M6xN.jpg

1. getAccessToken (TrestClient) I sent my credentials to get the Access Token 

0683p000009M84A.jpg

2. I extract the Access Token in the "extractXmlAccessToken" and save it to a global Var on the component setAccessToken

3. I build a Json structure (not important at this point)

4. I want to get a Json response from an API but I get an error

0683p000009M87Y.jpg

here is the tRest config

0683p000009M8Qs.jpg

but if I use Postman I'm able to get the Json response

0683p000009M83b.jpg

 

Thanks in advance

Alberto

 

 

Labels (3)
1 Reply
Anonymous
Not applicable
Author

1. For testing, print the access token (String)globalMap.get("accessToken") on console to check if it is retrieved correctly.
2. There should be a blank space after Bearer, eg:
"Bearer "+(String)globalMap.get("accessToken")
3. Write the all the header name/value in the Http Header list of tRest or tHttpRequest as it requires them in Postman.

Regards
Shong