Is there a script or tutorial on how to do this? How to implement inserting of data from my PHP application into a Google Spreadsheet?
I've looked at the API (https://developers.google.com/google-apps/spreadsheets/) and there are no PHP codes/examples.
I've tried the Zend Library implementation, but something seems very outdated with that approach as I am getting some silly errors on a simple row insert.
I don't think I can use the Google Apps Script (https://developers.google.com/apps-script/reference/spreadsheet/) as I don't see how I can code and trigger from a PHP script.
Anything else?
Isn't there a workable API for this that we can easily use and tap into?
Sure you can. You can create a web service using Google Apps Script, that can receive and process service requests. It's simple to pass parameters to the web service, this could be done using cURL, for instance.
The following example is for a simple spreadsheet with two columns. You can add further rows by:
or by browser URL:
This example spreadsheet is published here, and below is an example URL that can be used to add a row:
Instructions
Here is a step-by-step.
--spreadsheet-id--
with your sheet's id (easy to find this)?col1='Colum1Data'&col2='Colum2Data'
to the URL or edit as needed to push data to the spreadsheet from the URL(Thanks to vr00n.)
Code.gs
This could be a stand-alone or container-bound script; either way, you need to supply the ID of the spreadsheet, since the web app does not run within a spreadsheet context. Rather than display html, it uses the ContentService to serve simple text - you can elaborate that in any way that is appropriate for your application.
You should read over Google's Content Service documentation, especially the cautions around redirection, and sensitive information.