The following code keeping giving me the error
'Zend_Gdata_App_HttpException' with message 'Expected response code
200, got 400' I can't figure out why?
require_once "Zend/Loader.php";
Zend_Loader::loadClass('Zend_Gdata');
Zend_Loader::loadClass('Zend_Gdata_Gbase');
Zend_Loader::loadClass('Zend_Gdata_AuthSub');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
Zend_Loader::loadClass('Zend_Gdata_Calendar');
function createEvent ($client, $title, $desc, $where,
$startDate, $startTime, $endDate, $endTime, $tzOffset)
{
$gdataCal = new Zend_Gdata_Calendar($client);
$newEvent = $gdataCal->newEventEntry();
$newEvent->title = $gdataCal->newTitle($title);
$newEvent->where = array($gdataCal->newWhere($where));
$newEvent->content = $gdataCal->newContent($desc);
$when = $gdataCal->newWhen();
$when->startTime = "{$startDate}T{$startTime}:00.000{$tzOffset}:00";
$when->endTime = "{$endDate}T{$endTime}:00.000{$tzOffset}:00";
$newEvent->when = array($when);
// Upload the event to the calendar server
// A copy of the event as it is recorded on the server is returned
$createdEvent = $gdataCal->insertEvent($newEvent);
return $createdEvent->id->text;
}
$user = '[EMAIL PROTECTED]';
$pass = 'passowrd';
$service = Zend_Gdata_Calendar::AUTH_SERVICE_NAME; // predefined
service name for calendar
$proxy = new Zend_Http_Client('https://www.google.com',
array( 'adapter' => 'Zend_Http_Client_Adapter_Proxy', 'proxy_host' =>
'proxy.shr.secureserver.net', 'proxy_port' => 3128 ));
$client = Zend_Gdata_ClientLogin::getHttpClient($user,$pass,$service,
$proxy);
createEvent($client, 'test', 'description', 'My house',
'2008-08-30', '8:00', '2009-08-30', '10:00', '-04' );
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Base Data API" 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-Base-data-API?hl=en
-~----------~----~----~----~------~----~------~--~---