Type in your question below and we'll check to see what answers we can find...
Loading article...
Submitting...
If you couldn't find any answers in the previous step then we need to post your question in the community and wait for someone to respond. You'll be notified when that happens.
Simply add some detail to your question and refine the title if needed, choose the relevant category, then post.
Before we can post your question we need you to quickly make an account (or sign in if you already have one).
Don't worry - it's quick and painless! Just click below, and once you're logged in we'll bring you right back here and post your question. We'll remember what you've already typed in so you won't have to do it again.
Please see below the most popular frequently asked questions.
Loading article...
Loading faqs...
Please see below the current ongoing issues which are under investigation.
Loading issue...
Loading ongoing issues...
I am using the Add Items to Playlist endpoint to add batches of 100 tracks to a playlist.
https://developer.spotify.com/documentation/web-api/reference/add-tracks-to-playlist
The batches are sent on a loop with a .333 second delay between each.
Intermittently, the API will return a 502 "Error while loading resource" on a given page of this loop.
This seems to be a fairly recent development or perhaps it's just happening with more frequency over the last few days.
Here's an example of a playlist on my paid plan that experiences the issue.
https://open.spotify.com/playlist/6RGyg7ehntbG2tp1L631cL
And here's the URL that I POST to for adding tracks, which works seemingly most of the time except when it doesn't and we get this 502 "Error while loading resource" response.
https://api.spotify.com/v1/playlists/6RGyg7ehntbG2tp1L631cL/track
Currently I've reworked my code to simply retry up to two extra attempts when I get a 502 error back, and it seems to work most of the time, but I'd prefer to avoid this (or have it happen with less frequency).
Any insight greatly appreciated.
Thank you,
TL
Does the behavior change if you lower the batch size?
I tried as low as 50 per batch / half the max and the issue persisted.
I am having the same issue, but it is occurring with every request to the endpoint. I do not get a status message in the body of the response, just a 502 status code (matches 502 HTTP status code response). Attached is the Postman request that I am using to make the request (saved as .txt file since the file type of attachments is limited). The playlistID and accessToken variables are part of my Postman environment I have set up. I have tried adding multiple variations of these three albums to multiple different playlists in my account, but with no luck.
@toddlevy
The endpoint only accepts "spotify:track:X" and "spotify:episode:X". From the documentation "A comma-separated list of Spotify URIs to add, can be track or episode URIs." If you want to add Albums to a playlist, you first need to fetch the tracks of that Album, and then add them.
But we should be returning 400 Bad Request in this case, I'll file a bug report about this.
I am only adding tracks to playlists.
I'm able to get the endpoint working with tracks in an album now, I must have missed that the endpoint only works with tracks and not albums, thank you for pointing that out. I'll post here if I see issues similar to the original post.
Hey there you, Yeah, you! 😁 Welcome - we're glad you joined the Spotify Community! While you here, let's have a fun game and get…