Create dataview reports
Dataview reports return the data associated with an existing data view. To create a dataview report, use the following endpoint:
POST https://cja.adobe.io/reports
Example request
data-slots=heading, code
data-repeat=1
data-languages=CURL
Request
curl -X POST "https://cja.adobe.io/reports" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-H "x-api-key: {API_KEY}" \
-H "x-gw-ims-org-id: {ORG_ID}" \
-H "Authorization: Bearer {ACCESS_TOKEN}" \
-d '{
"rsid": "dv_example_dataview_id",
"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"
]
}
}'
Example response
data-slots=heading, code
data-repeat=1
data-languages=JSON
Response
{
"totalPages": 877,
"firstPage": true,
"lastPage": false,
"numberOfElements": 10,
"number": 0,
"totalElements": 8768,
"columns": {
"dimension": {
"id": "variables/page",
"type": "string"
},
"columnIds": [
"0",
"1",
"2"
]
},
"rows": [
{
"itemId": "3306266643",
"value": "home",
"data": [
219567,
151478,
151478
]
},
{
"itemId": "2796092754",
"value": "category 5",
"data": [
90943,
71248,
71248
]
},
{
"itemId": "1738577623",
"value": "category 2",
"data": [
84192,
69067,
69067
]
}
],
"summaryData": {
"filteredTotals": [
3080619,
357996,
357996
],
"totals": [
3080619,
424407,
424407
],
"col-max": [
219567,
151478,
151478
],
"col-min": [
1,
1,
1
]
}
}
Request parameters
The following table describes the request parameters for the POST /reports endpoint:
Parameter
Required
Type
Description
rsidRequired
String
Data view ID (report suite ID for CJA)
globalFiltersOptional
Array
Contains
type, dateRange, and dateRangeIdtypeOptional
String
The type of filter applied
dateRangeOptional
String
The date range of the data
dateRangeIdOptional
String
The label for the date range; e.g.,
thisMonthmetricContainerOptional
Object
Contains
metrics arraymetricsOptional
Array
Contains
columnId, id, and sortcolumnIdOptional
String
The column number in the table visualization, left to right, starting from
0idOptional
String
The name of the element for the column; e.g., the name of the
metricsortOptional
String
The sorting applied to the column data--
asc or descdimensionRequired
String
The dimension used for the report
settingsOptional
Object
The settings requested for the reporting response
countRepeatInstancesOptional
Boolean
Whether to count repeat instances of a returned metric
includeAnnotationsOptional
Boolean
Whether to include annotations in the response
limitOptional
Integer
The maximum number of items to return in the response
pageOptional
Integer
The page number to return in the response
nonesBehaviorOptional
String
Excludes instances with values of
0 if set to exclude-nonesstatisticsOptional
Object
Contains the
functions arrayfunctionsOptional
Array
Contains
col-max and col-minResponse parameters
The following table describes the response parameters for the POST /reports endpoint:
Parameter
Type
Description
totalPagesInteger
The total number of pages with data
firstPageBoolean
Whether this is the first page of results
lastPageBoolean
Whether this is the last page of results
numberOfElementsInteger
The number of item elements in the report
numberInteger
The page number, starting with
0totalElementsInteger
Total number of elements in the report
columnsObject
Contains column and
dimension datadimensionObject
Contains
id and typeidString
Name of the dimension
typeString
The
dimension ID data typecolumnIdsArray
The column numbers in the table visualization
rowsArray
Contains
itemId, value and dataitemIdString
The item ID
valueString
The name specified for the
itemId in the reportdataArray
The numerical values returned for the requested items
summaryDataObject
Contains the summary data information
filteredTotalsArray
The data totals after the specified filters are applied
totalsArray
The data totals
col-maxArray
The column maximum values
col-minArray
The column minimum values