Integrations with third party systems typically want to sync Recipient events, eg. use bounces to mark CRM records as unreachable, and analyse sends, opens, clicks in a BI tool.
The most direct route to receiving Recipient events is to configure Webhooks on your Maxemail space. This will send all events (or a subset of selected types), firehose-style, to your selected endpoint in near-real-time.
For frequent data sync using the API, our recommended approach is to use the Quick Data Export service. This allows you to specify a datetime filter from which to retrieve activity, so you can configure your application to only fetch data since your last sync.
Usually, the simplest approach is to fetch data in the early hours of each day, using the filter to request data since 00.00 on the previous calendar date.
Requesting data more frequently, such as every 6 hours, is acceptable if the age of the data is critical to your application, however fetching too much and/or too often might cause the API access to be suspended.
The original Quick Data Export service is used for standard Email Campaigns, and similar services exist for Triggered Emails, Transactional Emails and SMS. Each of these services' methods generate immediately the data and return a string response providing a file download key which can be used immediately to download the exported data. The file will be available for 1 day.
Data is downloaded as a CSV file. Examples can be easily seen using the interface, as the same services are used there to download data for specific emails. Open any completed email's Reporting tab to see the Export icon next to each stat in the Breakdown table (Exporter role is required for your user account).
As the downloaded data is recipient-centric, the specific message (eg. Email Campaign, Triggered Email, SMS) is only referenced by its ID. If you need to fetch data about the message, use the relevant message type's find method, eg. EmailCampaign.find and store the result locally so that you do not need to request it for each recipient or each day.