Announcements

Help Wizard

Step 1

NEXT STEP

FAQs

Please see below the most popular frequently asked questions.

Loading article...

Loading faqs...

VIEW ALL

Ongoing Issues

Please see below the current ongoing issues which are under investigation.

Loading issue...

Loading ongoing issues...

VIEW ALL

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