Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
cichy314
Contributor
Contributor

tRESTClient POST - issue with body from file

Hi All,

I have to get from Spotify Access Token.

I have to build a body but still I have some issue.

I have parameters in the in JSON format.

{

"body": [{

"client_secret":"aaaaaaaaaaaaaaa",

"client_id":"vvvvvvvvvvvvvv",

"grant_type":"client_credentials"

}

]

}

0695b00000ceRFAAA2.png

Labels (2)
3 Replies
Anonymous
Not applicable

You need to send the JSON to the "string" column for JSON. What you are doing here appears to be parsing the initial JSON from the file and then sending it to the "body" column. "body" is for XML.

cichy314
Contributor
Contributor
Author

Can I use tXMLMap or should I use different component to do string for tRESTClient ?

 

Thank You,

Mike

Anonymous
Not applicable

It is probably easier to build the JSON using a tJavaFlex and some Java to be honest. I have used Spotify before and it seems that you are doing something that I don't think is covered by the documentation here. Take a look at this....

 

https://developer.spotify.com/documentation/general/guides/authorization/

 

I have put together a tutorial video on using Spotify with Talend here: https://www.youtube.com/watch?v=mBcRTQB5n0c

 

It doesn't cover OAuth 2 in this example, but shows you how you can use the APIs easily. You may be helped by this. When it comes to sorting out a solution to getting access tokens, I have put together an example with FitBit. OAuth 2 is essentially the same everywhere. There are some subtle differences, but the overall flow is consistent. The video I put together on FitBit is here: https://www.youtube.com/watch?v=6Irs-SvviNc

 

The jobs are downloadable from the videos so you can have a play.