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!
Learn how to do cool things with Context Variables
Find out how to migrate from one database to another using the Dynamic schema
Read about some useful Context Variable ideas