Class CreatePlaylistRequest


  • public class CreatePlaylistRequest
    extends Object
    Create a Playlist request

    Required OAuth scopes

    playlist-modify-public, playlist-modify-private

    Response

    On success, the response body contains the created playlist object in JSON format and the HTTP status code in the response header is 200 OK or 201 Created. There is also a Location response header giving the Web API endpoint for the new playlist.

    On error, the header status code is an error code and the response body contains an error object. Trying to create a playlist when you do not have the user's authorization returns error 403 Forbidden.

    • Constructor Detail

      • CreatePlaylistRequest

        public CreatePlaylistRequest​(ApiClient apiClient,
                                     String userId,
                                     String name)

        Create a Playlist request

        Parameters:
        apiClient -

        The API client

        userId -

        The user's Spotify user ID.

        name -

        The name for the new playlist, for example "Your Coolest Playlist" . This name does not need to be unique; a user may have several playlists with the same name.

    • Method Detail

      • _public

        public CreatePlaylistRequest _public​(boolean _public)

        Defaults to true . If true the playlist will be public, if false it will be private. To be able to create private playlists, the user must have granted the playlist-modify-private scope

      • collaborative

        public CreatePlaylistRequest collaborative​(boolean collaborative)

        Defaults to false . If true the playlist will be collaborative. Note that to create a collaborative playlist you must also set public to false . To create collaborative playlists you must have granted playlist-modify-private and playlist-modify-public scopes .

      • description

        public CreatePlaylistRequest description​(String description)

        value for playlist description as displayed in Spotify Clients and in the Web API.

      • build

        public ApiCall<Playlist> build()
        Build the request into an executable call