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
-~----------~----~----~----~------~----~------~--~---

Reply via email to