Announcements

Help Wizard

Step 1

NEXT STEP

How to add tracks to a playlist I own?

How to add tracks to a playlist I own?

I'd like to use the web api to add tracks to my playlist.

The 1st issue is how to get the access token. I see a few questions on this board about this issue. None of them has an answer that shows how to get an access token that has enough privilege to add tracks to a playlist. Fortunately, the access token in the browser (i.e. when you open the Developer Tools of the browser | Network | XHR, do something in the spotify web page and look at the request headers) seems to work.

Then I ran this httpie command to add a track to my playlist:

http POST https://api.spotify.com/v1/playlists/${playlist_id}/tracks uris==spotify:track:42wKvrfzk0ufQopBSB2M7F Authorization:"Bearer $TOKEN"

It returned a 201 response with a snapshot_id, e.g. MTIzLGJjYjdkZTgwYjk0YTU1NjU1NTQwMzFhYTM0ZGE2YWQwZWM1ZDZmNmM=

I don't know what to do with that snapshot id. The playlist still doesn't have any track added to it.

Reply
0 Replies

Suggested posts

Let's introduce ourselves!

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…

ModeratorStaff / Moderator/ 4 years ago  in Social & Random