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": {
    "creationDate": 1506681978650,
    "name": "Impressions per category and subcategory december 2016",
    "rowCount": 4,
    "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": []
    }
  },
  "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.

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.

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="e683514b-b4c9-4988-9b2f-9d6a6a300c08.csv"

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

해당 내용이 도움 되었습니까?