Saving A Track

Wraps around this Spotify API endpoint

Note

If you have more that 10,000 tracks saved, this will fail with an HTTP status code of 403

How to use

After getting a track through either Spotify.Tracks.GetTrack() or any other function/object which contains/returns track objects, the .Save() method of the track object can be used.

.Save() expects no parameters and will save a track to the current user's Your Music library.

Example

This example will:

A) Get a track with Spotify.Tracks.GetTrack() by the track's Spotify ID

B) Save the track with the .Save() method.

Spoofy := new Spotify()
GoodSongIMO := Spoofy.Tracks.GetTrack("4A6eJ3gOmVdD7C69N3DC7K")
GoodSongIMO.Save()

An alternative way to do this without getting the full track object is the Spotify.Library.SaveTrack() method, which takes a track ID, and would save the track in a single web API call.

Spotify.Library.SaveTrack("4A6eJ3gOmVdD7C69N3DC7K")