google-spreadsheet-reader | Reads data from a Google Spreadsheet | Data Visualization library
kandi X-RAY | google-spreadsheet-reader Summary
kandi X-RAY | google-spreadsheet-reader Summary
This project contains a sample script that uses a service account to authenticate against Google Spreadsheets in order to read the content's of a spreadsheet.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of google-spreadsheet-reader
google-spreadsheet-reader Key Features
google-spreadsheet-reader Examples and Code Snippets
Community Discussions
Trending Discussions on google-spreadsheet-reader
QUESTION
I am trying to read a spreadsheet using a service account (I cannot use OAuth, which works, since the process will be running on a server to periodically check sheet data)
I tried several approaches. If I follow the example using oauth I can see the sheet values. However, I need the run the script without any GUI on the background.
I have found this tutorial https://github.com/juampynr/google-spreadsheet-reader I have created a projec, service account, added viewer role, shared the spreadsheet with the service account email. Generated the key. It seems that the test program can connect to the google services but the moment it request the spreadsheet the end result is "404 not found".
...ANSWER
Answered 2019-Mar-22 at 05:28- When the access token retrieved by OAuth2 is used, the Spreadsheet of
$spreadsheet_id = '1TAWybckPrnWlQxBZh0ScDsFOvftwi2dvTBNGarSdY30';
can retrieve the values. - When the access token retrieved by Service Account is used,
Error 404 (Not Found)!!1
is returned.
If my understanding is correct, please confirm the following points.
Confirmation points:- As a test run, please set the range
$spreadsheet_range = '';
.- For example, it's
$spreadsheet_range = 'Sheet1'
.
- For example, it's
- If the error message of
The caller does not have permission
is returned, please confirm as follows.- Whether the Spreadsheet of
1TAWybckPrnWlQxBZh0ScDsFOvftwi2dvTBNGarSdY30
is sharing the email of Service Account. - If you didn't share the Service Account to the Spreadsheet, please share the email of
client_email
in the file ofreadsheetmar2019-08b737d1c1cb._portfolio_test.json
to the Spreadsheet you want to access.
- Whether the Spreadsheet of
- If the error message of
Google Sheets API has not been used in project ### before or it is disabled.
is returned, please enable Sheets API.
If this was not the solution for your issue, I apologize.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install google-spreadsheet-reader
Open https://console.developers.google.com/apis/library
Enable it and create a project:
At Credentials, create a service account:
Keep defaults at the next form and click Create. Save the resulting private key file in a directory where your application can read it:
Next, click on “Manage Service accounts”:
Copy the email address of your service account:
Grant permission to the service account to the spreadsheet:
Read the contents of index.php and fill out the required variables. Then execute it with:
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page