php-google-spreadsheet-client icon indicating copy to clipboard operation
php-google-spreadsheet-client copied to clipboard

getListFeed with filter

Open TomOA opened this issue 7 years ago • 1 comments

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,

TomOA avatar Jun 19 '17 08:06 TomOA

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"]);

asimlqt avatar Jun 26 '17 07:06 asimlqt