From Thursday, July, 9, 3:00 PM Pacific,
our Community site will be in
read-only mode
through Sunday, July 12th.
Thank you for your patience.

Error using get method in t_rest client after retrieving the token

Highlighted
Six Stars

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 .t1.PNGt2.PNG

Thanks for your suggestions,

Highlighted
Community Manager

Re: Error using get method in t_rest client after retrieving the token

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

----------------------------------------------------------
Talend | Data Agility for Modern Business
Highlighted
Six Stars

Re: Error using get method in t_rest client after retrieving the token

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.

 

 

Tags (4)

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

6 Ways to Start Utilizing Machine Learning with Amazon We Services and Talend

Look at6 ways to start utilizing Machine Learning with Amazon We Services and Talend

Blog

Downloads and Trials

Test drive Talend's enterprise products.

Downloads