pulkitjalan / google-apiclient

Google api php client wrapper with Cloud Platform and Laravel support
MIT License
246 stars 75 forks source link

Facade's with a Service Account #27

Open MichaelCrowcroft opened 7 years ago

MichaelCrowcroft commented 7 years ago

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";
        }
github-actions[bot] commented 6 days ago

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