The resource Service

The resource service supports several HTTP methods to view, download, create, and modify resources in the repository.

GET is used to show the information about a specific resource. Getting a resource can serve several purposes:

In the case of JasperReports, also known as report units, this service returns the structure of the JasperReport, including resourceDescriptors for any linked resources.
For resources that contain files, specifying the fileData=true argument downloads the file content.
Specifying a query-based input control with arguments for running the query returns the dynamic values for the control.

A new service is also available to interact with report options. See section The v2/options Service.










For resources that contain a file, set this argument to true to download the file. When not specified, this argument is false by default and the method returns the description of the resource.



Used to get the items to fill an input control which subtend a query resource. The value of this parameter must be the URI of the data source to use to execute the query. Set the null string to use the default data source.

P_<param name>?


If the IC_GET_QUERY_DATA is specified, one or more parameters can be specified to be used in the query:

Use the "P_" prefix for single values.
Use the "PL_" prefix for list of values.

PL_<param name>?


Return Value on Success

Typical Return Values on Failure

200 OK – The body is either:

XML giving the resourceDescriptors that make up the resource, including nested descriptors.
The native content of the specified file.

404 Not Found – When the specified resource URI is not found in the repository

The GET method returns the structure and definition of resources in the repository, and using that information can be used to download any files attached to the resources. Resources are defined through resourceDescriptor tags in XML.

The following example shows the resource descriptor of a folder:

<resourceDescriptor name="datasources" wsType="folder" uriString="/datasources"
  <label>Data Sources</label>
  <description>Data Sources used by reports</description>
  <resourceProperty name="PROP_RESOURCE_TYPE">
  <resourceProperty name="PROP_PARENT_FOLDER"><value>/</value></resourceProperty>
  <resourceProperty name="PROP_VERSION"><value>0</value></resourceProperty>
  <resourceProperty name="PROP_HAS_DATA"><value>false</value></resourceProperty>

The following example shows the resource descriptor of a data source. The various resourceProperty tags define the properties of the data source, specific to the JNDI type:

<resourceDescriptor name="SugarCRMDataSourceJNDI" wsType="jndi"
  uriString="/analysis/datasources/SugarCRMDataSourceJNDI" isNew="false">
  <label>SugarCRM Data Source JNDI</label>
  <description>SugarCRM Data Source JNDI</description>
  <resourceProperty name="PROP_RESOURCE_TYPE">
  <resourceProperty name="PROP_PARENT_FOLDER"><value>/analysis/datasources</value>
  <resourceProperty name="PROP_VERSION"><value>0</value></resourceProperty>
  <resourceProperty name="PROP_DATASOURCE_JNDI_NAME"><value>jdbc/sugarcrm</value>

The following example shows the resource descriptor of a query resource, with properties for the query string and query language:

<resourceDescriptor name="CustomerCityQuery" wsType="query"
  uriString="/datatypes/CustomerCityQuery" isNew="false">
  <label>Customer City Query</label>
  <description>Retrieves names of all customers' home cities</description>
  <resourceProperty name="PROP_RESOURCE_TYPE">
  </resourceProperty><resourceProperty name="PROP_PARENT_FOLDER">
  <resourceProperty name="PROP_VERSION"><value>0</value></resourceProperty>
  <resourceProperty name="PROP_HAS_DATA"><value>false</value></resourceProperty>
  <resourceProperty name="PROP_IS_REFERENCE"><value>false</value></resourceProperty>
  <resourceProperty name="PROP_QUERY">
    <value>select distinct from customer</value></resourceProperty>
  <resourceProperty name="PROP_QUERY_LANGUAGE"><value>sql</value></resourceProperty>