Error creating Google Calendar

Posted by Don on Stack Overflow See other posts from Stack Overflow or by Don
Published on 2010-05-15T14:16:19Z Indexed on 2010/05/15 14:24 UTC
Read the original article Hit count: 238

Filed under:
|

Hi,

I'm trying to use the Google Calendar Java API to create a secondary calendar for a Google apps user. The relevant code is:

// Initialise the API client
CalendarService googleCalendar = new GCalendarService("canimo.ca");
googleCalendar.setUserCredentials("[email protected]", "secret");

// Create the calendar
CalendarEntry cal = new CalendarEntry();
cal.title = new PlainTextConstruct(user.email);
cal.summary = new PlainTextConstruct("Collection calendar");
cal.timeZone = new TimeZoneProperty("America/Montreal");
cal.hidden = HiddenProperty.FALSE;
googleCalendar.insert(CALENDAR_URL, calendar);

The call to insert() above results in com.google.gdata.util.ServiceException: Internal Server Error and no calendar is created. If I try and perform the same operation through the Google calendar website, it also fails with the error message:

We could not save changes. Please try again in a few minutes.

An obvious conclusion is that there's some problem on Google's side, but this has been going on for several days now. Strangely, if I create a new user, everything works fine for a while. I can create calendars via the website, and download them via the API. But as soon as I try and create a new calendar using the API, I get the exception above, and thereafter can't create new calendars using either the website or the API.

Thanks, Don

© Stack Overflow or respective owner

Related posts about java

Related posts about google-calendar