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

The REST body payload requires content to call Run a Report successfully.  You can Run a Report with the minimum request body value of:  [] This pair of square brackets runs the report without any filters or modification.

The Run a Report request body can be used to set filters on either the Detail report or the Summary report part of the report definition for your report invocation.  You can set filters to restrict the results according to criteria you define.  

For example, if you had a report created using the Product data source with CreatedDate selected as a Detail report selection or as either a Column, Row, or Value selection in that Summary report, then you could specify this filter in the REST body of the Run a Report call:

[   
   {      
       "field": {
       "name": "CreatedDate",
       "id": "Product.CreatedDate",
       "label": "Created Date",
       "type": "date",
       "sortDir": "ASC",
       "dataSourceName": "Product",
       "dataSourceLabel": "Product",
       "searchKey": "Product Created Date",
       "filterable": true,
       "sortable": true,
       "groupable": true

       },
     "operator": "<",
     "value": "2015-07-06T03:00:02.822Z"
   }
]

Response

A successful invocation of Run a Report will result in a JSON response with the ReportRunId.  You can do many things with a ReportRunId for example you can use it to get the report result data with Get Report Data or Export Report Run.

The ReportRunId value expires after 60 days.

Example

HTTPS/JSON Request 

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": "date",
       "sortDir": "ASC",
       "dataSourceName": "Product",
       "dataSourceLabel": "Product",
       "searchKey": "Product Created Date",
       "filterable": true,
       "sortable": true,
       "groupable": true

       },
     "operator": "<",
     "value": "2015-07-06T03:00:02.822Z"
   }
]

JSON Response:

{
  "success" : true,
  "response" : {
    "reportRunId" : "ff808081529f4e3401529fd61f080074"
  }
}
Last modified
21:46, 21 Jun 2017

Tags

Classifications

(not set)