404 error when executing a Calendar.Events.Get request

2,169 views
Skip to first unread message

Lendle Tseng

unread,
Nov 20, 2014, 3:55:05 AM11/20/14
to google-ca...@googlegroups.com
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());


Lucia Fedorova

unread,
Nov 24, 2014, 6:52:37 PM11/24/14
to google-ca...@googlegroups.com
Hi Lendle,
is it possible that the ID you are using is incorrect? Please make sure that you can use the same ID in the API explorer: https://developers.google.com/apis-explorer/#p/calendar/v3/calendar.events.get
Reply all
Reply to author
Forward
0 new messages