asimlqt / php-google-spreadsheet-client

A PHP library for accessing and manipulating Google Spreadsheets
Other
543 stars 154 forks source link

Uncaught exception #164

Open av2222 opened 7 years ago

av2222 commented 7 years ago

$spreadsheetService = new Google\Spreadsheet\SpreadsheetService(); $spreadsheetFeed = $spreadsheetService->getSpreadsheetFeed(); $spreadsheet = $spreadsheetFeed->getByTitle('test');

Fatal error: Uncaught exception 'Google\Spreadsheet\Exception\SpreadsheetNotFoundException' in C:\OpenServer\domains\GoogleDocs\vendor\asimlqt\php-google-spreadsheet-client\src\Google\Spreadsheet\SpreadsheetFeed.php:100 Stack trace: #0 C:\OpenServer\domains\GoogleDocs\index.php(39): Google\Spreadsheet\SpreadsheetFeed->getByTitle('test') #1 {main} thrown in C:\OpenServer\domains\GoogleDocs\vendor\asimlqt\php-google-spreadsheet-client\src\Google\Spreadsheet\SpreadsheetFeed.php on line 100

ghost commented 7 years ago

you need share 'test' Spreadsheet file to email something like @graphite-willow-146111.iam.gserviceaccount.com

rachitharoun commented 7 years ago

Thanks thanks arafatsky99

kirti275 commented 7 years ago

image

Elaborating upon arafatsky99 's answer.

Give edit permission to "client_email" field value in client_secret.json file by opening the actual spreadsheet, refer image.

legreco commented 6 years ago

thanks! very helpful

brack11 commented 5 years ago

I've got simular issue but with reading public spreadsheet code looks like: `use Google\Spreadsheet\DefaultServiceRequest; use Google\Spreadsheet\ServiceRequestFactory;

$serviceRequest = new DefaultServiceRequest(""); ServiceRequestFactory::setInstance($serviceRequest);

$spreadsheetService = new Google\Spreadsheet\SpreadsheetService(); $worksheetFeed = $spreadsheetService->getPublicSpreadsheet("1zKMY66aaev3htO5015cHp8wwxKC3J4roEGbXOKC077M"); and respond with PHP Fatal error: Uncaught Google\Spreadsheet\Exception\ResourceNotFoundException: Internal Error in /home2/swarlorg/public_html/bodybuilders/swarl_cert/vendor/asimlqt/php-google-spreadsheet-client/src/Google/Spreadsheet/SpreadsheetService.php:76 Stack trace:

0 /vendor/asimlqt/php-google-spreadsheet-client/src/Google/Spreadsheet/SpreadsheetService.php(98): Google\Spreadsheet\SpreadsheetService->getResourceById('Google\Spreadsh...', 'https://spreads...')

1 /certificate.php(14): Google\Spreadsheet\SpreadsheetService->getPublicSpreadsheet('1zKMY66aaev3htO...')

2 {main}

thrown in /vendor/asimlqt/php-google-spreadsheet-client/src/Google/Spreadsheet/SpreadsheetService.php on line 76` Two days ago everything was working, the only change was addition of around 200 records to the spreadsheet. Please help!