asimlqt / php-google-spreadsheet-client

A PHP library for accessing and manipulating Google Spreadsheets
Other
544 stars 152 forks source link

getListFeed with filter #177

Open TomOA opened 7 years ago

TomOA commented 7 years ago

Hi there,

I am trying to use $listFeed = $worksheet->getListFeed(["id" => "1123456"]); to filter my data to only retrieve what I need. But it returns

[Google\Spreadsheet\Exception\UnauthorizedException]
You need permission

I have no problems reading the whole document with $listFeed = $worksheet->getListFeed(); or updating the document with `$listFeed->insert(["id" => "123451"]);

The scopes I added: $client->setScopes(['https://www.googleapis.com/auth/drive', 'https://docs.google.com/feeds']);

Am I missing a scope or something else?

Br,

asimlqt commented 7 years ago

Hi,

The array you are passing is not correct. Please have a look at the documentation:

https://github.com/asimlqt/php-google-spreadsheet-client#retrieving-a-list-feed

It needs to be something like the following: $worksheet->getListFeed(["sq" => "id = 1123456"]);