librespot-java icon indicating copy to clipboard operation
librespot-java copied to clipboard

Some API Endpoints do require extra scopes.

Open christosk92 opened this issue 3 years ago • 0 comments

Describe the bug Not really a bug report, but this may help some people who are struggling with 403 requests on some endpoints.

To Reproduce I was trying to get the top tracks for a user, call:

GET https://api.spotify.com/v1/me/top/tracks?offset=0&limit=10&time_range=short_term

Authorized with a bearer token using librespot with the "playlist-read" scope. But then I was hit with a "403"...
It turns out I had to add the extra "user-top-read" scope (next to playlist-read), when fetching the token. (As found here)

My idea is that scopes work based on hierarchy, and for a while "playlist-read" was the highest scope? "user-top-read" is a fairly new feature/scope, so it may be higher than "playlist-read"...

Screenshots/Stracktraces/Logs Screenshots if applicable, stacktrace and log is a crash occurred.

Without "user-top-read" scope: image

With "user-top-read" scope: image

Version/Commit Version used or commit pulled if compiled locally.

christosk92 avatar Jun 05 '22 15:06 christosk92