google-apiclient icon indicating copy to clipboard operation
google-apiclient copied to clipboard

Facade's with a Service Account

Open MichaelCrowcroft opened this issue 8 years ago • 1 comments

I'm finding that when I use the Facades with a service account I'm getting incorrect scope errors. Basically this returns a list of books:

        $client = new \Google_Client();

        $service = new \Google_Service_Books($client);
        $optParams = array('filter' => 'free-ebooks');
        $results = $service->volumes->listVolumes('Henry David Thoreau', $optParams);

        foreach ($results as $item) {
            echo $item['volumeInfo']['title'], "<br /> \n";
        }

and this is returning an error

        $client = Google::getClient();

        $service = Google::make('books');
        $optParams = array('filter' => 'free-ebooks');
        $results = $service->volumes->listVolumes('Henry David Thoreau', $optParams);

        foreach ($results as $item) {
            echo $item['volumeInfo']['title'], "<br /> \n";
        }

MichaelCrowcroft avatar Jul 07 '17 05:07 MichaelCrowcroft

This issue is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 7 days

github-actions[bot] avatar Jul 01 '24 05:07 github-actions[bot]