Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get the next instance of recurring events with the Google Calendar API v3

I am trying to get the events in my calendar over a date range (single or recurring events alike). Now I will not necessarily know the exact datetime for the next instance of a recurring event as . For recurring events I want the date of the next occurrence rather than the date of the first instance as I am getting with the request below. How do I do this?

https://www.googleapis.com/calendar/v3/calendars/{calendarid}/events?fields=items(id,summary,start)&key={APIkey}&timeMax={enddate}&timeMin={startdate}

like image 413
Sola Oderinde Avatar asked Dec 27 '22 10:12

Sola Oderinde


1 Answers

Add in the URL parameter singleEvents=True. This will expand all recurring events into their individual items. There isn't any way to specifically get just the second event in a series if you don't already know when it is, but using that parameter will let you parse out all instances and get the one you want.

Source: https://developers.google.com/google-apps/calendar/v3/reference/events/list

like image 64
hexedpackets Avatar answered Dec 28 '22 23:12

hexedpackets