Skip to content

Service Albums

Kiril Kirkov edited this page Jan 14, 2020 · 2 revisions

Make Instance

$spotifyWebApi = new SpotifyWebApi([
        'clientId' => 'SPOTIFY_CLIENT_ID',
        'clientSecret' => 'SPOTIFY_CLIENT_SECRET',
        'accessToken' => 'ACCESS_TOKEN',
        'refreshToken' => 'SPOTIFY_API_REFRESH_TOKEN',
]);

Do requests

Get an Album

equal to - https://developer.spotify.com/documentation/web-api/reference/albums/get-album/

$response = $spotifyWebApi->api()->provider(
        \SpotifyWebAPI\SpotifyServices::albums()::getAlbum(ALBUM_ID)
)->getResult();

Get an Album's Tracks

equal to - https://developer.spotify.com/documentation/web-api/reference/albums/get-albums-tracks/

$response = $spotifyWebApi->api()->provider(
        \SpotifyWebAPI\SpotifyServices::albums()::getTracks(ALBUM_ID)
)->getResult();

Get several Albums

equal to - https://developer.spotify.com/documentation/web-api/reference/albums/get-several-albums/

$response = $spotifyWebApi->api()->provider(
        \SpotifyWebAPI\SpotifyServices::albums()::getAlbums([ALBUM_1, ALBUM_2, ALBUM_3])
)->getResult();