The purpose of this tutorial is to simplify you learning how to interact with your google documents using Google API .
< ?php
require_once 'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Http_Client');
Zend_Loader::loadClass('Zend_Gdata');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
Zend_Loader::loadClass('Zend_Gdata_Spreadsheets');
$u = "Your Google Account Email";
$p = "Your Google Account Password";
$authService = Zend_Gdata_Spreadsheets::AUTH_SERVICE_NAME;
$httpClient = Zend_Gdata_ClientLogin::getHttpClient($u, $p, $authService);
$spreadsheetService = new Zend_Gdata_Spreadsheets($httpClient);
// From Where you can get 'Your Google SpreadSheet Key';
// open your spreadsheet in your browser
// You will see somethig similar to this
// http://spreadsheets.google.com/ccc?key=bfhfhfGTFRkskshnvnnnvnveyrgstd&hl=en
// in this case your 'Your Google SpreadSheet Key' is: bfhfhfGTFRkskshnvnnnvnveyrgstd
$spreadsheetKey = 'Your Google SpreadSheet Key';
$worksheetId = 'od6';
// if you dont know your WorkSheet ID, use the script below
// it will give the name and the WorkSheet ID for all your spreadsheets
$query = new Zend_Gdata_Spreadsheets_DocumentQuery();
$query->setSpreadsheetKey($spreadsheetKey);
$feed = $spreadsheetService->getWorksheetFeed($query);
foreach ($feed as $key => $entry) {
echo $entry->title;
echo $entry->id;
}
$rowData = array('name' => 'John Doe', "age" => '35');
$insertedListEntry = $spreadsheetService->insertRow($rowData, $spreadsheetKey, $worksheetId);
// How to update a row in Google SpreadSheet (row number 2 in our example):
$query = new Zend_Gdata_Spreadsheets_ListQuery();
$query->setSpreadsheetKey($spreadsheetKey);
$query->setWorksheetId($worksheetId);
$listFeed = $spreadsheetService->getListFeed($query);
$entry = $spreadsheetService->updateRow($listFeed->entries["2"], $rowData);
if ($entry instanceof Zend_Gdata_Spreadsheets_ListEntry) {
echo "Success!\n"; $response = $entry->save();
}
// How to delete a row in Google SpreadSheet
// Note rows start from 0, thus to delete row number 4
// Use index 3
$entry = $spreadsheetService->deleteRow($listFeed->entries["3"]);
?>
Google will return the following error when u use capitals in your column header (eg: Name, Age, ....):
Expected response code 200, got 400 We're sorry, a server error occurred. Please wait a bit and try again.

Comments
Thanks, any news for that bug?