Reporting API best practices

Query modified records based on last execution

Improve data retrieval efficiency by querying only modified records since your last execution. This focused approach — filtering queries to include only modified records — reduces data transfer and processing overhead, resulting in faster operations.

Use pagination to manage large volumes

Pagination facilitates the retrieval of data in manageable portions. In OData, the essential elements for pagination are the $skip and $top query options. These parameters empower developers to dictate both the quantity of records to bypass and the maximum number of records to present per page. Pagination is especially advisable when dealing with high data volumes.

Utilize $select to retrieve only necessary properties

By default, queries return all available properties of an entity. Adding the $select query allows you to specify only the properties you need and improves performance.

In the following example, using the $select query, we will only return the campaign ID, total sends, total delivered, total opens, and total clickthrough properties:

GET/api/odata/campaignAnalysis/1.0/emailActivities?$select=eloquaCampaignId,totalSends,totalDelivered,totalOpens,totalClickthroughs

Derive calendar dimensions with the dateHour key

The reporting API includes a calendar dimension as part of each endpoint subject area. The primary key is dateHour, which can be used to join with activity endpoints to derive additional calendar dimensions.

The calendar table is useful for reporting because it can help determine business days, fiscal quarters, and so on. For example, you can use this endpoint to map dateHour activity details to the calendar day, month, quarter, year, and so on.

Understand the relationship between the reporting API and Insight subject areas

The reporting API endpoints are closely aligned with the subject area structure found in Insight. A subject area implies the data level to which metrics and attributes relate. It is highly recommended to familiarize yourself with Insight reporting and the data sources available through subject areas.

Note that not all subject areas will be launched and supported by the reporting API. Given the extensive range of metrics and attributes within Insight’s subject areas, achieving complete parity with the reporting API will take time and require ongoing releases.

Learn more

Getting started with the reporting API