Dear all:
I am trying to figure out how the calendar API works.
For now, authenticating is successful. My code can correctly
retrieve the calendar list and the execution of Calendar.Events.List
is also successful.
However, I always get
Exception in thread "main" com.google.api.client.googleapis.json.GoogleJsonResponseException: 404 Not Found
when executing the Calendar.Events.Get request.
Please help me to figure out where the problem is.
Below please find the source codes:
com.google.api.services.calendar.Calendar client=new com.google.api.services.calendar.Calendar.Builder(
GoogleNetHttpTransport.newTrustedTransport(),
JacksonFactory.getDefaultInstance(),
session.getCredential()).setApplicationName("test").build();
com.google.api.services.calendar.model.CalendarList feed = client.calendarList().list().execute();
System.out.println(feed);
String id="xxxxxx";
Calendar.Events.List list=client.events().list(id);
System.out.println(list.values().size());
Calendar.Events.Get event=client.events().get(id, (String) list.values().toArray()[0]);
Event eventData=event.execute();
System.out.println(eventData.getDescription());