Search code examples
google-calendar-apigoogle-oauthgoogle-api-clientgoogle-oauth-java-client

how to get google calender events between two dates from google API v3?


I am developing calander interface and need to include google events in the calander.

I am able to list events by querying

https://www.googleapis.com/calendar/v3/calendars/primary/events

But, need to fetch events between two dates. I have found similar problem on this question but he is using javascript client, and I am not. he is using .setTimeMin() method to set date.

I need to know what parameters should be passed to retrive evetns between two dates.


Solution

  • I got the hint from here

    The parameters are timeMin & timeMax , should be passed with query string like this

    https://www.googleapis.com/calendar/v3/calendars/primary/events?timeMin=2012-09-30T09:11:13.562Z&timeMax=2012-10-30T09:11:13.562Z