Fetch report results

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

Method GET
URL https://api.videoplaza.com/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 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 XLSX 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 XLSX 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 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, and does not contain a total or subtotals like the Microsoft Excel sheet you can download from the Report view in the user interface.
Note:

When running audience reports:

You might find the following segment values in your segmentation breakdowns:
  • undefined - 'SegmentationId-SegmentId' not found, for example undefined ´1-0´not found: this means you passed in an unknown segment in the ad request and Pulse recorded events for it (segmentId=0 in our example). You should make sure you are passing in correct values in your ad requests. This does not occur if you filter and breakdown on the same segmentation.
  • undefined - Missing value: this means events were recorded, but are not associated with the requested segmentation dimension. For example, you are breaking down today's data by gender, and there are events on male and female segments, but there are also events that are not associated with the gender segmentation. This does not occur if you filter and breakdown on the same segmentation.

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: attachment; 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