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

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.
    public function followPlaylist($userId, $playlistId, $options = [])
    {
        $options = json_encode($options);
        $headers = $this->authHeaders();
        $headers['Content-Type'] = 'application/json';
        $uri = '/v1/users/' . $userId . '/playlists/' . $playlistId . '/followers';
        $this->lastResponse = $this->request->api('PUT', $uri, $options, $headers);
        return $this->lastResponse['status'] == 200;
    }