SpotifyWebAPI\SpotifyWebAPI::getUserPlaylist PHP Метод

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().
    public function getUserPlaylist($userId, $playlistId, $options = [])
    {
        $options = (array) $options;
        if (isset($options['fields'])) {
            $options['fields'] = implode(',', (array) $options['fields']);
        }
        $headers = $this->authHeaders();
        $uri = '/v1/users/' . $userId . '/playlists/' . $playlistId;
        $this->lastResponse = $this->request->api('GET', $uri, $options, $headers);
        return $this->lastResponse['body'];
    }