Knowledge Center

Knowledge Center > Reporting > API Reference > Run a Report

Run a Report

Contact Zuora Global Support to enable this feature in your tenant. This feature is currently in development and is subject to change without advance notice.

The Run a Report Reporting API starts a new report run and returns the ReportRunId.  

Run a Report requires the ReportId value as a request path value. You can obtain the ReportId from the id value in the JSON response to a call of Search by Report Names or you can get it definitively from the response to the Create a Report call. 

 

Request

Environment Request
API Sandbox (US Data Center) POST https://zconnectsandbox.zuora.com/api/rest/v1/reports/{ReportId}/reportrun?viewType={viewType} 
Production (US Data Center) POST https://zconnect.zuora.com/api/rest/v1/reports/{ReportId}/reportrun?viewType={viewType}
API Sandbox (EU Data Center) POST https://zconnect.sandbox.eu.zuora.com/api/rest/v1/reports/{ReportId}/reportrun?viewType={viewType}
Production (EU Data Center) POST https://zconnect.eu.zuora.com/api/rest/v1/reports/{ReportId}/reportrun?viewType={viewType}

The Run a Report POST request body must be submitted as JSON content.  Set the body content type to "application/json" in the request header: Content-Type: application/json

Request Path Parameters

ReportId

required

path

The unique identifier for a report.

You can obtain the ReportId from the id value in the JSON response to a call of Search by Report Names or you can get it definitively from the response to the Create a Report call.

viewType required query

The value of viewType must be either Detail or Summary depending on the report definition.

Request Body

You can use the request body to specify filters on either the Detail report or Summary report part of the report definition when the report is run. This enables you to restrict the report run results according to criteria that you define.

For example, if you have a Detail report based on the Product data source, with CreatedDate as a selected field, you could specify the following filter in the request body:

[
  {
    "field": {
      "name": "CreatedDate",
      "id": "Product.CreatedDate",
      "label": "Created Date",
      "type": "datetime",
      "sortDir": "ASC",
      "dataSourceName": "Product",
      "dataSourceLabel": "Product",
      "searchKey": "Product Created Date",
      "filterable": true,
      "sortable": true,
      "groupable": true
    },
    "operator": "<",
    "value": "2017-07-06T03:00:02.822Z"
  }
]

CreatedDate could also be a Column, Row, or Value field in a Summary report.

If you want to run a report without any filters or modification, set the request body to [].

Response

A successful call to Run a Report will return the ID of the report run (reportRunId). Use this ID with Get Report Run to check the status of the report run.

To retrieve the results of the completed report run, use Get Report Data or Export Report Run.

The ID of the report run expires after 60 days.

Example

Request URL:

POST https://zconnectsandbox.zuora.com/api/rest/v1/reports/ff808081529f4e3401529fd373730070/reportrun?viewType=Detail

Request body:

[
  {
    "field": {
      "name": "CreatedDate",
      "id": "Product.CreatedDate",
      "label": "Created Date",
      "type": "datetime",
      "sortDir": "ASC",
      "dataSourceName": "Product",
      "dataSourceLabel": "Product",
      "searchKey": "Product Created Date",
      "filterable": true,
      "sortable": true,
      "groupable": true
    },
    "operator": "<",
    "value": "2017-07-06T03:00:02.822Z"
  }
]
{
  "success": true,
  "response": {
    "reportRunId": "ff808081529f4e3401529fd61f080074"
  }
}
Last modified

Tags

Classifications

(not set)