We released a new endpoint to the ReportingCloud Web API to append documents.
https://api.reporting.cloud/v1/document/append
This new endpoint combines documents by appending them divided by a new section, paragraph or nothing. This endpoint can be used to assemble documents in various formats to one resulting document. Typically, single, separate templates are merged and then appended to create a document that contains all documents in one.
In the payload of the POST request, the documents are posted as an array of Base64 encoded strings and document divider options that define how the documents are separated.
Request Parameters
Query parameter | Value Type | Value |
---|---|---|
returnFormat | String | A string that specifies the format of the created document. Possible values are: PDF, PDFA, RTF, DOC, DOCX, HTML and TX. |
POST Payload
The payload of the request contains the AppendBody object.
Request body data | Value Type | Value |
---|---|---|
ReportingCloud AppendBody object | The AppendBody object contains the templates encoded as a Base64 strings and a ReportingCloud DocumentSettings object. |
AppendBody Object
The AppendBody object consists of an array of AppendDocument objects and a DocumentSettings object .
Key | Value Type | Value |
---|---|---|
documents | ReportingCloud AppendDocument object | The documents that are appended including divider options. |
documentSettings | ReportingCloud DocumentSettings object | Optional document settings to specify document properties such as title and author. |
DocumentSettings Object
This object contains adjustable settings that will be applied to the created document.
Key | Value Type | Value |
---|---|---|
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. |
AppendDocument Object
This object contains the document itself as an Base64 encoded string and the document divider.
Key | Value Type | Value |
---|---|---|
document | String | The document as a Base64 encoded string. |
documentDivider | Integer | The document divider option. Possible values: 1 (None), 2 (NewParagraph), 3 (NewSection). |
Learn more about this endpoint in the ReportingCloud reference.
Happy coding!