Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Assuming the document has already been created and has a document id of XXXX</p> <p>What you need to do is send a "PUT" request with specific headers, and XML (an entry describing your document) as the body, to a specific URL.</p> <p>Since you are not changing any content of the doc (only the meta-data), your target URL will look like this...</p> <p><a href="https://docs.google.com/feeds/default/private/full/XXXX/revisions/0" rel="nofollow">https://docs.google.com/feeds/default/private/full/XXXX/revisions/0</a></p> <p>The first thing you need to do is authenticate with the proper Google service.</p> <pre><code>$client = Zend_Gdata_ClientLogin::getHttpClient(GDOC_LOGIN, GDOC_PASS,'writely'); </code></pre> <p>Use the returned object to grab your auth token.</p> <pre><code>$auth_token = $client-&gt;getClientLoginToken(); </code></pre> <p>In Zend/Gdata/App.php is a helper function for executing the PUT request. Prepare parameters for this method like so...</p> <pre><code>$method = "PUT"; $url ="https://docs.google.com/feeds/default/private/full/XXXX/revisions/0"; $headers['GData-Version'] = '3.0'; $headers['If-Match'] = '*'; $headers['Authorization'] = "GoogleLogin auth = $auth_token"; $headers['Content-Length'] = '380'; $headers['Content-Type'] = 'application/atom+xml'; $body = &lt;&lt;&lt;XML &lt;?xml version='1.0' encoding='UTF-8'?&gt; &lt;entry xmlns="http://www.w3.org/2005/Atom" xmlns:docs="http://schemas.google.com/docs/2007" xmlns:gd="http://schemas.google.com/g/2005"&gt; &lt;category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/docs/2007#spreadsheet"/&gt; &lt;docs:publish value="true"/&gt; &lt;docs:publishAuto value="true"/&gt; &lt;/entry&gt; XML; $contentType = "application/atom+xml"; $remainingRedirects = 99; </code></pre> <p>Then call the helper function...</p> <pre><code>$app = new Zend_Gdata_App(); $app-&gt;performHttpRequest($method, $url, $headers, $body, $contentType, $remainingRedirects); </code></pre> <p>Good luck! Let me know if this helps!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload