PHP Класс SpotifyWebAPI\SpotifyWebAPI

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$accessToken
$lastResponse
$request

Открытые методы

Метод Описание
__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.

Защищенные методы

Метод Описание
authHeaders ( ) : array Add authorization headers.
idToUri ( array | string $ids ) : array | string Convert Spotify object IDs to Spotify URIs.

Описание методов

__construct() публичный Метод

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

addMyAlbums() публичный Метод

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.
Результат boolean Whether the albums was successfully added.

addMyTracks() публичный Метод

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.
Результат boolean Whether the tracks was successfully added.

addUserPlaylistTracks() публичный Метод

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.
Результат boolean Whether the tracks was successfully added.

authHeaders() защищенный Метод

Add authorization headers.
protected authHeaders ( ) : array
Результат array Authorization headers.

createUserPlaylist() публичный Метод

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.
Результат array | object The new playlist. Type is controlled by SpotifyWebAPI::setReturnAssoc().

currentUserFollows() публичный Метод

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.
Результат array Whether each user or artist is followed.

deleteMyAlbums() публичный Метод

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.
Результат boolean Whether the albums was successfully deleted.

deleteMyTracks() публичный Метод

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.
Результат boolean Whether the tracks was successfully deleted.

deleteUserPlaylistTracks() публичный Метод

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.
Результат string | boolean A new snapshot ID or false if the tracks weren't successfully deleted.

followArtistsOrUsers() публичный Метод

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.
Результат boolean Whether the artist or user was successfully followed.

followPlaylist() публичный Метод

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.
Результат boolean Whether the playlist was successfully followed.

getAlbum() публичный Метод

https://developer.spotify.com/web-api/get-album/
public getAlbum ( string $albumId ) : array | object
$albumId string ID of the album.
Результат array | object The requested album. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getAlbumTracks() публичный Метод

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.
Результат array | object The requested album tracks. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getAlbums() публичный Метод

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.
Результат array | object The requested albums. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getArtist() публичный Метод

https://developer.spotify.com/web-api/get-artist/
public getArtist ( string $artistId ) : array | object
$artistId string ID of the artist.
Результат array | object The requested artist. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getArtistAlbums() публичный Метод

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.
Результат array | object The artist's albums. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getArtistRelatedArtists() публичный Метод

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

getArtistTopTracks() публичный Метод

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.
Результат array | object The artist's top tracks. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getArtists() публичный Метод

https://developer.spotify.com/web-api/get-several-artists/
public getArtists ( array $artistIds ) : array | object
$artistIds array IDs of the artists.
Результат array | object The requested artists. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getAudioFeatures() публичный Метод

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.
Результат array | object The tracks' audio features. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getCategoriesList() публичный Метод

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.
Результат array | object The list of categories. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getCategory() публичный Метод

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.
Результат array | object The category. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getCategoryPlaylists() публичный Метод

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.
Результат array | object The list of playlists. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getFeaturedPlaylists() публичный Метод

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.
Результат array | object The featured playlists. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getGenreSeeds() публичный Метод

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

getLastResponse() публичный Метод

Get the latest full response from the Spotify API.
public getLastResponse ( ) : array
Результат 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() публичный Метод

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.
Результат array | object The user's playlists. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getMySavedAlbums() публичный Метод

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.
Результат array | object The user's saved albums. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getMySavedTracks() публичный Метод

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.
Результат array | object The user's saved tracks. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getMyTop() публичный Метод

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.
Результат array | object A list with the requested top entity. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getNewReleases() публичный Метод

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.
Результат array | object The new releases. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getRecommendations() публичный Метод

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.
Результат array | object The requested recommendations. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getReturnAssoc() публичный Метод

Get the return type for the Request body element.
public getReturnAssoc ( ) : boolean
Результат boolean Whether an associative array or an stdClass is returned.

getTrack() публичный Метод

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.
Результат array | object The requested track. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getTracks() публичный Метод

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.
Результат array | object The requested tracks. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getUser() публичный Метод

https://developer.spotify.com/web-api/get-users-profile/
public getUser ( string $userId ) : array | object
$userId string ID of the user.
Результат array | object The requested user. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getUserFollowedArtists() публичный Метод

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.
Результат array | object A list of artists. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getUserPlaylist() публичный Метод

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.
Результат array | object The user's playlist. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getUserPlaylistTracks() публичный Метод

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.
Результат array | object The tracks in the playlist. Type is controlled by SpotifyWebAPI::setReturnAssoc().

getUserPlaylists() публичный Метод

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.
Результат array | object The user's playlists. Type is controlled by SpotifyWebAPI::setReturnAssoc().

idToUri() защищенный Метод

Convert Spotify object IDs to Spotify URIs.
protected idToUri ( array | string $ids ) : array | string
$ids array | string ID(s) to convert.
Результат array | string Spotify URI(s).

me() публичный Метод

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

myAlbumsContains() публичный Метод

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.
Результат array Whether each album is saved.

myTracksContains() публичный Метод

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.
Результат array Whether each track is saved.

reorderUserPlaylistTracks() публичный Метод

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.
Результат string | boolean A new snapshot ID or false if the tracks weren't successfully reordered.

replaceUserPlaylistTracks() публичный Метод

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.
Результат boolean Whether the tracks was successfully replaced.

setAccessToken() публичный Метод

Set the access token to use.
public setAccessToken ( string $accessToken ) : void
$accessToken string The access token.
Результат void

setReturnAssoc() публичный Метод

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.
Результат void

unfollowArtistsOrUsers() публичный Метод

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.
Результат boolean Whether the artist(s) or user(s) were successfully unfollowed.

unfollowPlaylist() публичный Метод

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
Результат boolean Whether the playlist was successfully unfollowed.

updateUserPlaylist() публичный Метод

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.
Результат boolean Whether the playlist was successfully updated.

userFollowsPlaylist() публичный Метод

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.
Результат array Whether each user is following the playlist.

Описание свойств

$accessToken защищенное свойство

protected $accessToken

$lastResponse защищенное свойство

protected $lastResponse

$request защищенное свойство

protected $request