Hi All
I followed the instructions here:
http://code.google.com/apis/apps/gdata_provisioning_api_v2.0_reference_php.html#Authenticating_To_Your_Domain
and wrote this script (see below).
But I got this "Expected response code 200, got 403" error. See below.
So the authentication did not really work.   How to make it work?
I want to write a script to let all users manage all the mailing lists
of the domain.

Also, on this 
http://code.google.com/apis/apps/gdata_provisioning_api_v2.0_reference_php.html#Retrieve_Email_List_Example
page, there is a retrieveEmailList method.
However it seems that Zend does not have such a method.  Using this
retrieveEmailList will produce a method not found error.   See
http://framework.zend.com/manual/en/zend.gdata.gapps.html --- there is
no retrieveEmailList method.

Thank you
gui

===
My script

require_once "Zend/Loader.php";
Zend_Loader::loadClass('Zend_Gdata');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
Zend_Loader::loadClass('Zend_Gdata_Gapps');

$email = "[EMAIL PROTECTED]";
$password = "mypassword;
$domain = "example.com";

$client = Zend_Gdata_ClientLogin::getHttpClient($email, $password,
Zend_Gdata_Gapps::AUTH_SERVICE_NAME);
$service = new Zend_Gdata_Gapps($client, $domain);

$feed = $service->retrieveAllRecipients('mymailinglist');

foreach ($feed as $recipient) {
   echo '  * ' . $recipient->who->email . "\n";
}

---
error

Fatal error: Uncaught exception 'Zend_Gdata_App_HttpException' with
message 'Expected response code 200, got 403' in
/usr/local/share/ZendFramework/library/Zend/Gdata/App.php:286 Stack
trace: #0
/usr/local/share/ZendFramework/library/Zend/Gdata/Gapps.php(163):
Zend_Gdata_App::import('https://www.goo...',
Object(Zend_Http_Client), 'Zend_Gdata_Gapp...') #1
/usr/local/share/ZendFramework/library/Zend/Gdata/App.php(132):
Zend_Gdata_Gapps::import('https://www.goo...',
Object(Zend_Http_Client), 'Zend_Gdata_Gapp...') #2
/usr/local/share/ZendFramework/library/Zend/Gdata.php(110):
Zend_Gdata_App->getFeed('https://www.goo...', 'Zend_Gdata_Gapp...') #3
/usr/local/share/ZendFramework/library/Zend/Gdata/Gapps.php(398):
Zend_Gdata->getFeed('https://www.goo...', 'Zend_Gdata_Gapp...') #4
/usr/local/share/ZendFramework/library/Zend/Gdata/Gapps.php(1036):
Zend_Gdata_Gapps-
>getEmailListRecipientFeed(Object(Zend_Gdata_Gapps_EmailListRecipientQuery))
#5 /usr/local/share/ZendFramework/library/Zend/Gdata/Gapps.php(1054):
Zend_Gdata_Gapps->retri in
/usr/local/share/ZendFramework/library/Zend/Gdata/App.php on line 286
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Apps 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-apps-apis?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to