thelinmichael / spotify-web-api-node

A Node.js wrapper for Spotify's Web API.
http://thelinmichael.github.io/spotify-web-api-node/
MIT License
3.1k stars 499 forks source link

getAudioFeaturesForTrack returns unauthorized but getTrack works with same id and token #178

Open OliverColeman opened 6 years ago

OliverColeman commented 6 years ago

Have used lots of the endpoint functions exposed by this API, but am having trouble with the audio-features one.

If I do (after having retrieved and set an access token with the client credential flow method): spotifyApi.getTrack("6jj5kO7tFT3ir8WbbVO0iU") It works fine. If I do: spotifyApi.getAudioFeaturesForTrack("6jj5kO7tFT3ir8WbbVO0iU") I get:

name: 'WebapiError',
message: 'Unauthorized',
statusCode: 401,

I tried accessing the audio-features endpoint using the Spotify Web API Console (https://developer.spotify.com/web-api/console/get-audio-features-track) with the same track id and same access token and it worked.

Any ideas?

OliverColeman commented 6 years ago

More weirdness. These work:

spotifyApi.searchArtists("Earth");
spotifyApi.search("Earth", ["artist"]);

These give unauthorised error:

spotifyApi.searchAlbums("Earth");
spotifyApi.search("Earth", ["album"]);

I went back and forth between them with same token (over a few tokens), it's not a token expiry issue.