Create report

post

/services/rest/v1/reports

Creates a report in the catalog. You can set the path to the data model, and supply template files and translation (XLIFF) files to the report definition.

Request

Supported Media Types
Form Parameters
Back to Top

Response

201 Response

Report successfully created.

400 Response

An error occurred while creating the report
Back to Top

Examples

Simple create report request

The following example shows how to create a simple report by submitting a POST request on the REST resource using cURL.

curl -i \
     --header 'Authorization: Bearer <token>' \
     --request POST \
     -F 'ReportRequest={"absolutePath":"/FolderName/SubFolderName", "dataModelPath":"/Sample Lite/Published Reporting/Data Models/Balance Letter Datamodel.xdm","name":"ReportName","update":false};type=application/json' \
     'https://hostname/xmlpserver/services/rest/v1/reports'

Where:

  • name (string): Name of the report. Do not suffix it with .xdo. For example, specify name="myreport" (not name="myreport.xdo").

  • absolutePath (string): Path to the folder where you want to save the report. For example: xmlp/Reports/financials

  • dataModelPath (string): Path to the data model that will be used as the data source for this report. For example: xmlp/Reports/financials/Data Models/my data model.xdm

  • templateFileName(string): File name of the template to add the report definition.

  • xliffFileName (string): File name of the translation XLIFF file, appended with the locale as follows:

    • template_<language code>_<country code>.xlf

    where:

    • language_code is the two-letter ISO 639 language code

    • country_code is the two-letter ISO 639 language code

    For example: template_en_us.xlf

  • update (boolean): If true, overwrites the existing report. If false, throws an error if the report exists.

Create a report with a custom template

The following example shows the request structure to create a report with a custom template (RTFTemplate.rtf):

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

{"absolutePath":"FolderName/SubFolderName/","dataModelPath":"/Sample Lite/Published Reporting/Data Models/Balance Letter Datamodel.xdm","name":"ReportName","update":false}
--Boundary_4_1611832218_1465550158746
Content-Type: application/octet-stream
Content-Disposition: form-data; filename="RTFTemplate.rtf"; modification-date="Tue, 01 Jan 2000 07:35:28 GMT"; size=486813; name="TemplateData"

<Template Content>
--Boundary_4_1611832218_1465550158746--

Create a report with a custom template and XLIFF data

The following example shows the request structure to create a report with a custom template and translation file (sampleTranslation.xlf):

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

{"absolutePath":"FolderName/SubFolderName/","dataModelPath":"/Sample Lite/Published Reporting/Data Models/Balance Letter Datamodel.xdm","name":"ReportName","templateFileName":"sample_en_US.rtf","update":false,"xliffFileName":"samplexliff_en_IN.xlf"}
--Boundary_5_474488818_1465547908933
Content-Type: application/octet-stream
Content-Disposition: form-data; filename="BalanceLetter_Template.rtf"; modification-date="Tue, 01 Jan 2000 07:35:28 GMT"; size=486813; name="TemplateData"

<Template Data>
--Boundary_5_474488818_1465547908933
Content-Type: application/octet-stream
Content-Disposition: form-data; filename="sampleTranslation.xlf"; modification-date="Tue, 01 Jan 2000 07:35:28 GMT"; size=6447; name="XliffData"

<XLIFF Data>
--Boundary_5_474488818_1465547908933--

Example of the Response Body

The following example shows the contents of the response body in JSON format.

* Connection #0 to host hostname left intact
Back to Top