ReportServer publishes several REST API endpoints automatically which can be used for accessing given REST services.
You can find the main REST endpoint of your ReportServer in the ''General Info'' system console. Here, you can find a ''REST URL'' entry which displays the complete URL to your REST endpoint. An example is given below.
REST URL: https://SERVER:PORT/reportserverbasedir/reportserver/rest
Having this base URL it is easy to append the services described below to access the specific REST services available.
Note that spaces in URLs will be encoded as
REST API authentication uses an apikey analogously as in executing reports via URL (see Section 7.11.). Once you set an apikey for a given user, you can access all REST services using this apikey in the URL, e.g. for the ''general-info'' REST service:
https://SERVER:PORT/reportserverbasedir/reportserver/rest/general-info?user=myuser&apikey=MYAPIKEY
In the example above, the user authenticated is myuser and the apikey is MYAPIKEY.
The test REST service issues a test request which allows you to make sure the REST endpoint is correct and available.
The syntax is:
https://SERVER:PORT/reportserverbasedir/reportserver/rest/test?user=myuser&apikey=MYAPIKEY
The general-info REST service returns a JSON containing your system configuration. Basically, it contains all data available in the ''General Info'' system console.
The syntax is:
https://SERVER:PORT/reportserverbasedir/reportserver/rest/general-info?user=myuser&apikey=MYAPIKEY
The dot-renderer REST service allows you to render a Graphviz DOT file (https://graphviz.org/doc/info/lang.html) into a SVG file which can be displayed directly by your web browser.
The syntax is:
https://SERVER:PORT/reportserverbasedir/reportserver/rest/dot-renderer?user=myuser&apikey=MYAPIKEY
In order to render internal files you need to make a GET request and must specify an additional query variable path, which points to the DOT file in your ReportServer virtual filesystem, in this case to /fileserver/resources/graph.dot.
In order to render arbitrary external data you need to make a POST request and use the request body to specify the dot-data you want to render in plain text.
(POST) https://SERVER:PORT/reportserverbasedir/reportserver/rest/dot-renderer?user=myuser&apikey=MYAPIKEY
Don't forget to include your external DOT file in your POST request body.
An optional width parameter may be used to change the SVG file's width. Default is 1200.
An optional wrap_html parameter may be used to wrap the SVG output with an empty header and a body in which the result is embedded. By default this option is set to false. Be aware of the fact that this option changes the content type from image/svg+xml to text/html!
The markdown-renderer REST service allows you to render a markdown file (https://www.markdownguide.org/) to an HTML representation. While most markdown commands are supported, there are exceptions which cannot be translated directly to HTML and will not be rendered properly. Refer to Chapter 13. for details.
The syntax is:
Similar to dot-renderer, in order to render internal files you need to make a GET request and must specify an additional query variable path, which points to the markdown file in your ReportServer virtual filesystem, in this case to /fileserver/resources/example.md.
In order to render arbitrary external data you need to make a POST request and use the request body to specify the markdown-data you want to render in plain text.
Don't forget to include your external markdown file in your POST request body.
An optional wrap_html parameter may be used to wrap the HTML output with an empty header and a body in which the result is embedded. By default this option is set to false.
The node-exporter REST service allows you to export any node to XML in an analogous way as the ''export'' functionality described in Section 10. Along with the XML export, some metadata is displayed in the JSON file.
The syntax is dependent on the specific node being exported and will be described in the following subsections. All nodes support a flatten parameter. If this parameter is set to true, all objects exported are flattened, i.e. all folders are stripped off.
As an example, consider exporting all reports with the following syntax:
You can always use the terminal for finding out the exact path of the node you want to export. Just navigate to the node you to export and enter the pwd command as described in Section 20.50.
The node-exporter service can be used to export reports or report directories using the following syntax:
where /reportmanager/myreports/myreport is a path to the report being exported. You can also export a complete report directory, e.g. /reportmanager/myreports.
An optional includeVariants parameter is used to export variants along with the base reports. Default is false:
The node-exporter service can be used to export users, groups or organizational units using the following syntax:
where /usermanager/ClassicModelCars/myuser is a path to the user or group being exported. You can also export a complete organizational unit, e.g. /usermanager/ClassicModelCars.
The node-exporter service can be used to export datasources or datasource directories using the following syntax (spaces in URLs will be coded as %20, further information on URL encoding you wilL find, for instance under http://www.w3schools.com/tags/ref_urlencode.asp):
where /datasources/internal datasources/ReportServer Data Source is a path to the datasource being exported. You can also export a complete directory, e.g. /datasources/internal datasources.
The node-exporter service can be used to export datasink or datasink directories using the following syntax:
where /datasinks/mydirectory/mydatasink is a path to the datasink being exported. You can also export a complete directory, e.g. /datasinks/mydirectory.
The node-exporter service can be used to export files or file directories from the virtual file system using the following syntax:
where /fileserver/mydirectory/myfile.groovy is a path to the file being exported. You can also export a complete directory, e.g. /fileserver/mydirectory.
The node-exporter service can be used to export remote servers or remote server directories using the following syntax:
where /remoteservers/mydirectory/myremoteserver is a path to the remote server being exported. You can also export a complete directory, e.g. /remoteservers/mydirectory.
The node-exporter service can be used to export transports or transport directories using the following syntax:
where /transports/mydirectory/mytransport is a path to the transport being exported. You can also export a complete directory, e.g. /transports/mydirectory.
Note that if you are exporting a specific transport, you have to enter its key. E.g.:
where a5f9000b91ea0a85c3ab8a9a35cbec65aa1a609a is the transport's key.
The node-exporter service can be used to export dashboards or dashboard library directories using the following syntax (spaces in URLs will be coded as %20, further information on URL encoding you wilL find, for instance under http://www.w3schools.com/tags/ref_urlencode.asp)::
where /dashboardlib/mydirectory/Demo Dashboard is a path to the dashboard being exported. You can also export a complete directory, e.g. /dashboardlib/mydirectory.