add Track To Client Playlist
suspend fun addTrackToClientPlaylist(playlist: String, track: String, position: Int? = null)
Content copied to clipboard
Add a track to a user’s playlist.
Adding tracks to the current user’s public playlists requires authorization of the SpotifyScope.PLAYLIST_MODIFY_PUBLIC scope; adding tracks to the current user’s private playlist (including collaborative playlists) requires the SpotifyScope.PLAYLIST_MODIFY_PRIVATE scope.
Parameters
playlist
The id or uri for the playlist.
track
Track id or uri
position
The position to insert the tracks, a zero-based index. For example, to insert the tracks in the first position: position=0; to insert the tracks in the third position: position=2. If omitted, the tracks will be appended to the playlist. Tracks are added in the order they are listed in the query string or request body.
Throws
if any invalid track ids is provided or the playlist is not found
Sources
(source)
Link copied to clipboard