Google Docs API Adding a ressource to a collection (Zend/gdata)


I'm trying to do this following the API documentation there:

With the Zend PHP gdata Framework my code is :

$docs->insertDocument($entryFile,  '');

Documentation on this method

I don't know how to find the correct URI then...

The entryFile parameter is the right type, it's the url that cause the problem the error

Response from the server :

HTTP/1.1 400 Bad Request Content-type: text/html; charset=UTF-8 Date: Wed, 25 Apr 2012 17:10:51 GMT Expires: Wed, 25 Apr 2012 17:10:51 GMT Cache-control: private, max-age=0 X-content-type-options: nosniff X-frame-options: SAMEORIGIN X-xss-protection: 1; mode=block Server: GSE Connection: close Invalid request URI

The exception :

Fatal error: Uncaught exception 'Zend_Gdata_App_HttpException' with message 'Expected response code 200, got 400 Invalid request URI' in C:\Program Files (x86)\EasyPHP-\www\workspace\library\Zend\Gdata\App.php:709 Stack trace: #0 C:\Program Files (x86)\EasyPHP-\www\workspace\library\Zend\Gdata.php(219): Zend_Gdata_App->performHttpRequest('POST', 'https://docs.go...', Array, 'performHttpRequest('POST', 'https://docs.go...', Array, 'post(Object(Zend_Gdata_Docs_DocumentListEntry), 'https://docs.go...', NULL, NULL, Array) #3 C:\Program Files (x86)\EasyPHP-\www\workspace\library\Zend\Gdata\Docs.php(300): Zend_Gdata_App->insertEntry(Object(Zend_Gdata_Docs_DocumentListEntry), 'https://docs.go...', 'Zend_Gdata_Docs.. in C:\Program Files (x86)\EasyPHP-\www\workspace\library\Zend\Gdata\App.php on line 709

(If you need any info please let me know, i'm really stuck on this and i'm willing to give as much details as possible if needed)


Could you please log the exact HTTP request that is performed by Zend and compare it ti the one listed in the documentation:

I'm sure the differences will show you what is done wrong.

By : Nivco

I solved the problem using the Php Client Library for the Google Drive SDK

This video can help you solving your question :)
By: admin