Home Reference Source Repository
import PlaylistHandler from 'spotify-sdk/src/handlers/PlaylistHandler.js'
public class | source

PlaylistHandler

You can directly use instance of this class. playlistHandler

Methods for retrieving information about playlists and for managing playlists.

See:

Method Summary

Public Methods
public

addTracks(tracks: array, userId: String, playlistId: String, query: Object): Promise

Add one or more tracks to a user’s playlist.

public

categoriesPlaylists(id: int, query: Object): Promise

Get a list of Spotify playlists tagged with a particular category.

public

Convert a valid object to a Playlist entity

public

create(userId: String, name: String, is_public: Bool): Promise

Create a playlist for a Spotify user.

public

edit(userId: String, playlistId: String, name: String, is_public: Bool): Promise

Change a playlist’s name and public/private state.

public

Get a list of Spotify featured playlists.

public

follow(userId: String, playlistId: String, query: Object): Promise

Add a user as a follower of a playlist.

public

removeTracks(tracks: array, userId: String, playlistId: String, query: Object): Promise

Remove one or more tracks from a user’s playlist.

public

search(name: String, query: Object): Promise

Get a collection of artists that match a keyword string.

public

unfollow(userId: String, playlistId: String, query: Object): Promise

Remove a user as a follower of a playlist.

Public Methods

public addTracks(tracks: array, userId: String, playlistId: String, query: Object): Promise source

Add one or more tracks to a user’s playlist.

Params:

NameTypeAttributeDescription
tracks array

List of uri tracks

userId String

User id

playlistId String

Playlist id

query Object
  • optional

Query parameters.

Return:

Promise

JSON response

See:

public categoriesPlaylists(id: int, query: Object): Promise source

Get a list of Spotify playlists tagged with a particular category.

Params:

NameTypeAttributeDescription
id int

Category id

query Object
  • optional

Query parameters.

Return:

Promise

playlistCollection

See:

public convert(item: Object): Object source

Convert a valid object to a Playlist entity

Params:

NameTypeAttributeDescription
item Object

Object to convert in entity

Return:

Object

public create(userId: String, name: String, is_public: Bool): Promise source

Create a playlist for a Spotify user.

Params:

NameTypeAttributeDescription
userId String

User id

name String

Name of the future playlist

is_public Bool

public or private

Return:

Promise

JSON response

See:

public edit(userId: String, playlistId: String, name: String, is_public: Bool): Promise source

Change a playlist’s name and public/private state.

Params:

NameTypeAttributeDescription
userId String

User id

playlistId String

Playlist id

name String

Name of the future playlist

is_public Bool

public or private

Return:

Promise

JSON response

See:

public featuredPlaylists(query: Object): Promise source

Get a list of Spotify featured playlists.

Params:

NameTypeAttributeDescription
query Object
  • optional

Query parameters.

Return:

Promise

playlistCollection

See:

public follow(userId: String, playlistId: String, query: Object): Promise source

Add a user as a follower of a playlist.

Params:

NameTypeAttributeDescription
userId String

User id

playlistId String

Playlist id

query Object
  • optional

Query parameters.

Return:

Promise

JSON response

See:

public removeTracks(tracks: array, userId: String, playlistId: String, query: Object): Promise source

Remove one or more tracks from a user’s playlist.

Params:

NameTypeAttributeDescription
tracks array

List of uri tracks

userId String

User id

playlistId String

Playlist id

query Object
  • optional

Query parameters.

Return:

Promise

JSON response

See:

Get a collection of artists that match a keyword string.

Params:

NameTypeAttributeDescription
name String

Name of the playlist.

query Object
  • optional

Query parameters.

Return:

Promise

playlistCollection

See:

public unfollow(userId: String, playlistId: String, query: Object): Promise source

Remove a user as a follower of a playlist.

Params:

NameTypeAttributeDescription
userId String

User id

playlistId String

Playlist id

query Object
  • optional

Query parameters.

Return:

Promise

JSON response

See: