@pmanca thanks for the quick response. We have no problem paging through the records, but if we have to do 6 months of paging just to find the data we need, it’s a lot of wasted API calls that could be saved by a proper date filter.
I found a discrepancy in the api docs. On https://developers.hubspot.com/docs/methods/email/email_events_overview: “Events can be looked up in bulk using either ‘recipient’ or both ‘appId’ and ‘campaignId’, and optionally any combination of the above properties, via this endpoint.”
But then on the get_events page (https://developers.hubspot.com/docs/methods/email/get_events), the only "required parameter’ is the oauth token, which leads developers to believe all other parameters are optional. Hence why we were expecting the date filtering to work in our example.
Here’s the problem with making the campaign ID required in the get_events endpoint: there’s no way to get campaigns by date. Even the campaign payload has no date field telling us when the campaign was created, sent, updated, etc. The timestamps all come back empty.
So with the current API design, the only way to get email events within a date range is to first page through every email campaign, then call get_events with the campaign id and date filters. Can this be improved?