Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 .
Thanks for your suggestions,
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
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.
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?
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)