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

addTracksToPlaylist needs an extra parameter #159

Open
LuisAlvarez98 opened this issue Apr 23, 2020 · 1 comment
Open

addTracksToPlaylist needs an extra parameter #159

LuisAlvarez98 opened this issue Apr 23, 2020 · 1 comment

Comments

@LuisAlvarez98
Copy link

Hello this is my first time posting an issue on github. I don't know if here is the place to report something like this but I had an issue with the API call addTracksToPlaylists. I was trying to using it with the params:
playlistId and uri's list as it was told in the documentation
and the API wrapper builded this url: https://api.spotify.com/v1/users/[**playlistId**]/playlists/spotify:track:5cB9BlseQteklXaJjRtZti,spotify:track:2u6CBCGo8outw3ThHk4c4l,spotify:track:3dq0YBLnSElFSWETquqtxP,spotify:track:3PS7vZHBOB3rT70CUYHagZ/tracks

and I went to the Spotify Web API site and found that the url must be formed like this:
image

So I think that is needed to specify that an userId is also required to do the request properly.
Because currenlty in your docs this is not being specified:
image

First attempt without userId gave me a 404 error
image
Second attempt with userId gave me a 201
image

Desktop (please complete the following information):

  • OS: Windows 10 Pro
  • Browser: Google Chrome
  • Version: 80.0.3987.163
@JMPerez
Copy link
Owner

JMPerez commented May 1, 2020

Thanks @LuisAlvarez98 for reporting it.
You are right. The user id was dropped some time ago so it's no longer necessary to send it since the playlist id is unique across all users. Spotify updated the endpoints path to accept requests for playlists without specifying the user id (see https://developer.spotify.com/documentation/web-api/reference/playlists/add-tracks-to-playlist/ for the documentation for yous specific case).

This is something that needs to be done across several endpoints (get a playlist, add items to a playlist, change playlist details, get a playlist cover image, get playlist items, remove items from playlist, reorder playlist times, replace playlist items, upload cover image.

Since it's a breaking change it needs some extra work to make sure existing integrations will work fine.

Happy to keep this as an issue to be implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants