Create report
/services/rest/v1/reports
Request
- multipart/form-data
-
ReportRequest(required):
Report metadata having "Content-Type: application/json". Check the examples section for JSON structure details.
-
TemplateData: file
Template file. "Content-Type: application/octet-stream"
-
XliffData: file
Translation file (XLIFF). "Content-Type: application/octet-stream"
Response
201 Response
400 Response
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