Interface PlaylistsSpotifyService


  • public interface PlaylistsSpotifyService
    • Method Detail

      • getMyPlaylists

        @GET("me/playlists")
        retrofit2.Call<Pager<PlaylistSimple>> getMyPlaylists()
        Get a list of the playlists owned or followed by the current Spotify user.
        Returns:
        List of user's playlists wrapped in a Pager object
      • getMyPlaylists

        @GET("me/playlists")
        retrofit2.Call<Pager<PlaylistSimple>> getMyPlaylists​(@QueryMap
                                                             Map<String,​Object> options)
        Get a list of the playlists owned or followed by the current Spotify user.
        Parameters:
        options - Optional parameters. For list of supported parameters see endpoint documentation
        Returns:
        List of user's playlists wrapped in a Pager object
      • getPlaylists

        @GET("users/{id}/playlists")
        retrofit2.Call<Pager<PlaylistSimple>> getPlaylists​(@Path("id")
                                                           String userId)
        Get a list of the playlists owned or followed by a Spotify user.
        Parameters:
        userId - The user's Spotify user ID.
        Returns:
        List of user's playlists wrapped in a Pager object
        See Also:
        Get a List of a User’s Playlists
      • getPlaylist

        @GET("playlists/{playlist_id}")
        retrofit2.Call<Playlist> getPlaylist​(@Path("playlist_id")
                                             String playlistId)
        Get a playlist owned by a Spotify user.
        Parameters:
        playlistId - The Spotify ID for the playlist.
        Returns:
        Requested Playlist.
        See Also:
        Get a Playlist
      • getPlaylist

        @GET("playlists/{playlist_id}")
        retrofit2.Call<Playlist> getPlaylist​(@Path("playlist_id")
                                             String playlistId,
                                             @QueryMap
                                             Map<String,​Object> options)
        Get a playlist owned by a Spotify user.
        Parameters:
        playlistId - The Spotify ID for the playlist.
        options - Optional parameters. For list of supported parameters see endpoint documentation
        Returns:
        Requested Playlist.
        See Also:
        Get a Playlist
      • createPlaylist

        @POST("users/{user_id}/playlists")
        retrofit2.Call<Playlist> createPlaylist​(@Path("user_id")
                                                String userId,
                                                @Body
                                                Map<String,​Object> options)
        Create a playlist
        Parameters:
        userId - The playlist's owner's User ID
        options - The body parameters
        Returns:
        The created playlist
        See Also:
        Create a Playlist
      • changePlaylistDetails

        @PUT("playlists/{playlist_id}")
        retrofit2.Call<Result> changePlaylistDetails​(@Path("playlist_id")
                                                     String playlistId,
                                                     @Body
                                                     Map<String,​Object> body)
        Change a playlist’s name and public/private state. (The user must, of course, own the playlist.)
        Parameters:
        playlistId - The playlist's Id
        body - The body parameters. For list of supported parameters see endpoint documentation
        Returns:
        An empty result
        See Also:
        Change a Playlist's Details
      • getPlaylistCoverImages

        @GET("playlists/{playlist_id}/images")
        retrofit2.Call<List<Image>> getPlaylistCoverImages​(@Path("playlist_id")
                                                           String playlistId)
        Get the current image associated with a specific playlist.
        Parameters:
        playlistId - The Spotify ID for the playlist
        Returns:
        A list of image objects
        See Also:
        Get a Playlist Cover Image
      • uploadPlaylistCoverImage

        @PUT("playlists/{playlist_id}/images")
        @Headers("Content-Type: image/jpeg")
        retrofit2.Call<Result> uploadPlaylistCoverImage​(@Path("playlist_id")
                                                        String playlistId,
                                                        @Body
                                                        String base64Image)
        Replace the image used to represent a specific playlist.
        Parameters:
        playlistId - The Spotify ID for the playlist
        base64Image - Base64 encoded JPEG image data, maximum payload size is 256 KB
        Returns:
        A successful request will return a 202 ACCEPTED response code