Well, I found a solution: http://groups.google.com/group/Google-Docs-Data-APIs/browse_thread/thread/787d124bbddfabe0/674e235bf36c84fc?lnk=gstq=%22Zend_Gdata_Spreadsheets%22#674e235bf36c84fc
I have to pass the following argument to getSpreadsheetFeed(): 'http://spreadsheets.google.com/feeds/spreadsheets/private/full' In other words ... $feed = $ssService->getSpreadsheetFeed('http://spreadsheets.google.com/ feeds/spreadsheets/private/full'); This is necessary because the default URI used within the Zend_Gdata_Spreadsheets class isn't correct ... at least not for the way I'm using it here. The default is 'http://spreadsheets.google.com/ feeds/spreadsheets'. Does that default work for certain kinds of spreadsheets, or is it no longer valid at all? If it's the latter, then the ZendGdata code needs to be changed. It turns out that the gdata.py API uses a URI of the form http://{X}/feeds/spreadsheets/{Y}/{Z} where {X} defaults to 'spreadsheets.google.com', {Y} defaults to 'private', and {Z} defaults to 'full', and where {X}, {Y}, and {Z} are overridable at run time. Methinks that the ZendGdata API should use the same defaults. On Oct 17, 10:39 pm, HippoMan <[EMAIL PROTECTED]> wrote: > I'm trying to use the Zend Gdata API to retrieve data from some Google > spreadsheets, and I'm following the pattern described in this > document:http://framework.zend.com/manual/en/zend.gdata.spreadsheets.html. > However, when I issue the getSpreadsheetFeed() method as described in > that document, my application throws an exception. > > Here's my code (email and password changed to dummy values): > > $email = '[EMAIL PROTECTED]'; > $pw = 'my-password'; > $service = Zend_Gdata_Spreadsheets::AUTH_SERVICE_NAME; > try { > $client = Zend_Gdata_ClientLogin::getHttpClient($email, $pw, > $service);} > > catch (Zend_Gdata_App_CaptchaRequiredException $cre) { > echo 'URL of CAPTCHA image: ' . $cre->getCaptchaUrl() . "<br/>\n"; > echo 'Token ID: ' . $cre->getCaptchaToken() . "<br/>\n"; > exit(0);} > > catch (Zend_Gdata_App_AuthException $ae) { > echo 'Problem authenticating: ' . $ae->exception() . "<br/>\n"; > exit(0);} > > echo "Authenticated<br/>\n"; > $ssService = new Zend_Gdata_Spreadsheets($client); > echo "ssService created<br/>\n"; > $feed = $ssService->getSpreadsheetFeed(); > echo "feed created<br/>\n" > foreach ($feed->entries as $entry) { > echo $entry->title->text .' '. $entry->content->text . "<br/>\n"; > > } > > The exception gets thrown right at the getSpreadsheetFeed() method > call. Here are the first few lines: > > An error occurred > Application error > Exception information: > > Message: Expected response code 200, got 404 > Not Found > Error 404 > > Stack trace: > > #0 /home/ofrecord/sites/hotelp/library/Zend/Gdata.php(201): > Zend_Gdata_App->performHttpRequest('GET', 'http://spreadsh...', Array, > NULL, NULL, NULL) > #1 /home/ofrecord/sites/hotelp/library/Zend/Gdata/App.php(610): > Zend_Gdata->performHttpRequest('GET', 'http://spreadsh...') > #2 /home/ofrecord/sites/hotelp/library/Zend/Gdata/App.php(541): > Zend_Gdata_App->get('http://spreadsh...') > #3 /home/ofrecord/sites/hotelp/library/Zend/Gdata/App.php(147): > Zend_Gdata_App->importUrl('http://spreadsh...', 'Zend_Gdata_Spre...') > #4 /home/ofrecord/sites/hotelp/library/Zend/Gdata.php(148): > Zend_Gdata_App->getFeed('http://spreadsh...', 'Zend_Gdata_Spre...') > #5 /home/ofrecord/sites/hotelp/library/Zend/Gdata/ > Spreadsheets.php(139): Zend_Gdata->getFeed('http://spreadsh...', > 'Zend_Gdata_Spre...') > #6 /home/ofrecord/sites/hotelp/application/views/scripts/index/ > index.phtml(27): Zend_Gdata_Spreadsheets->getSpreadsheetFeed() > ... etc. ... > > The email address and password are correct. Furthermore, making the > corresponding calls through the gdata.py API works without a problem. > > Can anyone tell me what I'm doing wrong when using this Zend API? > > Thanks in advance. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Docs Data APIs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Docs-Data-APIs?hl=en -~----------~----~----~----~------~----~------~--~---
