Hi Gui,
The method 'retrieveEmailList' is indeed not present in the Zend
library thus making the documentation inaccurate regarding the API
method. Sorry about that.
To avail the required functionality, you can place the following code
in <Zend Install>/library/Zend/Gdata/Gapps.php to retrieve the list:
/**
* Retrieve an email list from the domain by it's name.
*
* @param string $listname The name of the list to retrieve.
* @return Zend_Gdata_Gapps_EmailListEntry The email list entry
* @throws Zend_Gdata_App_Exception
* @throws Zend_Gdata_App_HttpException
* @throws Zend_Gdata_Gapps_ServiceException
*/
public function retrieveEmailList($emailListName) {
$uri = $this->getBaseUrl() . self::APPS_EMAIL_LIST_PATH .
"/" . $emailListName;
return $this->getEmailListEntry($uri);
}
We will try to get this method in the library soon to make sure the
documentation and code are in sync.
-Anirudh
On Jul 3, 4:45 am, cm_gui <[EMAIL PROTECTED]> wrote:
> Sorry I figured out the problem.
> I didn't activate the provisioning API in the admin control panel.
>
> But the problem of retrieveEmailList method not found still remains.
> Is this an error? Zend doesn't seem to have this method.
>
> On Jul 2, 4:35 pm, cm_gui <[EMAIL PROTECTED]> wrote:
>
> > Hi All
> > I followed the instructions
> > here:http://code.google.com/apis/apps/gdata_provisioning_api_v2.0_referenc...
> > and wrote this script (see below).
> > But I got this "Expected response code 200, got403" 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
> > thishttp://code.google.com/apis/apps/gdata_provisioning_api_v2.0_referenc...
> > 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.
> > Seehttp://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, got403' 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
-~----------~----~----~----~------~----~------~--~---