I retrieved an OAuth2.0 Bearer Token through a REST API call using tREST. Once retrieved, the bearer token is stored as JSON string in tLogRow. Is it possible to add this value to the tRESTClient component for authentication? The bearer token expires every 1 or 2 hours - so I need to pass the Bearer Token dynamically to the tRESTClient or tREST component to make GET requests.
You can have one tRESTClient get a token:
and then use this token to configure another tRESTClient. Let us know if it helps.
Thanks xdshi - how would I pass the response from the first tRESTClient into the Header of another tRESTClient?
You'll want to use a tExtractJSONFields component to retrieve only the bearer token. You can then either pass this (as the row value) into the http headers section in the tRestClient, or you can can store in a global variable (see tSetGlobalVar), then use this global in subsequent api calls (assuming the token hasn't expired)
Talend named a Leader.
Kickstart your first data integration and ETL projects.
Watch the recorded webinar!
Read about some useful Context Variable ideas
Pick up some tips and tricks with Context Variables
Take a look at the Talend Studio improvements for API Services