Playlists Apis
class PlaylistsApis(client: HttpClient = HttpClient(CIO) {
install(ContentNegotiation) { json() }
})
Playlist domain API for Spotify Web API.
Covers playlist metadata, items, creation, cover images, and browse playlist endpoints.
Constructors
Functions
Link copied to clipboard
suspend fun addCustomPlaylistCoverImage(playlistId: String, imageBase64Jpeg: String): SpotifyApiResponse<Boolean>
Uploads a custom cover image for a Spotify playlist.
Link copied to clipboard
suspend fun addItemsToPlaylist(playlistId: String, body: AddItemsToPlaylistRequest? = null, uris: List<String>? = null, position: Int? = null): SpotifyApiResponse<SnapshotIdResponse>
Adds items to a Spotify playlist.
Link copied to clipboard
suspend fun changePlaylistDetails(playlistId: String, body: ChangePlaylistDetailsRequest): SpotifyApiResponse<Boolean>
Changes metadata for a Spotify playlist.
Link copied to clipboard
suspend fun createPlaylist(body: CreatePlaylistRequest): SpotifyApiResponse<SimplifiedPlaylistObject>
suspend fun createPlaylist(userId: String, body: CreatePlaylistRequest): SpotifyApiResponse<SimplifiedPlaylistObject>
Creates a Spotify playlist for the current user.
Link copied to clipboard
suspend fun getCategorysPlaylists(categoryId: String, pagingOptions: PagingOptions = PagingOptions(), country: CountryCode? = null): SpotifyApiResponse<CategorysPlaylists>
Gets playlists for a Spotify browse category.
Link copied to clipboard
suspend fun getCurrentUsersPlaylists(pagingOptions: PagingOptions = PagingOptions()): SpotifyApiResponse<CurrentUsersPlaylists>
Gets playlists owned or followed by the current user.
Link copied to clipboard
suspend fun getFeaturedPlaylists(locale: String? = null, timestamp: String? = null, pagingOptions: PagingOptions = PagingOptions(), country: CountryCode? = null): SpotifyApiResponse<FeaturedPlaylists>
Gets Spotify featured playlists.
Link copied to clipboard
suspend fun getPlaylist(playlistId: String, market: CountryCode? = null, fields: String? = null, additionalTypes: List<String> = listOf("track", "episode")): SpotifyApiResponse<Playlist>
Gets a Spotify playlist by playlist ID.
Link copied to clipboard
Gets custom cover images for a Spotify playlist.
Link copied to clipboard
suspend fun getPlaylistItems(playlistId: String, market: CountryCode? = null, pagingOptions: PagingOptions = PagingOptions(), fields: String? = null, additionalTypes: List<String> = listOf("track", "episode")): SpotifyApiResponse<PlaylistItem>
Gets items in a Spotify playlist.
Link copied to clipboard
suspend fun getUsersPlaylists(userId: String, pagingOptions: PagingOptions = PagingOptions()): SpotifyApiResponse<UsersPlaylist>
Gets public playlists for a Spotify user.
Link copied to clipboard
suspend fun removePlaylistItems(playlistId: String, body: RemovePlaylistItemsRequest): SpotifyApiResponse<SnapshotIdResponse>
Removes items from a Spotify playlist.
Link copied to clipboard
suspend fun updatePlaylistItems(playlistId: String, body: UpdatePlaylistItemsRequest? = null, uris: List<String>? = null): SpotifyApiResponse<SnapshotIdResponse>
Reorders or replaces items in a Spotify playlist.