Fetch a Report's Results

This endpoint retrieves the report's columns and rows, and, depending on the selected format, also the report's metadata. You can only fetch a report when its status is READY.

Method GET
URL /v2/reports/{reportId}/result
Header
  • Authentication header (x-o-api-key)
  • Accept:
    • text/plain: to retrieve result in CSV format
    • application/json: to retrieve results in JSON format, which includes the report's metadata
    • application/vnd.openxmlformats-officedocument.spreadsheetml.sheet: to retrieve results in Microsoft Excel format, the output should be saved as a .xlsx file.
Content type application/json
URL params Provide the ID of the report in the {reportId} parameter, which you get after successfully submitting a report for creation.
Query params -
Body -
Success response

HTTP status: 200 OK

Header:

Content-Disposition: the attached report in .csv, .json, or .xslx format.

Body:

"category_0", "category_0_name", "category", "category_name", "impression"
"11", "Sports","","",6598
"","","111","Football",8456
"","","112","Tennis",1574
"","","113","Basketball",567

or

{
  "metaData": {
    "reportDefinition": {
      "startDateTime": "2016-12-01T00:00:00+02:00",
      "endDateTime": "2017-01-01T00:00:00+02:00",
      "timeGranularity": "none",
      "dimensions": ["category", "category"],
      "metrics": ["impression"],
      "filters": []
    },
    "creationDate": 1516630971614,
    "name": "Impressions per category and subcategory december 2016",
    "rowCount": 4,
    "maxRows": 100000
  },
  "headers": [
    {
      "name": "category_0",
      "type": "STRING"
    },
    {
      "name": "category_0_name",
      "type": "STRING"
    },
    {
      "name": "category",
      "type": "STRING"
    },
    {
      "name": "category_name",
      "type": "STRING"
    },
    {
      "name": "impression",
      "type": "INTEGER"
    }
  ],
  "rows": [
    [
      "11",
      "Sports",
      "",
      "",
      6598
    ],
    [
      "",
      "",
      "111",
      "Football",
      8456
    ],
    [
      "",
      "",
      "112",
      "Tennis",
      1574
    ],
    [
      "",
      "",
      "113",
      "Basketball",
      567
    ]
  ]
}

or, output which needs to be saved as an .xslx file.

For reports created from 22 January 2018, the fields rowCount and maxRows in the JSON output allow you to see how close you are to reaching the limit of 100000 rows per report. If the data you are querying for exceeds the 100000 rows limit, your report will be incomplete.

To make sure you get a complete report, you should query for less data. Try the following tips:
  • Split reports based on time period. For example, query for each quarter separately instead of querying for an entire year.
  • Remove one or more campaigns or goals from your selected filters, or create a report per campaign.
  • Narrow down the data by selecting more filters.
  • Remove one or more of the selected dimensions. If you have selected one or more dimensions with a high cardinality, query them separately.
  • For the Time dimension, select a less granular breakdown of data. For example, select month instead of day.
Note: Only the JSON output contains the report's metadata. Putting the report definition in the CSV output would break the format and make it more difficult to import in spreadsheet software.
Note: The output to Microsoft Excel format contains a second sheet with the report filters used to create the report.

Example

Request header:

GET /v2/reports/e683514b-b4c9-4988-9b2f-9d6a6a300c08/result HTTP/1.1
Host: api.videoplaza.com
Accept: text/plain
x-o-api-key="<your key>"

Request body: -

Success response:

HTTP status:
  200 (OK)

Header:
  Content-Disposition: attachement; filename="name-of-report.csv"

Body:
  "category_0", "category_0_name", "category", "category_name", "impression"
  "11", "Sports","","",6598
  "","","111","Football",8456
  "","","112","Tennis",1574
  "","","113","Basketball",567

Was this article helpful?