Friday, 6 September 2013

Unable to get sound cloud access_token with curl

Unable to get sound cloud access_token with curl

I am attempting to retrieve a Sound Cloud Access Token using cURL. I have
followed the example in the documentation and it consistently returns an
invalid_grant error:
curl -X POST "https://api.soundcloud.com/oauth2/token" -F
'client_id=XXXXX' -F 'client_secret=XXXXX' -F
'grant_type=authorization_code' -F
'redirect_uri=http://XXXXXX:8080/page/token' -F 'code=XXXXX'
the code was retrieved by making the following get request:
https://soundcloud.com/connect?response_type=code&client_id=XXXX&scope=non-expiring&redirect_uri=http%3A%2F%2Flocalhost%3A8080%page%2Ftoken&state=8QJUV
Am I doing something wrong. Based on the documentation this should work. I
have validated that the url passed in matches what is configured and that
the client_id and client_secret are correct.
Thanks

No comments:

Post a Comment