1
votes

i am trying to get only the future events in a descending order, i am using the google calendar api fields but future events and descending are not working

https://www.googleapis.com/calendar/v3/calendars/XXXXXXXXXXXgroup.calendar.google.com/events?singleEvents=true&orderBy=startTime&sortorder=descending&max-results=10&futureevents=true&key=XXXXXXXXX

when i use the above url, it gives a json of events starting from past month and goes all the way in ascending order to next year..

what could be the reason?

1

1 Answers

3
votes

Future events and descending are parameters supported by v2 of the Calendar API. For v3, which you are using according to the URL, you can use orderBy in combination with timeMin / timeMax to get only the future events you want. Note that orderBy returns events in ascending order, so you will need to get the list of events and reverse the list yourself.