【问题标题】:Talend -- Rest API callTalend -- Rest API call
【发布时间】:2022-12-02 02:12:11
【问题描述】:
I am currently building an ETL job in Talend Open Studio, that calls an API to get data, the API call is OAuth 2.0 Authorized with an access token which I have to get by passing some values that are Base 64 Encoded, I am struggling in the part of getting access token
【问题讨论】:
标签:
java
oauth-2.0
talend
trustpilot
【解决方案1】:
As written in the linked docs
To obtain a token you needyourAPI Key, API Secret, Trustpilot username and password.
Then you call
Method: POST
https://api.trustpilot.com/v1/oauth/oauth-business-users-for-applications/accesstoken
With Headers:
Authorization: Basic [BASE64_ENCODED(API_KEY:API_SECRET)]
Content-Type: application/x-www-form-urlencoded
Noting that The KEY AND SECRET needs to be concatenated as follows KEY:SECRET and then base64 encoded
You should get your token and encoded valuesoutside of Talend(although, there probably is a base64 encoding processor).
Then you can use tHttpRequest to call other API endpoints listed in TrustPilot docs.