Edit in GitHubLog an issue

Reporting API

The Analytics 2.0 reporting API endpoints allow you to access reports programmatically through Adobe Developer. The endpoints use the same data and methods that are used when working with reports in the UI. By using this API, you can programmatically report to executive dashboards, custom reporting platforms, tight Experience Cloud integrations, or other options.

The report endpoints described in this guide are routed through analytics.adobe.io. To use them, you will need to first create a client with access to the Adobe Analytics Reporting API. For more information, refer to Getting started with the Analytics API.

This guide includes instructions for using the following endpoints:

  • POST reports: Creates report requests and returns data for an existing report suite. This corresponds to creating a visualization in the UI.
  • GET top items: Returns only the specified number of items in the report, ranked by highest data values

This guide does not include descriptions for all request and response parameters for the reports endpoint. For more information on parameters included with this endpoint, see the API reference. Also, you can copy API JSON request payloads and responses associated with any visualization directly from Analysis Workspace with the Oberon debugger tool. This can be a helpful aid in structuring any API reporting request from Analysis Workspace visualizations.

Request reporting data

This guide includes API instructions that correspond to an example free-form table visualization in Analysis Workspace with the page dimension and the following metrics:

  • pageviews
  • visits
  • visitors

This example appears in Analysis Workspaces similar to the following graphic:

visualization

To make the request, use the following URI for your POST HTTP call:

POST https://analytics.adobe.io/api/{global-company-id}/reports

Click the Request tab in the following example to see a POST request corresponding to the data shown in the visualization above, limited to the top ten values. Click the Response tab to see a successful JSON response for the request.

Copied to your clipboard
curl -X 'POST' \
'https://analytics.adobe.io/api/{global-company-id}/reports' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'x-api-key: {API-key}' \
-H 'Authorization: {Bearer-token}
-d '{REQUESTJSON}
{
"rsid": "examplersid",
"globalFilters": [
{
"type": "dateRange",
"dateRange": "2023-07-01T00:00:00.000/2023-08-01T00:00:00.000",
"dateRangeId": "thisMonth"
}
],
"metricContainer": {
"metrics": [
{
"columnId": "0",
"id": "metrics/pageviews"
},
{
"columnId": "1",
"id": "metrics/visits",
"sort": "desc"
},
{
"columnId": "2",
"id": "metrics/visitors"
}
]
},
"dimension": "variables/page",
"settings": {
"countRepeatInstances": true,
"includeAnnotations": true,
"limit": 10,
"page": 0,
"nonesBehavior": "exclude-nones"
},
"statistics": {
"functions": [
"col-max",
"col-min"
]
},
"capacityMetadata": {
"associations": [
{
"name": "applicationName",
"value": "Analysis Workspace UI"
},
{
"name": "projectId",
"value": "undefined"
},
{
"name": "projectName",
"value": "New project"
},
{
"name": "panelName",
"value": "Freeform table"
}
]
}
}

Example request details

In addition to the metrics described above, the JSON payload requests the following:

  • Time period From July 1, 2023 00:00:00.000 - August 1, 2023 00:00:00.000, using the report suite timezone

  • To sort response visits by descending value, i.e. highest to lowest

Request parameters

The example request includes the following parameters in the payload:

ParameterReq/OptTypeDescription
rsid
required
string
report suite ID
globalFilters
optional
array
Contains type, dateRange, and dateRangeId
type
optional
string
The type of filter applied
dateRange
optional
string
The date range of the data
dateRangeId
optional
string
The label for the date range; e.g., ThisMonth
metricContainer
optional
object
Contains metrics array
metrics
optional
array
Contains ColumnId, id, and sort
columnId
optional
string
The column number in the table visualization, left to right, starting from 0
id
optional
string
The name of the element for the column; e.g., the name of the metric
sort
optional
string
The sorting applied to the column data--asc or desc
dimension
required
string
The dimension used for the report
settings
optional
object
The settings requested for the reporting response, as specified by the parameters in the following five rows
countRepeatInstances
optional
boolean
Whether to count repeat instances of a returned metric
includeAnnotations
optional
boolean
Whether to include annotations in the response
limit
optional
integer
The maximum number of items to return in the response
page
optional
integer
The maximum number of pages to return in the response
nonesBehavior
optional
string
Excludes instances with values of 0 if set to exclude-nones
statistics
optional
object
Contains the functions array
functions
optional
array
Contains col-max and col-min
col-max
optional
string
The column maximum
col-min
optional
string
The column minimum
capacityMetadata
optional
object
Contains associations array
associations
optional
array
Contains name and value parameters for each type of metadata associated with report; e.g., applicationName, projectId, projectName, and panelName
name
optional
string
The associated category type of the associated metadata
value
optional
string
The actual name or title specified for the metadata category in the report

Example response details

The response above shows the following top ten ranked pages for this month according to the pageViews, visits, and visitors metrics:

  1. home
  2. category 5
  3. category 2
  4. category 4
  5. category 3
  6. articles
  7. app: launch
  8. category 1
  9. forum
  10. leaf form: step 1

Additionally, the response above shows the following:

  • Each row section contains each report record.

  • The value property contains the dimension value.

  • The data property contains a list of metric counts for each metric requested.

  • The summaryData section contains a total of the metrics in the current report.

If you do not include a limit with your POST request, you can subsequently use the GET top items endpoint--described in a following section--to have only the top specified number of items returned.

Response parameters

The example response includes the following parameters:

ParameterTypeDescription
totalPages
integer
The total number of pages with data
firstPage
boolean
Whether to include the first page of results
lastPage
boolean
Whether to include the last page of results
numberOfElements
integer
The number of item elements in the report
number
integer
The number of pages, starting with 0
totalElements
integer
Total number of elements in the report
columns
object
Contains column and dimension data
dimension
object
Contains id and type
id
string
Name of the dimension
type
string
The dimension ID data type
columnIds
string
The column number in the table visualization, left to right, starting from 0
rows
container
Contains itemId, value and data
itemId
string
The item ID
value
string
The name specified for the itemId in the report
data
number($double)
The numerical values returned for the requested items
summaryData
object
Contains the ranked summary data information described in the following rows
filteredTotals
number($double)
The data totals after the specified filters are applied
annotations
string
Annotations for the summary data, if specified
totals
number($double)
The data totals
annotationExceptions
string
Exceptions for annotations
col-max
optional
The column maximum
col-min
optional
The column minimum

Retrieve top items

Use the GET Top Items request to return only the top items from the previous POST body, according the maximum number of items you want returned (excluding NonValues). They are returned in ranked order. You can specify the maximum with limit included as a query parameter in the request.

To make the request, use the following URI for your GET HTTP call:

GET https://analytics.adobe.io/api/{global-company-id}/reports/topItems

Example request

The following example shows a request for a top items report for the POST body shown above:

Copied to your clipboard
curl -X 'GET' \
'https://analytics.adobe.io/api/{global-company-id}/reports/topItems?rsid=examplersid=variables%2Fpage&locale=en_US&lookupNoneValues=false&limit=10&page=0' \
-H 'accept: application/json' \
-H 'x-api-key: 5a8dcc2cfa71472cbfa4fb53671c45ed' \
-H 'Authorization: {Bearer-token}

In this example, you append the previous request body to the cURL call. Note that this request specifies that NoneValues not be included and that the limit of items to return be 10.

The response for this request is the same as the example response shown above.

Partial Responses (206 Status Code)

A 206 status code indicates a partial response. This status code means that there were some columns in the reporting response that have errors. These errors can include any of the following:

  • Unauthorized Metric: User does not have access to the requested metric
  • Metric Not Enabled: The requested metric is not enabled in this report suite
  • Unauthorized Dimension: User does not have access to the requested dimension
  • Dimension Not Enabled: The requested dimension is not enabled in this report suite
  • Unauthorized Global Dimension: User does not have access to the global dimension for this request
  • Global Dimension Not Enabled: The global dimension for this request is not enabled in this report suite
  • Unexpected Number of Items: Anomaly Detection algorithm returned an unexpected number of anomalies
  • General Service Error: General Anomaly Detection service error

Additional information

For more information on the Reporting API, see the following resources:

  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.