spotify-graphql icon indicating copy to clipboard operation
spotify-graphql copied to clipboard

Spotify API change: userId is no longer used in playlist query

Open mickdekkers opened this issue 6 years ago • 1 comments

The playlist GraphQL query currently has a required userId parameter: https://github.com/wittydeveloper/spotify-graphql/blob/f3d3b119ba5c93487b7dd223172eb2cb2ce4c3df/lib/schema.ts#L194

There was a change to the Spotify API which means this parameter is no longer used:

https://developer.spotify.com/community/news/2018/06/12/changes-to-playlist-uris/

On the 11th September 2018 we will roll out a change across all our APIs to simplify the URIs used to represent playlist objects. Instead of a long URI such as spotify:user:spotify:playlist:37i9dQZF1DZ06evO3OC4Te, you will now get the more succinct but still unique spotify:playlist:37i9dQZF1DZ06evO3OC4Te.

In tandem with this change, we are also releasing a set of simplified URLs for our Playlist Web API endpoints. The usage, functionality and response objects are identical, but the URLs are more concise and follow the new URI structure more closely.

You can see the full list of URLs in the table below:

Endpoint Usage
/v1/playlists/{playlist_id}/tracks Get/Add/Remove/Reorder/Replace a playlist’s tracks (depending on HTTP method)
/v1/playlists/{playlist_id} Retrieve or update a playlist’s details (depending on HTTP method)
/v1/me/playlists Create a Playlist (POST only)
/v1/playlists/{playlist_id}/images Get/Upload a Playlist Cover Image (depending on HTTP method)

spotify-web-api-node's v4.0.0 update accounts for these changes:

Modified functions that operate on playlists to drop the user id parameter. This is a breaking change. PR

mickdekkers avatar Dec 07 '19 08:12 mickdekkers

Will do in [email protected], cf: #79

charlypoly avatar Jan 11 '21 19:01 charlypoly