Hi,
I ran your code snippet and received the same error.
The error message said invalid time format. Try using '08:00:
createEvent($client, 'test', 'description', 'My house',
'2008-08-30', '08:00', '2009-08-30', '10:00', '-04' );
Also, if you have additional Calendar API questions, it's better
to ask in their group:
http://groups.google.com/group/google-calendar-help-dataapi?lnk=
Thanks,
Eric
On Aug 29, 3:06 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> 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
-~----------~----~----~----~------~----~------~--~---