In response to my request for an authorization token, Soundcloud is replying with a json string, although I’m asking for xml. Is this a bug, or is it unimplemented, or am I doing something wrong?
I’ve posted the output from libcurl in “verbose” mode below, showing the “Accept” header, as well as the returned string in json format.
> POST /oauth2/token HTTP/1.1
User-Agent: libcurl-agent/1.0
Host: api.soundcloud.com
Accept: application/xml
Content-Length: 641
Content-Type: multipart/form-data; boundary=----------------------------6d7e62ba13e0
< HTTP/1.1 200 OK
< Server: nginx
< Date: Tue, 10 Apr 2012 21:48:55 GMT
< Content-Type: application/json; charset=utf-8
< Connection: keep-alive
< X-Runtime: 44
< ETag: "62f76a251f0cdc7c41edec20560d2c04"
< Cache-Control: private, max-age=0, must-revalidate
< Access-Control-Allow-Methods: GET, PUT, POST, DELETE
< Access-Control-Allow-Headers: Accept, Authorization, Content-Type, Origin
< Access-Control-Allow-Origin: *
< X-Cacheable: NO:Cache-Control=max-age=0
< Content-Length: 133
< X-Varnish: 3363129842
< Age: 0
< Via: 1.1 varnish
< X-Cache: MISS
<
* Connection #0 to host api.soundcloud.com left intact
Soundcloud result: {“access_token”:”1-17690-10631-cea7e4319d85f1XXXX”,”expires_in”:21599,”scope”:”*”,”refresh_token”:”50530eb4738f285df48f3694ad49XXXX”}
Thanks for pointing this out. At the moment, on JSON is supported by the OAuth2 token endpoint, which is inconsistent with the rest of the API. I’ll file a bug and hopefully we can get this fixed up. You’re not doing anything wrong though 🙂