Knowledge Center

Knowledge Center > Reporting > API Reference > Export Report Run

Export Report Run

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 Export Report Run Reporting API returns the report run data results as comma separated values (CSV).   

Export Report Run requires a ReportRunId value as a request path value. You can obtain the ReportRunId from the id value in the JSON response to a call of Get Last Completed Run or get it from the response to the Run a Report call. 

Request

Environment Request
API Sandbox (US Data Center) GET https://zconnectsandbox.zuora.com/api/rest/v1/reportruns/export/{ReportRunId}?pivoted={Pivoted} 
Production (US Data Center) GET https://zconnect.zuora.com/api/rest/v1/reportruns/export/{ReportRunId}?pivoted={Pivoted}
API Sandbox (EU Data Center) GET https://zconnect.sandbox.eu.zuora.com/api/rest/v1/reportruns/export/{ReportRunId}?pivoted={Pivoted}
Production (EU Data Center) GET https://zconnect.eu.zuora.com/api/rest/v1/reportruns/export/{ReportRunId}?pivoted={Pivoted}

Request Parameter

ReportRunId

required

path

The unique identifier for a report run. You can get the ReportRunId from the id value in the JSON response to Run a Report or get it from the response to the Get Last Completed Run call.

Pivoted

optional

boolean

Specifies the layout of summary report results. This parameter does not affect detail report results.

If true, the rows and columns in the CSV file are grouped in the same way as the report results displayed in the Zuora user interface.

If false (default), the CSV file is formatted as a flat table.

Response

The response from Export Report Run will be a text message sent with a CSV file attachment.  Here is an example response header made generic with variable names, {VariableName}, substituted for some field values :

Date:  {ResponseTimeStamp}

Server:  Apache Tomcat

Content-Disposition:  attachment; filename={DataSource}-{ReportName}.csv

Content-Type:  text/csv;charset=UTF-8

Content-Length:  {ContentLength}

Connection:  close

Content-Disposition shows the CSV file sent by a successful invocation of Export Report Run. The report results CSV file name will be: {DataSource}-{ReportName}.csv, where {DataSource} is the data source name used by the report and {ReportName} is the name of the report.

Example

HTTPS Request 

GET https://zconnectsandbox.zuora.com/rest/v1/reportruns/export/ff8080815242b012015261b9f77009a0

JSON Response

Date:  Wed, 27 Jan 2016 22:03:27 GMT
Server:  Apache Tomcat
Content-Disposition:  attachment; filename=InvoiceItemAdjustment-Daily-Invoices-Detail-Report-Detail.csv
Content-Type:  text/csv;charset=UTF-8
Content-Length:  344
Connection:  close
Invoice.CreatedDate,Account.Currency,Invoice.Amount,BillToContact.AccountId
2013-12-07T14:18:00-0800,USD,900,2c90838f42cf16030142cf215ecb0014
2013-11-07T11:20:00-0800,USD,400,402892f9423062950142308c64e503f3
2014-01-20T15:19:01-0800,EUR,984,8a858290439c517a0143b1edf32800ba
2014-01-20T15:24:00-0800,CAD,1729.76,8a858290439c517a0143b1f4229c013f

Exceptions

Exception Condition
"message" : "There are errors when exporting the report."
"errorCode" : "ZAN-USAGE-REST-ERROR"
The ReportRunId value may not be correct. Check the value submitted.
Bad Request; That's a bad request API endpoint or submission is incorrect.
header: HTTP/1.1 401 Unauthorized Basic authentication failed. Check apiAccessKeyId or apiSecretAccessKey.
Last modified
18:58, 21 Jun 2017

Tags

Classifications

(not set)