Visualizations display data from BIRT documents and BIRT data objects. The REST API accesses visualizations using the /visuals resource. The /visuals resource can export visualizations to documents and spreadsheets for download, or access them directly for web and mobile applications. You can also access the data displayed in a visualization and pass that data to another application. Accessing the data provides the application developer with the ability to present the data visually in any required format.
Most visuals requests use a unique file ID number obtained by the /files and /folders resources to access RPTDESIGN or RPTDOCUMENT files. Requests that use the /visuals resource can generate content from dynamic data sources, schedule recurring jobs, and convert a report document to different file formats. The /visuals resource can access the contents of a rich visualization including formatted data, bookmarked objects, and parameters. The /visuals resource can also create more rich visualizations from existing executables on a scheduled or immediate basis.
The following sections provide an example of using each visuals resource as a curl command and detailed information about the response returned by the resource.
GET visuals/{visualId}/bookmarks
The following URI requests the bookmarks from the file with file ID 580000000100 when accompanied by a GET method:
GET /ihub/v1/visuals/580000000100/bookmarks HTTP/1.1
Host: myserver.mycompanyname.com:5000
AuthId: <authId>
This curl example requests the bookmarks from the file with the file ID 580000000100 in the default volume:
The following URI requests the content referenced by the bookmark Revenue Table from the file with file ID 580000000100 when accompanied by a GET method:
GET /ihub/v1/visuals/580000000100/bookmarks/Revenue%20Table HTTP /1.1
Host: myserver.mycompanyname.com:5000
AuthId: <authId>
This curl example requests content referenced by the bookmark Revenue Table from the file with the file ID 580000000100 in the default volume:
This curl example sends a POST request to iHub to run the report design with the file ID 100000000100 and save the document to /Sales/myOutput.rptdocument in the default volume:
This example sends a request to iHub to run a low priority job to convert the report document with the file ID 640000000100 to the output file name /Sales/Sales Analysis.pdf:
POST /ihub/v1/visuals/640000000100/schedule/now HTTP/1.1
This curl example sends a POST request to iHub run a job to convert the report document with the file ID 640000000100 to a PDF file in the default volume:
This example sends a request to iHub to schedule a report job to run the report design identified by the file ID number 640000000100 once at 8:45 p.m. exactly:
POST /ihub/v1/visuals/640000000100/schedule/once HTTP/1.1
This curl example sends a POST request to iHub to run the report design with the file ID 640000000100 as a job at 8:45 p.m. on the current day and save the output as a rptdocument file in the default volume:
This example sends a request to iHub to run the report design with the file ID 640000000100 every week on Monday and Thursday at midnight from January 1, 2014 to December 31, 2014:
POST /ihub/v1/visuals/640000000100/schedule/recurring HTTP/1.1
This curl example sends a POST request to iHub to run the report design with the file ID 640000000100 as a job at midnight every Monday and Thursday from January 1, 2014 through December 31, 2014 and save the output as a .rptdocument file in the default volume:
curl -i http://%RESTHost%:5000/ihub/v1/visuals/640000000100 /schedule/recurring ‑X POST ‑H "AuthId:%RESTAuthId%" ‑d fileType=rptdesign ‑d outputFileName="/Sales/Revenue History by Product Line" ‑d outputFileFormat=RPTDOCUMENT ‑d frequency ="Weekly" ‑d scheduleDay="Mon,Thu" ‑d scheduleTime="00:00:00" ‑d startDate=2014-01-01 ‑d endDate="2014-12-31"
GET visuals/{visualId}/parameters
The following URI requests the parameters from the file with file ID 940000000100 when accompanied by a GET method:
GET /ihub/v1/visuals/940000000100/parameters HTTP/1.1
Host: myserver.mycompanyname.com:5000
AuthId: <authId>
This curl example requests the parameters from the file with the file ID 940000000100 in the default volume:
The following URI requests the parameter picklist for the parameter pCustomer from the file with file ID 430000000100. pCustomer is in the cascading parameter group Customer Selection. The value of the preceding parameter in the group, pCountry, is Canada:
GET /ihub/v1/visuals/430000000100/parameters /picklist?cascadingGroupName=Customer%20Selection¶mName= pCustomer&precedingParamValues={"ParameterValue":[{"Name": "pCountry","Value":"Canada"}]}&fileType=RPTDESIGN HTTP/1.1
Host: myserver.mycompanyname.com:5000
AuthId: <authId>
This curl example requests the parameter picklist for the parameter pCustomer from the file with the file ID 430000000100 in the default volume: