ClientPlaylistApi

Endpoints for retrieving information about a user’s playlists and for managing a user’s playlists.

Api Reference

Constructors

Link copied to clipboard
constructor(api: GenericSpotifyApi)

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
suspend fun addPlayablesToClientPlaylist(playlist: String, vararg playables: PlayableUri, position: Int? = null)

Add a Playable to a user’s playlist.

Link copied to clipboard
suspend fun addPlayableToClientPlaylist(playlist: String, playable: PlayableUri, position: Int? = null)

Add a Playable to a user’s playlist.

Link copied to clipboard
suspend fun changeClientPlaylistDetails(playlist: String, name: String? = null, public: Boolean? = null, collaborative: Boolean? = null, description: String? = null)

Change a playlist’s name and public/private state. (The user must, of course, own the playlist.)

Link copied to clipboard
suspend fun createClientPlaylist(name: String, description: String? = null, public: Boolean? = null, collaborative: Boolean? = null, user: String? = null): Playlist

Create a playlist for a Spotify user. (The playlist will be empty until you add playables.)

Link copied to clipboard
suspend fun deleteClientPlaylist(playlist: String): String

This method is equivalent to unfollowing a playlist with the given playlist.

Link copied to clipboard

Find a client playlist by its id. If you want to find multiple playlists, consider using getClientPlaylists

Link copied to clipboard
suspend fun getClientPlaylists(limit: Int? = api.spotifyApiOptions.defaultLimit, offset: Int? = null): PagingObject<SimplePlaylist>

Get a list of the playlists owned or followed by a Spotify user.

Link copied to clipboard
suspend fun getPlaylist(playlist: String, market: Market? = null): Playlist?

Get a playlist owned by a Spotify user.

Link copied to clipboard
suspend fun getPlaylistCovers(playlist: String): List<SpotifyImage>

Get the current image(s) associated with a specific playlist.

Link copied to clipboard
suspend fun getPlaylistTracks(playlist: String, limit: Int? = api.spotifyApiOptions.defaultLimit, offset: Int? = null, market: Market? = null): PagingObject<PlaylistTrack>

Get full details of the tracks of a playlist owned by a Spotify user.

Link copied to clipboard
suspend fun getUserPlaylists(user: String, limit: Int? = api.spotifyApiOptions.defaultLimit, offset: Int? = null): PagingObject<SimplePlaylist>

Get a list of the playlists owned or followed by a Spotify user. Lookups for non-existant users return an empty PagingObject (blame Spotify)

Link copied to clipboard

Remove all the playables in a playlist

Link copied to clipboard
suspend fun removePlayableFromClientPlaylist(playlist: String, playable: PlayableUri, snapshotId: String? = null): PlaylistSnapshot

Remove all occurrences of a playable from the specified playlist.

suspend fun removePlayableFromClientPlaylist(playlist: String, playable: PlayableUri, positions: SpotifyPlayablePositions, snapshotId: String? = null): PlaylistSnapshot

Remove a playable in the specified positions (zero-based) from the specified playlist.

Link copied to clipboard
suspend fun removePlayablesFromClientPlaylist(playlist: String, vararg playables: PlayableUri, snapshotId: String? = null): PlaylistSnapshot

Remove all occurrences of the specified playables from the given playlist.

suspend fun removePlayablesFromClientPlaylist(playlist: String, vararg playables: Pair<PlayableUri, SpotifyPlayablePositions>, snapshotId: String? = null): PlaylistSnapshot

Remove playables (each with their own positions) from the given playlist. Bulk requesting is only available when snapshotId is null.

Link copied to clipboard
suspend fun reorderClientPlaylistPlayables(playlist: String, reorderRangeStart: Int, reorderRangeLength: Int? = null, insertionPoint: Int, snapshotId: String? = null): PlaylistSnapshot

Reorder a playable or a group of playables in a playlist.

Link copied to clipboard
suspend fun replaceClientPlaylistPlayables(playlist: String, vararg playables: PlayableUri)

Replace all the playables in a playlist, overwriting its existing playables. This powerful request can be useful for replacing playables, re-ordering existing playables, or clearing the playlist.

Link copied to clipboard
suspend fun setClientPlaylistPlayables(playlist: String, vararg playables: PlayableUri)

Replace all the playables in a playlist, overwriting its existing playables. This powerful request can be useful for replacing playables, re-ordering existing playables, or clearing the playlist.

Link copied to clipboard
suspend fun uploadClientPlaylistCover(playlist: String, imagePath: String? = null, imageFile: VfsFile? = null, image: BufferedImage? = null, imageData: String? = null, imageUrl: String? = null)

Replace the image used to represent a specific playlist. Image type must be jpeg.