Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Manoj_MUTHURAJA
Creator
Creator

Error using get method in t_rest client after retrieving the token

Hello,

I have an errorcode "401000",when I tried to use get method on the t_rest.I sucessfully retrieved the token on the first,so the next step is get the users list.

I have a created a context called token, to save this token for my next step because it will expire every one hour I guess.I saved the token in the context and with using that I tried to get users list on my second step but I didn't succeed .0683p000009M9Ah.png0683p000009M9BA.png

Thanks for your suggestions,

Labels (3)
4 Replies
Anonymous
Not applicable

Hi
You said you have used context variable to store the token value, but I don't see you use it on tRest_3 component which is calling API to get the user list, you are write it as a fixed string. To use context variable, the format is:
context.token

To store the token value to a context variable, you can do it on a tJavaRow component in the first step.
...tJavaRow
on tJavaRow:
context.token=input_row.token_value_column_name;

Regards
Shong

Manoj_MUTHURAJA
Creator
Creator
Author

Hi,

The issue is solved .The problem was adding the parameters in the tRest.

    Nom                            Value  

"Content-Type"       "application/xml"

"Authorization"       "Bearer "+context.token 

 

I worked to put the above parameters and I succeeded to get my users list.

You can please leave a comment if you have some questions.

 

 

Knowme
Contributor
Contributor

Hi I am working on similar requirement to get the list data from SharePoint in Talend. Can you please explain more on how you generated the token and flow?

KMarseau1673625636
Contributor
Contributor

Hi ! I am sorry to reply at this post after this time.

How do you succeed to get the token with your first tREST ? I am stuck at this step and don't find any help with the component tREST (I don't have the tRESTClient)