Using Google Drive PHP API to read and write Google Doc tables - google-drive-api

I'm thinking about the followin scenario:
My PHP application push some integers into a google doc table which calculates with this and saves the result of this operations at the end of the table. my php application finally reads the result and displays it on the website.
Is this possible with the Google Drive PHP API?
I found the following:
http://code.google.com/p/google-api-php-client/
https://developers.google.com/drive/
https://developers.google.com/drive/examples/php#setting_up_this_sample_application
But I'm not sure if this would be possible at all? Are there any example applications or scripts in order to read and write google doc tables?

You can use the Spreadsheets API to programmatically read and write to a Google Spreadsheet:
https://developers.google.com/google-apps/spreadsheets/

Related

Chrome app and connecting to google doc

I want to start looking at using chrome apps as a possible IT solution. I used this tutorial to create a quick app:
https://developer.chrome.com/apps/app_codelab_basics
My next step is to connect to an external data source, where multiple users could access (read/write) to the same source. Is it possible to read/write to the following, and if so, are there any tutorials:
Google Sheet, stored on google drive
An access db saved in google drive
An Excel file saved on google drive.
Thanks
Have you, by any chance, tried using Google Apps Script for this.
Here's a simple tutorial:
https://zapier.com/blog/google-apps-script-tutorial/
Here's the complete API documentation (small examples included):
https://developers.google.com/apps-script/reference/spreadsheet/
I have configured fairly complex workflows by just using Google Apps Script with various Google Apps.

Is it possible to protect google spreadsheet data using the web api?

I would like to programmatically create google spreadsheets that have some columns marked as 'read-only'. Using the web browser client this is straight forward, but I have not found any documentation on how to do this via the API. Is it possible?
You won't be able to do this by relying on the Drive API exclusively. The good thing is, there is a Google Sheets API. This will allow you to access your Sheet file and edit its content. More information can be found on this resource: https://developers.google.com/google-apps/spreadsheets/.

How to insert data from Google spreadsheets and ScriptDBs into BigQuery tables using Google Apps Scripts

We have successfully deployed Google Apps Script based web applications to teams of users, those applications allow the users to log their daily activities via a simple GUI. The log data is collected per team using Google spreadsheets or ScriptDBs, depending on the size of the team.
We now want to go one step further and do analysis and reports on the user activity data across the teams. Given the amount of data, BigQuery looks like a good technology to do that. We are thinking about using Google Apps Scripts to push the data automatically on a regular (e.g. daily basis) to the BigQuery table(s). We are wondering what the best practices are to do that with the data originating from Google spreadsheets and ScriptDBs.
Unlike in previous cases, just from simply reading through the BigQuery API documentation and code snippets it does not become obvious to us what the recommended approach is.
The hint we found so far:
Write Data from Google Spreadsheets to a BigQuery Table
We don't have any examples for it, but you can use Apps Script's built-in BigQuery service to upload data directly.
BigQuery.Jobs.insert(resource, mediaData, optionalArgs)
The mediaData parameter was recently added, and allows you to pass in the CSV data as a blob which gets sent directly to BigQuery.

Read google spreadsheet using drive sdk

Using the new Drive SDK, I would like to read and update rows/columns in a native google spreadsheet stored on my google drive, and display them on my web page. I m using Java and App Engine. I found the documentation and DrEdit example confusing, they don't exactly explain how to read/update native google docs. Can someone please explain to me what I need to do step by step, with code examples if possible? Thank you.
The Google Spreadsheets API would be the better choice for interacting directly with row and column data.

convert csv to Google spreadsheet in a html form

I have a small html form with some options. Based on the user's selection, currently the button click will result in the downloading of a csv file with the relevant information. What I ideally like to do is to be able to generate programatically a Google Spreadsheet from that csv file when the user requests it via the form.
I couldn't find this info. Will I need Spreadsheet's APIs for this or is there a simpler way?
Many thanks!
Yes, you need to use the Google Documents List Data API. Which will require that you make and authenticated POST call to this API with the appropriate parameters (described on the link). For Java and .NET Google developed some libraries that makes this job much easier, but you can call the API from any app/lang, just take a look at the "protocol" explanations on the documentation.
A think a simpler way would be to use Google Apps Script, a server-side javascript built into Google Spreadsheets and Sites. It's possible to write an interface to look like your html form. You'll have the advantage of it being highly integrated with Google spreadsheets. With 2 lines of code (literally) you can create a new spreadsheet with you csv values.