Q:

How to connect PHP GAE(Google App Engine) to Google Docs, Spreadsheets

I have a PHP app deployed in GAE(Google App Engine)

I need to connect to Google Docs, Google Spreadsheet URL below and do all editions/manage(edit a Doc, Edit a Sheet,...etc) as like I am able to do via GAS, just like we manage the CAL API.
https://developers.google.com/apps-script/reference/document/
https://developers.google.com/apps-script/reference/spreadsheet/

What is the best approach for it? How to use those functions available in GAS via PHP GAE?
Plz someone help, a small tip would also help us.

A:

In PHP, you can make an HTTP Request.  In Apps Script, you can create a Stand Alone Apps Script project, that detects either a GET or POST request, and runs code.  Then the code can do whatever you want it to do (E.g. write data to spreadsheet).  When the code is done, you can have it return something back to the PHP code that called it.  
So, you can use an Apps Script project as an intermediary between your PHP and a Google spreadsheet.  This avoids needing to use the PHP API for Google Spreadsheets.  The Apps Script file is an intermediary between your PHP code and getting data written/read from your spreadsheet.  But an API is also an intermediary.  So, in that sense it's the same. If you already have Apps Script code that does what you want, you can trigger it to run with a doGet() or doPost() function.  And you can avoid learning the API.
For more information see the following post:
stackoverflow answer - Call a custom GAS function from external URL

