Example reporting API calls

Use the following examples to help supplement the creation of API calls in your own organization. You can also use the Debugger within Analysis Workspace to view API calls tailored to your organization.

data-variant=info
data-slots=text
Adobe may add optional request and response members (name/value pairs) to existing API objects at any time and without notice or changes in versioning. Adobe recommends that you refer to the API documentation of any third-party tool you integrate with our APIs so that such additions are ignored in processing if not understood. If implemented properly, such additions are non-breaking changes for your implementation. Adobe will not remove parameters or add required parameters without first providing standard notification through release notes.

Ranked report example

A basic report that uses a dimension and a metric. This example retrieves the top 5 eVar1 dimension values, sorted by the most page views.

data-variant=info
data-slots=text
If no dimension is provided, the response will contain only summaryData and not contain a dimension breakdown. For more information, see the Report API overview.
data-slots=heading, code
data-repeat=2
data-languages=JSON,JSON

Request body

{
   "rsid":"examplersid",
   "globalFilters":[
      {
         "type":"dateRange",
         "dateRange":"YYYY-11-30T00:00:00.000/YYYY-12-06T23:59:59.999"
      }
   ],
   "metricContainer":{
      "metrics":[
         {
            "columnId":"0",
            "id":"metrics/pageviews",
            "filters":[
               "0"
            ]
         }
      ],
      "metricFilters":[
         {
            "id":"0",
            "type":"dateRange",
            "dateRange":"YYYY-10-31T00:00:00.000/YYYY-12-06T23:59:59.999"
         }
      ]
   },
   "dimension":"variables/evar1",
   "settings":{
      "dimensionSort":"asc",
      "limit":5
   }
}

Response

{
   "totalPages":8,
   "firstPage":true,
   "lastPage":false,
   "numberOfElements":5,
   "number":0,
   "totalElements":40,
   "columns":{
      "dimension":{
         "id":"variables/evar1",
         "type":"string"
      },
      "columnIds":[
         "0"
      ]
   },
   "rows":[
      {
         "itemId":"0",
         "value":"Unspecified",
         "data":[
            11560.0
         ]
      },
      {
         "itemId":"219343969",
         "value":"15",
         "data":[
            524.0
         ]
      },
      {
         "itemId":"349230650",
         "value":"7",
         "data":[
            4420.0
         ]
      },
      {
         "itemId":"511036305",
         "value":"11",
         "data":[
            1631.0
         ]
      },
      {
         "itemId":"743855946",
         "value":"10",
         "data":[
            2032.0
         ]
      }
   ],
   "summaryData":{
      "totals":[
         104310.0
      ]
   }
}

Example trended report

These reports include information about the performance of a metric (or metrics) over a period of time. This example retrieves the number of visits for each day over a week period.

data-slots=heading, code
data-repeat=2
data-languages=JSON,JSON

Request body

{
   "rsid":"examplersid",
   "globalFilters":[
      {
            "type":"dateRange",
            "dateRange":"YYYY-10-31T00:00:00.000/YYYY-11-06T23:59:59.999"
      }
   ],
   "metricContainer":{
      "metrics":[
         {
            "columnId":"0",
            "id":"metrics/pageviews",
            "filters":[
               "0"
            ]
         }
      ],
      "metricFilters":[
         {
            "id":"0",
            "type":"dateRange",
            "dateRange":"YYYY-10-31T00:00:00.000/YYYY-11-06T23:59:59.999"
         }
      ]
   },
   "dimension":"variables/daterangeday",
   "settings":{
      "dimensionSort":"asc"
   }
}

Response:

{
   "totalPages":1,
   "firstPage":true,
   "lastPage":false,
   "numberOfElements":7,
   "number":0,
   "totalElements":7,
   "columns":{
      "dimension":{
         "id":"variables/daterangeday",
         "type":"time"
      },
      "columnIds":[
         "0"
      ]
   },
   "rows":[
      {
         "itemId":"1171131",
         "value":"Oct 31, YYYY",
         "data":[
            794.0
         ]
      },
      {
         "itemId":"1180001",
         "value":"Nov 1, YYYY",
         "data":[
            16558.0
         ]
      },
      {
         "itemId":"1180002",
         "value":"Nov 2, YYYY",
         "data":[
            17381.0
         ]
      },
      {
         "itemId":"1180003",
         "value":"Nov 3, YYYY",
         "data":[
            17384.0
         ]
      },
      {
         "itemId":"1180004",
         "value":"Nov 4, YYYY",
         "data":[
            17442.0
         ]
      },
      {
         "itemId":"1180005",
         "value":"Nov 5, YYYY",
         "data":[
            17417.0
         ]
      },
      {
         "itemId":"1180006",
         "value":"Nov 6, YYYY",
         "data":[
            17334.0
         ]
      }
   ],
   "summaryData":{
      "totals":[
         104310.0
      ]
   }
}

Media Concurrent Viewers report example

Media concurrent viewers report is a time series report with two specialized metrics.

These metrics can be rolled up to different granularity based on the dimension. For example unique visitors per minute or unique visitors per day etc. These are different dimensions available for media concurrent viewers report.

The following request example includes both a JSON message request body to request number of unique visitors.

data-slots=heading, code
data-repeat=2
data-languages=JSON,JSON

Request body

{
    "rsid": "examplersid",
    "locale": "en_US",
    "dimension": "variables/daterangeminute",
    "globalFilters": [
        {
            "dateRange": "YYYY-08-01T00:00/YYYY-08-01T00:05",
            "type": "dateRange"
        }
    ],
    "metricContainer": {
        "metrics": [
            {
                "columnId": "column1",
                "id": "metrics/concurrent_viewers_visitors"
            }
        ]
    },
    "settings": {
        "dimensionSort": "asc",
        "limit": "100",
        "page": 0
  }
}

Response

{
    "totalPages": 1,
    "firstPage": true,
    "lastPage": true,
    "numberOfElements": 5,
    "number": 0,
    "totalElements": 5,
    "columns": {
        "dimension": {
            "id": "variables/daterangeminute",
            "type": "time"
        },
        "columnIds": [
            "column1"
        ]
    },
    "rows": [
        {
            "itemId": "11907010000",
            "value": "00:00 YYYY-08-01",
            "data": [
                326.0
            ]
        },
        {
            "itemId": "11907010001",
            "value": "00:01 YYYY-08-01",
            "data": [
                258.0
            ]
        },
        {
            "itemId": "11907010002",
            "value": "00:02 YYYY-08-01",
            "data": [
                202.0
            ]
        },
        {
            "itemId": "11907010003",
            "value": "00:03 YYYY-08-01",
            "data": [
                148.0
            ]
        },
        {
            "itemId": "11907010004",
            "value": "00:04 YYYY-08-01",
            "data": [
                79.0
            ]
        }
    ],
    "summaryData": {
        "filteredTotals": [
            1285.0
        ],
        "totals": [
            22346.0
        ]
    }
}