PHP Class SpotifyWebAPI\SpotifyWebAPI

Exibir arquivo Open project: jwilsson/spotify-web-api-php Class Usage Examples

Protected Properties

Property Type Description
$accessToken
$lastResponse
$request

Public Methods

Method Description
__construct ( Request $request = null ) Constructor Set up Request object.
addMyAlbums ( string | array $albums ) : boolean Add albums to the current user's Spotify library.
addMyTracks ( string | array $tracks ) : boolean Add tracks to the current user's Spotify library.
addUserPlaylistTracks ( string $userId, string $playlistId, string | array $tracks, array | object $options = [] ) : boolean Add tracks to a user's playlist.
createUserPlaylist ( string $userId, array | object $options ) : array | object Create a new playlist for a user.
currentUserFollows ( string $type, string | array $ids ) : array Check to see if the current user is following one or more artists or other Spotify users.
deleteMyAlbums ( string | array $albums ) : boolean Delete albums from current user's Spotify library.
deleteMyTracks ( string | array $tracks ) : boolean Delete tracks from current user's Spotify library.
deleteUserPlaylistTracks ( string $userId, string $playlistId, array $tracks, string $snapshotId = '' ) : string | boolean Delete tracks from a playlist and retrieve a new snapshot ID.
followArtistsOrUsers ( string $type, string | array $ids ) : boolean Add the current user as a follower of one or more artists or other Spotify users.
followPlaylist ( string $userId, string $playlistId, array | object $options = [] ) : boolean Add the current user as a follower of a playlist.
getAlbum ( string $albumId ) : array | object Get a album.
getAlbumTracks ( string $albumId, array | object $options = [] ) : array | object Get a album's tracks.
getAlbums ( array $albumIds, array | object $options = [] ) : array | object Get multiple albums.
getArtist ( string $artistId ) : array | object Get an artist.
getArtistAlbums ( string $artistId, array | object $options = [] ) : array | object Get an artist's albums.
getArtistRelatedArtists ( string $artistId ) : array | object Get an artist's related artists.
getArtistTopTracks ( string $artistId, array | object $options ) : array | object Get an artist's top tracks in a country.
getArtists ( array $artistIds ) : array | object Get multiple artists.
getAudioFeatures ( array $trackIds ) : array | object Get track audio features.
getCategoriesList ( array | object $options = [] ) : array | object Get a list of categories used to tag items in Spotify (on, for example, the Spotify player’s "Browse" tab).
getCategory ( string $categoryId, array | object $options = [] ) : array | object Get a single category used to tag items in Spotify (on, for example, the Spotify player’s "Browse" tab).
getCategoryPlaylists ( string $categoryId, array | object $options = [] ) : array | object Get a list of Spotify playlists tagged with a particular category.
getFeaturedPlaylists ( array | object $options = [] ) : array | object Get Spotify featured playlists.
getGenreSeeds ( ) : array | object Get a list of possible seed genres.
getLastResponse ( ) : array Get the latest full response from the Spotify API.
getMyPlaylists ( array | object $options = [] ) : array | object Get the current user’s playlists.
getMySavedAlbums ( array | object $options = [] ) : array | object Get the current user’s saved albums.
getMySavedTracks ( array | object $options = [] ) : array | object Get the current user’s saved tracks.
getMyTop ( string $type, $options = [] ) : array | object Get the current user's top tracks or artists.
getNewReleases ( array | object $options = [] ) : array | object Get new releases.
getRecommendations ( array | object $options = [] ) : array | object Get recommendations based on artists, tracks, or genres.
getReturnAssoc ( ) : boolean Get the return type for the Request body element.
getTrack ( string $trackId, array | object $options = [] ) : array | object Get a track.
getTracks ( array $trackIds, array | object $options = [] ) : array | object Get multiple tracks.
getUser ( string $userId ) : array | object Get a user.
getUserFollowedArtists ( array | object $options = [] ) : array | object Get the artists followed by the current user.
getUserPlaylist ( string $userId, string $playlistId, array | object $options = [] ) : array | object Get a user's specific playlist.
getUserPlaylistTracks ( string $userId, string $playlistId, array | object $options = [] ) : array | object Get the tracks in a user's playlist.
getUserPlaylists ( string $userId, array | object $options = [] ) : array | object Get a user's playlists.
me ( ) : array | object Get the currently authenticated user.
myAlbumsContains ( string | array $albums ) : array Check if albums are saved in the current user's Spotify library.
myTracksContains ( string | array $tracks ) : array Check if tracks are saved in the current user's Spotify library.
reorderUserPlaylistTracks ( string $userId, string $playlistId, array | object $options ) : string | boolean Reorder the tracks in a user's playlist.
replaceUserPlaylistTracks ( string $userId, string $playlistId, string | array $tracks ) : boolean Replace all tracks in a user's playlist with new ones.
search ( string $query, string | array $type, array | object $options = [] ) : array | object Search for an item.
setAccessToken ( string $accessToken ) : void Set the access token to use.
setReturnAssoc ( boolean $returnAssoc ) : void Set the return type for the Request body element.
unfollowArtistsOrUsers ( string $type, string | array $ids ) : boolean Remove the current user as a follower of one or more artists or other Spotify users.
unfollowPlaylist ( string $userId, string $playlistId ) : boolean Remove the current user as a follower of a playlist.
updateUserPlaylist ( string $userId, string $playlistId, array | object $options ) : boolean Update the details of a user's playlist.
userFollowsPlaylist ( string $ownerId, string $playlistId, array | object $options ) : array Check if a user is following a playlist.

Protected Methods

Method Description
authHeaders ( ) : array Add authorization headers.
idToUri ( array | string $ids ) : array | string Convert Spotify object IDs to Spotify URIs.

Method Details

__construct() public method

Constructor Set up Request object.
public __construct ( Request $request = null )
$request Request Optional. The Request object to use.

addMyAlbums() public method

Requires a valid access token. https://developer.spotify.com/web-api/save-albums-user/
public addMyAlbums ( string | array $albums ) : boolean
$albums string | array ID(s) of the album(s) to add.
return boolean Whether the albums was successfully added.

addMyTracks() public method

Requires a valid access token. https://developer.spotify.com/web-api/save-tracks-user/
public addMyTracks ( string | array $tracks ) : boolean
$tracks string | array ID(s) of the track(s) to add.
return boolean Whether the tracks was successfully added.

addUserPlaylistTracks() public method

Requires a valid access token. https://developer.spotify.com/web-api/add-tracks-to-playlist/
public addUserPlaylistTracks ( string $userId, string $playlistId, string | array $tracks, array | object $options = [] ) : boolean
$userId string ID of the user who owns the playlist.
$playlistId string ID of the playlist to add tracks to.
$tracks string | array ID(s) of the track(s) to add.
$options array | object Optional. Options for the new tracks. - int position Optional. Zero-based track position in playlist. Tracks will be appened if omitted or false.
return boolean Whether the tracks was successfully added.

authHeaders() protected method

Add authorization headers.
protected authHeaders ( ) : array
return array Authorization headers.

createUserPlaylist() public method

Requires a valid access token. https://developer.spotify.com/web-api/create-playlist/
public createUserPlaylist ( string $userId, array | object $options ) : array | object
$userId string ID of the user to create the playlist for.
$options array | object Options for the new playlist. - name string Required. Name of the playlist. - public bool Optional. Whether the playlist should be public or not.
return array | object The new playlist. Type is controlled by SpotifyWebAPI::setReturnAssoc().

currentUserFollows() public method

Requires a valid access token. https://developer.spotify.com/web-api/check-current-user-follows/
public currentUserFollows ( string $type, string | array $ids ) : array
$type string The type to check: either 'artist' or 'user'.
$ids string | array ID(s) of the user(s) or artist(s) to check for.
return array Whether each user or artist is followed.

deleteMyAlbums() public method

Requires a valid access token. https://developer.spotify.com/web-api/remove-albums-user/
public deleteMyAlbums ( string | array $albums ) : boolean
$albums string | array ID(s) of the album(s) to delete.
return boolean Whether the albums was successfully deleted.

deleteMyTracks() public method

Requires a valid access token. https://developer.spotify.com/web-api/remove-tracks-user/
public deleteMyTracks ( string | array $tracks ) : boolean
$tracks string | array ID(s) of the track(s) to delete.
return boolean Whether the tracks was successfully deleted.

deleteUserPlaylistTracks() public method

Requires a valid access token. https://developer.spotify.com/web-api/remove-tracks-playlist/
public deleteUserPlaylistTracks ( string $userId, string $playlistId, array $tracks, string $snapshotId = '' ) : string | boolean
$userId string ID of the user who owns the playlist.
$playlistId string ID of the playlist to delete tracks from.
$tracks array Array of arrays with tracks to delete. - id string Required. Spotify track ID. - positions int|array Optional. The track's position(s) in the playlist.
$snapshotId string Optional. The playlist's snapshot ID.
return string | boolean A new snapshot ID or false if the tracks weren't successfully deleted.

followArtistsOrUsers() public method

Requires a valid access token. https://developer.spotify.com/web-api/follow-artists-users/
public followArtistsOrUsers ( string $type, string | array $ids ) : boolean
$type string The type to check: either 'artist' or 'user'.
$ids string | array ID(s) of the user(s) or artist(s) to follow.
return boolean Whether the artist or user was successfully followed.

followPlaylist() public method

Requires a valid access token. https://developer.spotify.com/web-api/follow-playlist/
public followPlaylist ( string $userId, string $playlistId, array | object $options = [] ) : boolean
$userId string ID of the user who owns the playlist.
$playlistId string ID of the playlist to follow.
$options array | object Optional. Options for the followed playlist. - public bool Optional. Whether the playlist should be followed publicly or not.
return boolean Whether the playlist was successfully followed.

getAlbum() public method

https://developer.spotify.com/web-api/get-album/
public getAlbum ( string $albumId ) : array | object
$albumId string ID of the album.
return array | object The requested album. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getAlbumTracks() public method

https://developer.spotify.com/web-api/get-albums-tracks/
public getAlbumTracks ( string $albumId, array | object $options = [] ) : array | object
$albumId string ID of the album.
$options array | object Optional. Options for the tracks. - int limit Optional. Limit the number of tracks. - int offset Optional. Number of tracks to skip. - string market Optional. An ISO 3166-1 alpha-2 country code, provide this if you wish to apply Track Relinking.
return array | object The requested album tracks. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getAlbums() public method

https://developer.spotify.com/web-api/get-several-albums/
public getAlbums ( array $albumIds, array | object $options = [] ) : array | object
$albumIds array IDs of the albums.
$options array | object Optional. Options for the albums. - string market Optional. An ISO 3166-1 alpha-2 country code, provide this if you wish to apply Track Relinking.
return array | object The requested albums. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getArtist() public method

https://developer.spotify.com/web-api/get-artist/
public getArtist ( string $artistId ) : array | object
$artistId string ID of the artist.
return array | object The requested artist. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getArtistAlbums() public method

https://developer.spotify.com/web-api/get-artists-albums/
public getArtistAlbums ( string $artistId, array | object $options = [] ) : array | object
$artistId string ID of the artist.
$options array | object Optional. Options for the albums. - string|array album_type Optional. Album type(s) to return. If omitted, all album types will be returned. - string market Optional. Limit the results to items that are playable in this market, for example SE. - int limit Optional. Limit the number of albums. - int offset Optional. Number of albums to skip.
return array | object The artist's albums. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getArtistRelatedArtists() public method

https://developer.spotify.com/web-api/get-related-artists/
public getArtistRelatedArtists ( string $artistId ) : array | object
$artistId string ID of the artist.
return array | object The artist's related artists. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getArtistTopTracks() public method

https://developer.spotify.com/web-api/get-artists-top-tracks/
public getArtistTopTracks ( string $artistId, array | object $options ) : array | object
$artistId string ID of the artist.
$options array | object Options for the tracks. - string $country Required. An ISO 3166-1 alpha-2 country code specifying the country to get the top tracks for.
return array | object The artist's top tracks. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getArtists() public method

https://developer.spotify.com/web-api/get-several-artists/
public getArtists ( array $artistIds ) : array | object
$artistIds array IDs of the artists.
return array | object The requested artists. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getAudioFeatures() public method

Requires a valid access token. https://developer.spotify.com/web-api/get-several-audio-features/
public getAudioFeatures ( array $trackIds ) : array | object
$trackIds array IDs of the tracks.
return array | object The tracks' audio features. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getCategoriesList() public method

Requires a valid access token. https://developer.spotify.com/web-api/get-list-categories/
public getCategoriesList ( array | object $options = [] ) : array | object
$options array | object Optional. Options for the categories. - string locale Optional. Language to show categories in, for example sv_SE. - string country Optional. An ISO 3166-1 alpha-2 country code. Show categories from this country. - int limit Optional. Limit the number of categories. - int offset Optional. Number of categories to skip.
return array | object The list of categories. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getCategory() public method

Requires a valid access token. https://developer.spotify.com/web-api/get-category/
public getCategory ( string $categoryId, array | object $options = [] ) : array | object
$categoryId string The Spotify ID of the category.
$options array | object Optional. Options for the category. - string locale Optional. Language to show category in, for example sv_SE. - string country Optional. An ISO 3166-1 alpha-2 country code. Show category from this country.
return array | object The category. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getCategoryPlaylists() public method

Requires a valid access token. https://developer.spotify.com/web-api/get-categorys-playlists/
public getCategoryPlaylists ( string $categoryId, array | object $options = [] ) : array | object
$categoryId string The Spotify ID of the category.
$options array | object Optional. Options for the category's playlists. - string country Optional. An ISO 3166-1 alpha-2 country code. Show category playlists from this country. - int limit Optional. Limit the number of playlists. - int offset Optional. Number of playlists to skip.
return array | object The list of playlists. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getFeaturedPlaylists() public method

Requires a valid access token. https://developer.spotify.com/web-api/get-list-featured-playlists/
public getFeaturedPlaylists ( array | object $options = [] ) : array | object
$options array | object Optional. Options for the playlists. - string locale Optional. Language to show playlists in, for example sv_SE. - string country Optional. An ISO 3166-1 alpha-2 country code. Show playlists from this country. - string timestamp Optional. A ISO 8601 timestamp. Show playlists relevant to this date and time. - int limit Optional. Limit the number of playlists. - int offset Optional. Number of playlists to skip.
return array | object The featured playlists. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getGenreSeeds() public method

Requires a valid access token. https://developer.spotify.com/web-api/get-recommendations/#available-genre-seeds
public getGenreSeeds ( ) : array | object
return array | object All possible seed genres. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getLastResponse() public method

Get the latest full response from the Spotify API.
public getLastResponse ( ) : array
return array Response data. - array|object body The response body. Type is controlled by Request::setReturnAssoc(). - string headers Response headers. - int status HTTP status code.

getMyPlaylists() public method

Requires a valid access token. https://developer.spotify.com/web-api/get-a-list-of-current-users-playlists/
public getMyPlaylists ( array | object $options = [] ) : array | object
$options array | object Optional. Options for the playlists. - int limit Optional. Limit the number of playlists. - int offset Optional. Number of playlists to skip.
return array | object The user's playlists. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getMySavedAlbums() public method

Requires a valid access token. https://developer.spotify.com/web-api/get-users-saved-albums/
public getMySavedAlbums ( array | object $options = [] ) : array | object
$options array | object Optional. Options for the albums. - int limit Optional. Limit the number of albums. - int offset Optional. Number of albums to skip. - string market Optional. An ISO 3166-1 alpha-2 country code, provide this if you wish to apply Track Relinking.
return array | object The user's saved albums. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getMySavedTracks() public method

Requires a valid access token. https://developer.spotify.com/web-api/get-users-saved-tracks/
public getMySavedTracks ( array | object $options = [] ) : array | object
$options array | object Optional. Options for the tracks. - int limit Optional. Limit the number of tracks. - int offset Optional. Number of tracks to skip. - string market Optional. An ISO 3166-1 alpha-2 country code, provide this if you wish to apply Track Relinking.
return array | object The user's saved tracks. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getMyTop() public method

Requires a valid access token. https://developer.spotify.com/web-api/get-users-top-artists-and-tracks/
public getMyTop ( string $type, $options = [] ) : array | object
$type string The type of entity to fetch.
return array | object A list with the requested top entity. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getNewReleases() public method

Requires a valid access token. https://developer.spotify.com/web-api/get-list-new-releases/
public getNewReleases ( array | object $options = [] ) : array | object
$options array | object Optional. Options for the items. - string country Optional. An ISO 3166-1 alpha-2 country code. Show items relevant to this country. - int limit Optional. Limit the number of items. - int offset Optional. Number of items to skip.
return array | object The new releases. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getRecommendations() public method

Requires a valid access token. https://developer.spotify.com/web-api/get-recommendations/
public getRecommendations ( array | object $options = [] ) : array | object
$options array | object Optional. Options for the recommendations. - int limit Optional. Limit the number of recommendations. - string market Optional. An ISO 3166-1 alpha-2 country code, provide this if you wish to apply Track Relinking. - mixed max_* Optional. Max value for one of the tunable track attributes. - mixed min_* Optional. Min value for one of the tunable track attributes. - array seed_artists Artist IDs to seed by. - array seed_genres Genres to seed by. Call SpotifyWebAPI::getGenreSeeds() for a complete list. - array seed_tracks Track IDs to seed by. - mixed target_* Optional. Target value for one of the tunable track attributes.
return array | object The requested recommendations. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getReturnAssoc() public method

Get the return type for the Request body element.
public getReturnAssoc ( ) : boolean
return boolean Whether an associative array or an stdClass is returned.

getTrack() public method

https://developer.spotify.com/web-api/get-track/
public getTrack ( string $trackId, array | object $options = [] ) : array | object
$trackId string ID of the track.
$options array | object Optional. Options for the track. - string market Optional. An ISO 3166-1 alpha-2 country code, provide this if you wish to apply Track Relinking.
return array | object The requested track. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getTracks() public method

https://developer.spotify.com/web-api/get-several-tracks/
public getTracks ( array $trackIds, array | object $options = [] ) : array | object
$trackIds array IDs of the tracks.
$options array | object Optional. Options for the albums. - string market Optional. An ISO 3166-1 alpha-2 country code, provide this if you wish to apply Track Relinking.
return array | object The requested tracks. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getUser() public method

https://developer.spotify.com/web-api/get-users-profile/
public getUser ( string $userId ) : array | object
$userId string ID of the user.
return array | object The requested user. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getUserFollowedArtists() public method

Requires a valid access token. https://developer.spotify.com/web-api/get-followed-artists/
public getUserFollowedArtists ( array | object $options = [] ) : array | object
$options array | object Optional. Options for the artists. - int limit Optional. Limit the number of artists returned. - string after Optional. The last artist ID retrieved from the previous request.
return array | object A list of artists. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getUserPlaylist() public method

Requires a valid access token. https://developer.spotify.com/web-api/get-playlist/
public getUserPlaylist ( string $userId, string $playlistId, array | object $options = [] ) : array | object
$userId string ID of the user.
$playlistId string ID of the playlist.
$options array | object Optional. Options for the playlist. - string|array fields Optional. A list of fields to return. See Spotify docs for more info. - string market Optional. An ISO 3166-1 alpha-2 country code, provide this if you wish to apply Track Relinking.
return array | object The user's playlist. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getUserPlaylistTracks() public method

Requires a valid access token. https://developer.spotify.com/web-api/get-playlists-tracks/
public getUserPlaylistTracks ( string $userId, string $playlistId, array | object $options = [] ) : array | object
$userId string ID of the user.
$playlistId string ID of the playlist.
$options array | object Optional. Options for the tracks. - string|array fields Optional. A list of fields to return. See Spotify docs for more info. - int limit Optional. Limit the number of tracks. - int offset Optional. Number of tracks to skip. - string market Optional. An ISO 3166-1 alpha-2 country code, provide this if you wish to apply Track Relinking.
return array | object The tracks in the playlist. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getUserPlaylists() public method

Requires a valid access token. https://developer.spotify.com/web-api/get-list-users-playlists/
public getUserPlaylists ( string $userId, array | object $options = [] ) : array | object
$userId string ID of the user.
$options array | object Optional. Options for the tracks. - int limit Optional. Limit the number of tracks. - int offset Optional. Number of tracks to skip.
return array | object The user's playlists. Type is controlled by SpotifyWebAPI::setReturnAssoc().

idToUri() protected method

Convert Spotify object IDs to Spotify URIs.
protected idToUri ( array | string $ids ) : array | string
$ids array | string ID(s) to convert.
return array | string Spotify URI(s).

me() public method

Requires a valid access token. https://developer.spotify.com/web-api/get-current-users-profile/
public me ( ) : array | object
return array | object The currently authenticated user. Type is controlled by SpotifyWebAPI::setReturnAssoc().

myAlbumsContains() public method

Requires a valid access token. https://developer.spotify.com/web-api/check-users-saved-albums/
public myAlbumsContains ( string | array $albums ) : array
$albums string | array ID(s) of the album(s) to check for.
return array Whether each album is saved.

myTracksContains() public method

Requires a valid access token. https://developer.spotify.com/web-api/check-users-saved-tracks/
public myTracksContains ( string | array $tracks ) : array
$tracks string | array ID(s) of the track(s) to check for.
return array Whether each track is saved.

reorderUserPlaylistTracks() public method

Requires a valid access token. https://developer.spotify.com/web-api/reorder-playlists-tracks/
public reorderUserPlaylistTracks ( string $userId, string $playlistId, array | object $options ) : string | boolean
$userId string ID of the user.
$playlistId string ID of the playlist.
$options array | object Options for the new . - int range_start Required. Position of the first track to be reordered. - int range_length Optional. The amount of tracks to be reordered. - int insert_before Required. Position where the tracks should be inserted. - string snapshot_id Optional. The playlist's snapshot ID.
return string | boolean A new snapshot ID or false if the tracks weren't successfully reordered.

replaceUserPlaylistTracks() public method

Requires a valid access token. https://developer.spotify.com/web-api/replace-playlists-tracks/
public replaceUserPlaylistTracks ( string $userId, string $playlistId, string | array $tracks ) : boolean
$userId string ID of the user.
$playlistId string ID of the playlist.
$tracks string | array ID(s) of the track(s) to add.
return boolean Whether the tracks was successfully replaced.

setAccessToken() public method

Set the access token to use.
public setAccessToken ( string $accessToken ) : void
$accessToken string The access token.
return void

setReturnAssoc() public method

Set the return type for the Request body element.
public setReturnAssoc ( boolean $returnAssoc ) : void
$returnAssoc boolean Whether to return an associative array or an stdClass.
return void

unfollowArtistsOrUsers() public method

Requires a valid access token. https://developer.spotify.com/web-api/unfollow-artists-users/
public unfollowArtistsOrUsers ( string $type, string | array $ids ) : boolean
$type string The type to check: either 'artist' or 'user'.
$ids string | array ID(s) of the user(s) or artist(s) to unfollow.
return boolean Whether the artist(s) or user(s) were successfully unfollowed.

unfollowPlaylist() public method

Requires a valid access token. https://developer.spotify.com/web-api/unfollow-playlist/
public unfollowPlaylist ( string $userId, string $playlistId ) : boolean
$userId string ID of the user who owns the playlist.
$playlistId string ID of the playlist to unfollow
return boolean Whether the playlist was successfully unfollowed.

updateUserPlaylist() public method

Requires a valid access token. https://developer.spotify.com/web-api/change-playlist-details/
public updateUserPlaylist ( string $userId, string $playlistId, array | object $options ) : boolean
$userId string ID of the user who owns the playlist.
$playlistId string ID of the playlist to update.
$options array | object Options for the playlist. - name string Optional. Name of the playlist. - public bool Optional. Whether the playlist should be public or not.
return boolean Whether the playlist was successfully updated.

userFollowsPlaylist() public method

Requires a valid access token. https://developer.spotify.com/web-api/check-user-following-playlist/
public userFollowsPlaylist ( string $ownerId, string $playlistId, array | object $options ) : array
$ownerId string User ID of the playlist owner.
$playlistId string ID of the playlist.
$options array | object Options for the check. - ids string|array Required. ID(s) of the user(s) to check for.
return array Whether each user is following the playlist.

Property Details

$accessToken protected_oe property

protected $accessToken

$lastResponse protected_oe property

protected $lastResponse

$request protected_oe property

protected $request