Configuration Required to Run or Schedule Publisher Reports in Oracle Analytics Server Using REST API

April 20, 2024 | 4 minute read
Veera Raghavendra Rao Koka
Consulting Member of Technical Staff
Text Size 100%:

REDWOOD

This article describes how to use the REST API for Oracle Analytics Publisher to run or schedule Publisher reports in Oracle Analytics Server.

Oracle Analytics Publisher (formerly known as BI Publisher) is available in Oracle Analytics Server (OAS). You can deploy Oracle Analytics Server on Oracle Cloud Infrastructure (OCI) using Oracle Cloud Marketplace, Oracle Cloud Infrastructure (OCI) Compute, or on-premises.

Prerequisites

You must have the BI Service Administrator application role privileges to access Publisher and run or schedule Publisher reports.

REST API Commands to Authenticate

Oracle Analytics Publisher REST API supports HTTP basic authentication in environments that aren’t enabled for single sign-on (SSO).

This image shows SSO enabled through Publisher's Security Configuration page. Basic authentication doesn't work if you enable SSO using this approach.

SSO_OAP1

However, there are some exceptions. Basic authentication does work if your Oracle Analytics Server environment is SSO-enabled using a certified SSO provider such as Oracle Access Manager and custom SSO solutions, as described in the article  Single Sign-On Solutions for Oracle Analytics Server on On-Premise and on Oracle Cloud. In such cases, basic authentication works because the Oracle Analytics Publisher REST endpoint is excluded from SSO protection.

Oracle Analytics Publisher REST Endpoint

https://oas-server:port/xmlpserver/services/rest

To learn how to check the protected, public, and excluded resources for SSO, see Updating the Protected, Public, and Excluded Resources for an Enterprise Deployment.
 

Use the cURL Command-line Tool to Access the Oracle Analytics Publisher REST API

To use cURL, complete the following steps.

  1. Install cURL.
  2. Set the cURL environment variable.
  3. Invoke cURL.

For more information, refer to the documentation. See Use cURL.

Basic Authentication

curl -u username:password -H "Accept:application/json" -X GET https://host:port/xmlpserver/services/rest/v1/reports/<reportPath>

Example:

curl -u jsmith:mypassword1 -H "Accept:application/json" -X GET https://host:port/xmlpserver/services/rest/v1/reports/Sample%20Lite%252FPublished%20Reporting%252FReports%252FBalance%20Letter

Run a Publisher Report

When you send a request to run a specific report, the request is synchronized, and the response contains the report output.

For example, if the report Sample_Publisher_Report is in the /Shared Folders/SAND_BOX Catalog folder, specify SAND_BOX%252fSample_Publisher_Report as the absolute path for the report. Use %252f for each / (slash) in the folder path after the first folder under Shared Folders.

OAP_RO14

REST API Command to Run a Publisher Report

curl -X POST -u username:password -o SampleOAPReport.pdf -H "Content-Type:multipart/form-data" -v -F 'ReportRequest={"attributeFormat":"pdf"};"attributeTemplate":"Publisher Template"};type=application/json' https://<oas-servername:port>/xmlpserver/services/rest/v1/reports/SAND_BOX%252fSample_Publisher_Report/run

For example, to download the file SampleOAPReport.pdf, enter: -o SampleOAPReport.pdf.

For more information, refer to Oracle Analytics Publisher REST API.

Schedule a Publisher Report

When you schedule a job to run a report, you provide the parameter values for the report in a JSON file.

For example, create a payload as a JSON file (report2schedule.json) with the required Publisher report path and format, and pass the JSON file name as the data file to the REST API command to schedule the report.

{
  "dataModelUrl":"/SAND_BOX/Sample_Report_DM.xdm",
  "saveOutputOption":"true",
  "saveDataOption":"true",
  "reportRequest":{
    "reportAbsolutePath":"/SAND_BOX/Sample_Publisher_Report.xdo",
    "attributeFormat":"pdf"
    }
}

REST API Command to Schedule a Publisher Report

curl -X PUT -u username:password -H "Content-Type: application/json" -v -d @report2schedule.json https://<oas-servername:port>/xmlpserver/services/rest/v1/jobs/scheduleJob

You can check the scheduled job in the Job History page.

OAP_RO15

For more information, refer to Oracle Analytics Publisher REST API.

Configure the Web Server

Oracle HTTP Server or Apache HTTP Server

The Oracle Analytics Publisher REST API call to run a report has an endpoint with encoded slashes. For example:

  • SAND_BOX%252fSample_Publisher_Report

In this example, %252f is used to represent the slash.

To identify the endpoint as a valid URL, you must configure your Web Server.

  • Apache HTTP Server: "AllowEncodedSlashes On" in httpd.conf
  • Oracle HTTP Server: "WLForwardUriUnparsed On" in mod_wl_ohs.conf

Call to Action

You've learned how to use basic authentication, and run and schedule Publisher reports using the Publisher REST APIs on Oracle Analytics Server. Try them out yourself.

To explore more features, see REST API for Oracle Analytics Publisher in Oracle Analytics Server.

Once you've tried this yourself, share your results in the Oracle Analytics Community.

REDWOOD

 

Veera Raghavendra Rao Koka

Consulting Member of Technical Staff

Oracle Analytics Service Excellence, CEAL Team


Previous Post

Embedding Analytics for the Win

Andres Quintana | 4 min read

Next Post


Automating Oracle Analytics Server Silent Installation, Critical Patch Update, and Configuration on Linux