Skip to content

Conversation

chrisnovakovic
Copy link

The Google Calendar API v3 limits the number of events returned by the "Events: list" endpoint to 250 by default, and API::Google::GCal provides no means of overriding this behaviour. This commit makes two changes to API::Google::GCal's events_list() method so that it returns all events in the requested calendar:

  • Iterate over all pages of the event result list by using the nextPageToken property in each API response as the value of the pageToken parameter in the next API request.
  • Set the maxResults query parameter to its maximum permitted value under the v3 API (2500), to minimise the number of API requests that must be made to iterate over all of the result pages.

The Google Calendar API v3 limits the number of events returned by the
"Events: list" endpoint to 250 by default, and API::Google::GCal
provides no means of overriding this behaviour. This commit makes two
changes to API::Google::GCal's events_list() method so that it returns
all events in the requested calendar:

* Iterate over all pages of the event result list by using the
  nextPageToken property in each API response as the value of the
  pageToken parameter in the next API request.

* Set the maxResults query parameter to its maximum permitted value
  under the v3 API (2500), to minimise the number of API requests that
  must be made to iterate over all of the result pages.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant