Merge Document

Back to overview

Endpoint

POST https://api.reporting.cloud/v1/document/merge

Merges and returns a template from the template storage or an uploaded template with JSON data

Quota

This method counts against the document quota.

Request Parameters

Query parameter Value Type Value
returnFormat String A string that specifies the format of the created document. Possible values are: PDF, RTF, DOC, DOCX, HTML and TX.
templateName String Optional. The name of the template in the template storage. If no template is specified, the template must be uploaded in the MergeBody object of this request.
append Boolean Optional. Specifies whether the documents should be appened to one resulting document when more than 1 data row is passed.
test Boolean Optional. Specifies whether it is a test run or not. A test run is not counted against the quota and created documents contain a watermark. Not possible using the Free or Trial license.
Request body data Value type Value
ReportingCloud MergeBody object The MergeBody object contains the datasource as a JSON data object and optionally, a template encoded as a Base64 string and a ReportingCloud MergeSettings object.

MergeBody object

Key Value type Value description
mergeData JSON object The datasource for the merge process as a JSON array.
template Base64 encoded string Optional. The template encoded as a Base64 string. Supported formats are RTF, DOC, DOCX and TX.
mergeSettings ReportingCloud MergeSettings object Optional. Optional merge settings to specify merge properties and document properties such as title and author.

MergeSettings object

Key Value type Value description
removeEmptyFields Boolean Optional. Specifies whether empty fields should be removed from the template or not. The default value is true.
removeEmptyBlocks Boolean Optional. Specifies whether the content of empty merge blocks should be removed from the template or not. The default value is true.
removeEmptyImages Boolean Optional. Specifies whether images which don't have merge data should be removed from the template or not. The default value is false.
removeTrailingWhitespace Boolean Optional. Specifies whether trailing whitespace should be removed before saving a document. The default value is true.
author String Optional. Sets the document's author.
creationDate DateTime (String) Optional. Sets the document's creation date which will be saved in the document.
lastModificationDate DateTime (String) Optional. Sets the date the document is last modified.
creatorApplication String Optional. Sets the application, which has created the document.
documentSubject String Optional. Sets the document's subject string which will be saved in the document.
documentTitle String Optional. Sets the document's title that will be saved in the document.
userPassword String Optional. Specifies the password for the user to open the document.

Response Format

On success, the HTTP status code in the response header is OK (200). The response body contains an array of the created documents encoded as Base64 encoded strings.

A Forbidden (403) is returned, if the user is not authorized or the document quota is exceeded.

A Bad Request (400) is returned, if no data is found in the MergeBody object, no template is uploaded or template is not found in the template storage.

Examples

Note: The code examples available for this method do not represent all supported programming languages.

Try this in the Web API Sandbox

Open Sandbox