Pagination

Pagination is an effective technique for efficiently managing and retrieving large datasets in the reporting API.

Pagination in OData

The reporting API is built on the OData protocol, which provides standardized mechanisms for implementing pagination. This allows developers to fetch data in manageable chunks. The key components of pagination in OData are the $skip and $top query options. These options enable developers to specify the number of items to skip and the maximum number of items to return per page, respectively.

Using pagination

To navigate through multiple pages of data, we utilize the $skip and $top query options. For example:

GET /api/odata/campaignAnalysis/1.0/emailActivities?$skip=100&$top=100

$skip=100: This parameter instructs the server to skip the first 100 records in the dataset, facilitating navigation to a specific page of results.

$top=100: This parameter specifies that the server should return a maximum of 100 records in the response, defining the size of each page of data returned by the API.

Handling pagination response

Upon receiving the request, the server responds with a paginated collection of email activities based on the specified pagination parameters. Additionally, the response may include metadata indicating the total count of records and links to navigate to the next and previous pages. By implementing pagination effectively, developers can optimize data retrieval processes, enhance performance, and ensure a seamless user experience when interacting with the reporting API.

Learn more

Getting started with the reporting API