soundcloud / api

A public repo for our Developer Community to engage about bugs and feature requests on our Public API
145 stars 23 forks source link

PHP library resolve get user tracks 404 #113

Closed aproni34f closed 2 years ago

aproni34f commented 2 years ago

I am using your php library: https://github.com/danae/soundcloud-php

 $soundcloud = new Danae\Soundcloud\Soundcloud([
      'client_id' => $CLIENT_ID,
      'client_secret' => $CLIENT_SECRET
 ]);

$soundcloud->authorizeWithClientCredentials();

//when I try to get user tracks example which is taken directly from your api explorer, this does not work:

/users/{user_id}/tracks

$url = 'https://api.soundcloud.com/users/948745750/tracks';

 //or like this:

 $url = 'https://api.soundcloud.com/users/948745750/tracks?access=playable%2Cpreview&limit=2&linked_partitioning=true'

 $request = $soundcloud->resolve($url);   `

I get an error:

Fatal error: Uncaught RuntimeException: The request "GET /resolve?url=https%3A%2F%2Fapi.soundcloud.com%2Fusers%2F948745750%2Ftracks&client_id=MY_CLIENT_ID&oauth_token=MY_OAUTH_TOKEN" returned with HTTP status code 404: {"code":404,"message":"404 - Not Found","link":"https://developers.soundcloud.com/docs/api/explorer/open-api","status":"404 - Not Found","errors":[{"error_message":"404 - Not Found"}],"error":null} in C:\xampp\htdocs\xampp\js\hap__other\soundcloud php\sc\src\Soundcloud.php:126 Stack trace:

0 C:\xampp\htdocs\xampp\js\hap__other\soundcloud php\sc\src\Soundcloud.php(167): Danae\Soundcloud\Soundcloud->request('GET', '/resolve', Array)

1 C:\xampp\htdocs\xampp\js\hap__other\soundcloud php\sc.php(42): Danae\Soundcloud\Soundcloud->resolve('https://api.sou...')

2 {main}

dasha-kobzeva commented 2 years ago

Hello @aproni34f, the library you are using is not written or maintained by us, so, unfortunately, we cannot assists you with it. I would suggest posing a question directly in that lib repo.

If you call our API directly, do you still see this error?

Thank you

aproni34f commented 2 years ago

How would I call it directly, can you provide code example?

this is the url I want to get: (user tracks)

https://api.soundcloud.com/users/948745750/tracks

dasha-kobzeva commented 2 years ago

here is a curl request that should work:

$ curl -X GET "https://api.soundcloud.com/users/948745750/tracks" \
       -H  "accept: application/json; charset=utf-8" \
       -H "Authorization: OAuth ACCESS_TOKEN"