danae / soundcloud-php

Easy to use SoundCloud API wrapper for PHP
Other
4 stars 1 forks source link

Resolve get user tracks 404 #3

Open aproni34f opened 3 years ago

aproni34f commented 3 years ago

I am using your php library

$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}