Run report

post

/services/rest/v1/reports/{reportPath}/run

Sends a request to the Publisher to run a specific report. The request is synchronized, and the response contains the report output.

Request

Supported Media Types
Path Parameters
  • URL encoded report path. For example, if your report path is "/Sample Lite/Published Reporting/Reports/Balance Letter" then your encoded report path will be "%2FSample%20Lite%2FPublished%20Reporting%2FReports%2FBalance%20Letter". Use double encoded forward slash when you send a REST request to BI Publisher through a load balancer that isn't configured to pass encoded slashes. For example, if your report path is "/Sample Lite/Published Reporting/Reports/Balance Letter" then your encoded report path will be Sample%20Lite%252FPublished%20Reporting%252FReports%252FBalance%20Letter
Form Parameters
  • Report data. "Content-Type: application/octet-stream"
  • Report request. "Content-Type: application/json". Check the ReportRequest of Get report parameters (/services/rest/v1/reports/{reportPath}/parameters) for JSON structure.
Back to Top

Response

Supported Media Types

200 Response

Returns the report output as multipart/form-data having two parts. 1) ReportResponse having "Content-Type: application/json". 2) ReportOutput having "Content-Type: application/octet-stream".
Body ()
Root Schema : ReportResponse
Type: object
Show Source
Nested Schema : ReportResponseMetaData
Type: object
Show Source
Nested Schema : MetaDataList
Type: object
Show Source
Back to Top

Examples

Simple run report request and response

The following example shows how to run a report by submitting a POST request on the REST resource using cURL:

curl -i \
     --header 'Authorization: Bearer <token>' \
     --header 'Content-Type: application/json' \
     --request POST \
     -F 'ReportRequest={"attributeFormat":"pdf",
    "attributeTemplate":"Publisher Template"}' \
     -o output.pdf \
     'https://hostname/xmlpserver/services/rest/v1/reports/BalanceLetter'

This example represents the response:

--Boundary_4_543972006_1465550732053
Content-Type: application/json
Content-Disposition: form-data; name="ReportResponse"

{"reportContentType":"application/pdf"}
--Boundary_4_543972006_1465550732053
Content-Type: application/octet-stream
Content-Disposition: form-data; filename="xmlp3001677868600512506tmp"; modification-date="Fri, 10 Jun 2017 09:25:32 GMT"; size=7638; name="ReportOutput"

<Report output. For example PDF,HTML,EXCEL content>
--Boundary_4_543972006_1465550732053--

Run a report with custom report data

This example shows the request structure to run a report with custom report data:

--Boundary_3_384617262_1465550732541
Content-Type: application/json
Content-Disposition: form-data; name="ReportRequest"

{"byPassCache":true,"flattenXML":false}
--Boundary_3_384617262_1465550732541
Content-Type: application/xml
Content-Disposition: form-data; filename="Balance Letter.xml"; modification-date="Tue, 01 Jan 2000 07:35:28 GMT"; size=24700; name="ReportData"

<Report XML Data Content>
--Boundary_3_384617262_1465550732541--

This example represents the response:

--Boundary_6_656616533_1465550732888
Content-Type: application/json
Content-Disposition: form-data; name="ReportResponse"

{"reportContentType":"application/pdf"}
--Boundary_6_656616533_1465550732888
Content-Type: application/octet-stream
Content-Disposition: form-data; filename="xmlp2661880851808387788tmp"; modification-date="Fri, 01 Jan 2000 09:25:32 GMT"; size=7647; name="ReportOutput"

<Report output. For example PDF,HTML,EXCEL content>
--Boundary_6_656616533_1465550732888--

Run a report by passing parameter values

This example shows the request structure to pass the parameter values and run the report:

curl -i \
     --header 'Authorization: Bearer <token>' \
     --header 'Content-Type: application/json' \
     --request -o report_output.xml
   -F 'ReportRequest={"attributeFormat":"xml",
    "attributeTemplate":"Publisher Template",
    "parameterNameValues":{"listOfParamNameValues": 
      {"item": [{"name": "dept","values": { "item": "10" }},
       {"name": "emp","values": { "item": "*" }}]}}};
    type=application/json' 
   'https://hostname/xmlpserver/services/rest/v1/reports/BalanceLetter/run'

This example represents the response:

POST xmlpserver/services/rest/v1/reports/sal/run HTTP/1.1

Accept: */*
Content-Length: 393
Expect: 100-continue
Content-Type:multipart/form-data; 
boundary=----------------------------70dcb3a85b79
Back to Top