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.
Did the API change the functionality of adding tracks to a playlist? I have my code load in TrackIds and use them to add tracks to a playlist but just today I got an error saying that I did not provide any URIs. Did something change in the backend that no longer will allow me to provide TrackIds instead of URIs?
I am using the spotipy Python package and another user commented below that their own web app has this same issue.
Error code 400: No uris provided., reason: None
ISSUE RESOLVED: My python code using spotipy now works as expected and the function playlist_add_items works perfect now. Thank you to whoever made this correction.
The documentation says you should provide track/item URIs for years.
Hi Spotify,
issue
here is an example for adding 1 track to a playlist
method = POST
url = 'https://api.spotify.com/v1/playlists/1n2STXHae0Wg6ZV0OYwToy/tracks'
data = '["spotify:track:5G4JTc4HlIsg7CyiDwoPV2"]'
questions
- is this a known issue that is being worked on?
- do i need to change my code?
- is there anything i can do to help sort this out?
Thanks,
Louie
The request body should be:
{
"uris": [
"uri1","uri2","urietc"
],
"position": 0
}
Like it is documented at https://developer.spotify.com/documentation/web-api/reference/add-tracks-to-playlist
It must be an error on the Spotify side. I am using the Python package spotipy and wasn't sure if it was an issue there or in the backend. Hoping Spotify will address this issue shortly.
-yep i agree that is what the docs say.
-i have been using the spotipy web api wrapper for 2.75 years to add tracks to another playlist.
-it worked fine a few days ago
-my code has not changed
-today when i attempt to add a track to another playlist i now get Error: 400 "No uris provided."
-it seems to me that spotify has changed the code on the server
-was this change intentional?
-if this was intentional it seems like the v1 in the url would need to be bumped to v1+ because a change like this will break a lot of spotipy user apps
@Ximzend excellent it is working. thanks for testing the spotipy api.
a couple of questions:
1) what version of the spotipy pkg did you use.
2) can you paste an example of the 'items' param you passed into spotipy: playlist_add_items(self, playlist_id, items, position=None)
fyi...i had to modify spotipy: playlist_add_items() to stop getting the Error: 400 "No uris provided."
see modified code in a later post
btw... if you are interested you might google spotifyfinder.com to have a look at the web app...
the move and copy features are currently busted.
Thanks,
Louie
Have same problem today, i'm using spotipy and
the spotify server appears to no longer accept
items = ['spotify:track:6HG5MFydepB9F8DAP0ejDD', 'spotify:track:3yQ4dy23XekcMsdeaBXZR6']
if you do this you get Error: 400 "No uris provided."
you must now pass in
items = {'uris': ['spotify:track:6HG5MFydepB9F8DAP0ejDD', 'spotify:track:3yQ4dy23XekcMsdeaBXZR6']}
if you do this it works fine
- had to modify spotipy: playlist_add_items() to make it work
- use the passed in items param directly
def playlist_add_items(elf, playlist_id, items, position=None):
plid = self._get_id("playlist", playlist_id)
# ftracks = [self._get_uri("track", tid) for tid in items]
ftracks = items
return self._post(
"playlists/%s/tracks" % (plid),
payload=ftracks,
# position=position)
i wonder if spotify knows they broke spotipy?
both spotipy 2.22.1 and spotipy 2.23.0 are broken
It looks like Spotify fixed the issue overnight. The python program works as expected now with no issues using the function playlist_add_items. Thank you!
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…