Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

Using Calendar View

anihojnadel edited this page Nov 25, 2014 · 3 revisions

Use calendar view to get the occurrences, exceptions, and single instances of events in a specified time range from the user's primary calendar or from a different calendar.

If you want to get calendar view for the default calendar use:

java.util.Calendar dateStart;
java.util.Calendar dateEnd;

...

List<Event> calendarView = client.getMe().getCalendarView()
                            .addParameter("startdatetime",dateStart)
                            .addParameter("enddatetime", dateEnd)
                            .read().get();

Otherwise, for a particular calendar, use:

java.util.Calendar dateStart;
java.util.Calendar dateEnd;
String calendarId;
...

List<Event> calendarViewForCalendar = client.getMe().getCalendar(calendarId)
                            .getCalendarView()
                            .addParameter("startdatetime", dateStart)
                            .addParameter("enddatetime", dateEnd)
                            .read().get();

For more information, see the integration tests or the REST Api Documentation

Clone this wiki locally