Hi,
I'm trying to create an event in a group calendar but i'm getting an
invalid uri error. Can anybody help me?

// Create an authenticated HTTP client
$client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass,
$service);

// Create an instance of the Calendar service
$service = new Zend_Gdata_Calendar($client);

$list = $service->getCalendarListFeed();

foreach($list as $calendar){
                if($calendar->title == "Group Calendar"){$uri = $calendar->id."/
private/full";}
}

// Create a new entry using the calendar service's magic factory
method
$event= $service->newEventEntry();

// Populate the event with the desired information
// Note that each attribute is crated as an instance of a matching
class
$event->title = $service->newTitle("EventTitle");
$event->content = $service->newContent("Event Content");

// Set the date using RFC 3339 format.
$startDate = "2009-12-20";
$startTime = "00:00";
$endDate = "2010-01-5";
$endTime = "00:00";
$tzOffset = "+01";

$when = $service->newWhen();
$when->startTime = "{$startDate}T{$startTime}:00.000{$tzOffset}:00";
$when->endTime = "{$endDate}T{$endTime}:00.000{$tzOffset}:00";
$event->when = array($when);

// Upload the event to the calendar server
// A copy of the event as it is recorded on the server is returned
$newEvent = $service->insertEvent($event, $uri);

The error is: Uncaught exception 'Zend_Gdata_App_HttpException' with
message 'Expected response code 200, got 400 Invalid request URI'

--

You received this message because you are subscribed to the Google Groups 
"Google Calendar 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-calendar-help-dataapi?hl=en.


Reply via email to