Hi Roland!
I answered a similar question on StackOverflow, but the question
appears to have been deleted. I'll repeat the answer here.
You are using two different methods to pass the access token[1]. You
can use one or the other. You need to make sure you're making a POST
request. You'll also need to pass the method name and parameters in
the body of the request.
To do this with PHP: set the `CURLOPT_POSTFIELDS` option using the
`curl_setopt` method[2]. The value of the `CURLOPT_POSTFIELDS` option
will be an array (map) containing the method name and parameters. The
array should look something like:
array(
'method' => 'get',
'keys'=> 'r139688'
)
[1]:
http://www.rdio.com/developers/docs/web-service/oauth2/overview/ref-using-an-access-token
[2]:
http://php.net/manual/en/function.curl-setopt.php
--
Devin Sevilla
API Engineer, Rdio Inc.
http://rdio.com/people/devin_s/
On Sun, Jun 14, 2015 at 1:53 PM, Roland Beck <
oberas...@gmail.com> wrote:
> Hello,
>
> sorry, I´m very new to OAuth 2.0.
>
> I want to make a little php script...
>
> I have no problems to get an access token. But I dont get it, what I have to
> do with the access token.
>
> Can someone give my an example, how I can use the access token to make an
> api call? (for example to get my playlists or username) .
>
> The access token is saved in $access_key.
>
> I tried this little test - but not nothing happend:
>
>
> $curl = curl_init();
>
> curl_setopt($curl, CURLOPT_URL,
> '
https://services.rdio.com/api/1/?access_token='.$access_key);
> curl_setopt($curl, CURLOPT_HTTPHEADER, array('Authorization: Bearer
> '.$access_key'));
> $resp = curl_exec($curl);
> curl_close($curl);
>
>
> // Print response or handle error
> if($resp){ echo $resp; }
> else{ die('Error: "' . curl_error($curl)); }
>
> --
> You received this message because you are subscribed to the Google Groups
> "Rdio API" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
rdio-api+u...@googlegroups.com.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/rdio-api/25405cfc-e352-4d6c-bd91-f340dfc5052c%40googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.