Query options overview

The Oracle Eloqua reporting API offers a comprehensive query language that can be appended to GET requests, enabling the retrieval of specific data elements. These query options are flexible and can be combined as needed. Below are some of the commonly used OData query options that are supported by the reporting API, unless otherwise noted.

  • $filter
  • $select
  • $count
  • $orderby
  • $skip
  • $top

$filter

Filters a query to only include items that match the specified expressions. For example, the following campaign query filters the retrieval campaigns with a Completed status.

GET /api/odata/campaignAnalysis/1.0/campaign?$filter=campaignStatus eq 'Completed'

$select

Specifies a limited subset of properties to include in the results. Multiple properties may be specified as a comma-separated list. For example, the following query returns only the total sends, delivered, opens and clickthroughs email activities.

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

$count

Returns the number of records in a collection or if the collection has a filter, the number of records matching the filter. For example, the following query returns email activities associated to campaigns and returns a count of the records returned. Since email activities are aggregated by several columns, the query counts by those aggregating columns.

GET /api/odata/campaignAnalysis/1.0/emailActivities?$filter=eloquaCampaignId gt 0&$count=true

$orderBy

Sorts the results according to the specified property and in the specified direction. For example, the following query returns form submission activities sorted by the submission date and hour, starting with the most recent date (descending).

GET /api/odata/campaignAnalysis/1.0/formActivities?$filter=dateHour gt 2022-01- 01&$orderby=dateHour desc

Learn more

Getting started with the reporting API