Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

player.getCurrentlyPlayingTrack triggers a 400 response #36

Open
miguel-martinr opened this issue Sep 8, 2021 · 0 comments
Open

player.getCurrentlyPlayingTrack triggers a 400 response #36

miguel-martinr opened this issue Sep 8, 2021 · 0 comments

Comments

@miguel-martinr
Copy link

miguel-martinr commented Sep 8, 2021

I think the parameter market for player.getCurrentlyPlayingTrack should be required.

I've been the whole day dealing with a code 400 (bad request) response after using player.getCurrentlyPlayingTrack, I think the problem is that for the endpoint used (https://api.spotify.com/v1/me/player/currently-playing) the query parameter market is required while player.getCurrentlyPlayingTrack takes it as an optional parameter.

After setting the market it started to work just fine:

const webApi = new SpotifyWebApi({clientId, clientSecret, redirectUri, accessToken});
const currentlyPlaying = await webApi.player.getCurrentlyPlayingTrack({
        market: 'ES',
});

I apologize if there is something I am overlooking 😅

@miguel-martinr miguel-martinr changed the title player.getCurrentlyPlaying triggers a 400 response player.getCurrentlyPlayingTrack triggers a 400 response Sep 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant