[GH-ISSUE #284] Spotify API returns 502 error when supplying snapshot_id #210

Closed
opened 2026-02-27 19:26:36 +03:00 by kerem · 1 comment
Owner

Originally created by @lu3do on GitHub (Apr 9, 2025).
Original GitHub issue: https://github.com/jwilsson/spotify-web-api-php/issues/284

When trying to delete track(s) using the deletePlaylistTracks() and supplying a $snapshot_id the Spotify API returns a 502 with "Error while loading resource" or "Invalid base62"

Looking at the documentation, it seems like they removed the support for supplying "snapshot_id" in the request.

https://developer.spotify.com/documentation/web-api/reference/remove-tracks-playlist

using deletePlaylistTracks() without a snapshot_id does work.

BTW same issue for reorderUserPlaylistTracks()

Originally created by @lu3do on GitHub (Apr 9, 2025). Original GitHub issue: https://github.com/jwilsson/spotify-web-api-php/issues/284 When trying to delete track(s) using the `deletePlaylistTracks()` and supplying a `$snapshot_id` the Spotify API returns a 502 with "Error while loading resource" or "Invalid base62" Looking at the documentation, it seems like they removed the support for supplying "snapshot_id" in the request. https://developer.spotify.com/documentation/web-api/reference/remove-tracks-playlist using `deletePlaylistTracks()` without a snapshot_id does work. BTW same issue for `reorderUserPlaylistTracks()`
kerem closed this issue 2026-02-27 19:26:36 +03:00
Author
Owner

@jwilsson commented on GitHub (Apr 11, 2025):

Hey!
Are you passing the tracks to delete as positions or tracks? I.e.

$api->deletePlaylistTracks('playlist_id', ['positions' => [0, 1], 'snapshot_id');

// or
$api->deletePlaylistTracks('playlist_id', ['tracks' => ['uri' => 'track_uri']], 'snapshot_id');

There's been issues in the past with using the positions key (which seems to have been removed from the API). But looking at Spotify's documentation on deleting playlist tracks and reordering playlist tracks the snapshot_id parameter is still listed.

I don't know if you've seen this Spotify forum thread but it seems to be a common issue unfortunately.

<!-- gh-comment-id:2796541283 --> @jwilsson commented on GitHub (Apr 11, 2025): Hey! Are you passing the tracks to delete as `positions` or `tracks`? I.e. ```php $api->deletePlaylistTracks('playlist_id', ['positions' => [0, 1], 'snapshot_id'); // or $api->deletePlaylistTracks('playlist_id', ['tracks' => ['uri' => 'track_uri']], 'snapshot_id'); ``` There's [been issues](https://github.com/jwilsson/spotify-web-api-php/issues/271) in the past with using the `positions` key (which seems to have been removed from the API). But looking at Spotify's documentation on [deleting playlist tracks](https://developer.spotify.com/documentation/web-api/reference/remove-tracks-playlist) and [reordering playlist tracks](https://developer.spotify.com/documentation/web-api/reference/reorder-or-replace-playlists-tracks) the `snapshot_id` parameter is still listed. I don't know if you've seen [this Spotify forum thread](https://community.spotify.com/t5/Spotify-for-Developers/Getting-502-response-on-DELETE-for-playlist-lt-playlistid-tracks/m-p/6736837) but it seems to be a common issue unfortunately.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotify-web-api-php#210
No description provided.