0
votes

I would like our app users to be able to access the non-default calendar events in their Google calendar. We can access the events in their default calendar just fine, but we would like to include the events from their other calendars as well. I found a post on the google support forums that says:

"To get a feed from another calendar, you have to specify its ID in the URL. The IDs for other calendars (= other than the main/default one), you have to go to the calendars Settings section (look at the box entitled "my calendars" on the left side of the screen), click on "settings", and then on the link of your other calendar. Then, scroll to the page-bottom, and copy/paste the URL you get by clicking on the orange "XML" button, on the "private address" line."

Is there a better way to do this? Would I actually have to have our app users follow these procedures to manually enter the URL for their non-default Google calendars so that we can retrieve them? We are using the google-api-java-client to access the users Google calendar.

1

1 Answers

2
votes

Here is the way I obtain the calendar IDs:

CalendarList calendarList = client.calendarList().list().execute();
 for (CalendarListEntry calendar : calendarList.getItems()) {
  String id=calendar.getId();
  String name=calendar.getSummary();
 }
}