1

I have PHP code that is managing mailing lists using the Provisioning API. Visitors are able to opt in or out of the mailing list via a web form. It has been working for ~6 months and stopped working 10/1/2013.

I am using this code for testing:

require_once 'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Gdata');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
Zend_Loader::loadClass('Zend_Gdata_Gapps');
$service = Zend_Gdata_Gapps::AUTH_SERVICE_NAME  ;

$username = 'my_username';
$password = 'my_password';
$domain = 'my_domain';
$email = 'test-email@domain.com';
$email_list = 'test-list';

$client = Zend_Gdata_ClientLogin::getHttpClient($username, $password, $service);
$gdata = new Zend_Gdata_Gapps($client, $domain);
$gdata->addRecipientToEmailList($email, $email_list);

I'm receiving the following error message:

PHP Fatal error:  Uncaught exception 'Zend_Gdata_App_HttpException' with message    'Expected response code 200, got 400
Invalid request URI' in /usr/share/php/Zend/Gdata/App.php:716\nStack trace:
#0 /usr/share/php/Zend/Gdata.php(219): Zend_Gdata_App->performHttpRequest('POST', 'https://apps-ap...', Array, '<atom:entry xml...', 'application/ato...', NULL)
#1 /usr/share/php/Zend/Gdata/App.php(908): Zend_Gdata->performHttpRequest('POST', 'https://apps-ap...', Array, '<atom:entry xml...', 'application/ato...')
#2 /usr/share/php/Zend/Gdata/Gapps.php(247): Zend_Gdata_App->post(Object(Zend_Gdata_Gapps_EmailListRecipientEntry), 'https://apps-ap...', NULL, NULL, Array)
#3 /usr/share/php/Zend/Gdata/App.php(983): Zend_Gdata_Gapps->post(Object(Zend_Gdata_Gapps_EmailListRecipientEntry), 'https://apps-ap...', NULL, NULL, Array)
#4 /usr/share/php/Zend/Gdata/Gapps.php(840): Zend_Gdata_App->insertEntry(Object(Zend_Gdata_Gapps_EmailListRecipientEntry), 'https://apps-ap...', 'Zend_Gdata_Gapp...')
#5 /usr/share/php/Zend/Gdata/Gapps.php(1625): Zend_G in /usr/share/php/Zend/Gdata/App.php on line 716

Can anyone tell me what happened? And what I need to do to get this working again?

Thanks, B

brianb
  • 29
  • 3
  • I have the same problem. If it makes you feel better... My guess it something to do with the URL changed server-side. No clue if I can update Zend without breaking our apps though. – JDPeckham Oct 04 '13 at 01:29
  • here's the URL in the code it's trying to use: const APPS_BASE_FEED_URI = 'https://apps-apis.google.com/a/feeds'; – JDPeckham Oct 04 '13 at 01:32
  • I spent a day and a half confused about what happened. I am glad that I'm not going crazy. – brianb Oct 04 '13 at 16:40
  • Have you looked into the Admin SDK? I'm trying to get it working to accomplish the same thing but no luck so far. – brianb Oct 04 '13 at 16:54

1 Answers1

1

Google completely remove support for emaillists. Use groups instead lists.

Example:

instead $gdata->addRecipientToEmailList($email, $email_list)

use $gdata->addMemberToGroup($email, $group_name)

deleteEmailList -> deleteGroup

createEmailList -> createGroup

getEmailListRecipientFeed -> retrieveAllMembers

See full syntax in Zend docs: http://framework.zend.com/manual/1.12/en/zend.gdata.gapps.html

Oleg_L
  • 11
  • 1