ReportingCloud: Uploading Templates Vs. Sending Templates Inside MergeBody
Our reporting Web API ReportingCloud provides two different ways to upload templates for merging processes: Upload templates into the template storage in a separate step Upload templates inside MergeBody when merging a document Templates (that usually doesn't contain sensitive data) can be stored in the ReportingCloud template storage. Using the Web API, potentially sensitive data is sent to our servers in JSON format. ReportingCloud merges this data with the template and returns a resulting…

Our reporting Web API ReportingCloud provides two different ways to upload templates for merging processes:
- Upload templates into the template storage in a separate step
- Upload templates inside MergeBody when merging a document
Templates (that usually doesn't contain sensitive data) can be stored in the ReportingCloud template storage. Using the Web API, potentially sensitive data is sent to our servers in JSON format. ReportingCloud merges this data with the template and returns a resulting document.
We never store any merge data nor created documents on our servers at any time. Only transaction meta data to log the transaction is stored to provide statistics and to calculate the document quota.
Read more about privacy and data security in this article:
ReportingCloud: Web service privacy and data security
When to Use Which Option?
Naturally, the merge process is faster, if the template has been already uploaded to the template storage. If you reuse templates many times, it makes sense to upload the templates to the storage, so that the template must not be uploaded every time the template is merged.
To upload a template to the template storage, ReportingCloud provides an extensive API to manage the template storage.
The /templates/upload endpoint can be used to upload a template.
https://api.reporting.cloud/v1/templates/upload
In this method, the template data is sent encoded as a Base64 string along with a template name for the template storage. Template names are unique and existing templates with the same name will be overwritten. It is recommended to check first whether a template with that name exists using the /templates/exists endpoint.
https://api.reporting.cloud/v1/templates/exists
In order to delete a template from the template storage, the /templates/delete endpoint should be used.
https://api.reporting.cloud/v1/templates/delete
When merging templates that are stored in the template storage, the template name is given in the /document/merge endpoint's optional request parameter templateName:
https://api.reporting.cloud/v1/document/merge?templateName=test_invoice.tx
In case the template is very dynamic or if you don't want to store templates in the template storage for other reasons, the template can be sent within the merge request. The MergeBody object that is sent within the POST request body data contains not only the merge data, but also the template data in this case:
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. |
The template is temporarily uploaded to our servers, unpacked in memory, merged and deleted after the merge process. At no time, this template is stored physically on our servers.
If you want to test this on your own, register today for a free 30-day trial license.
Happy coding!
Cloud
Are we moving to the cloud? This question is changing from "if" to "when" and "how". Text Control ReportingCloud brings complete reporting functionality to the cloud so all developers can use it, irrespective of the platform or language they're using. Its highly RESTful API can be used to merge Microsoft Word compatible templates with JSON data from all clients including .NET, Javascript, PHP, Node.JS, jQuery, Ruby, Python, Android, Java and iOS.
Related Posts
MailMerge: Table Headers and Repeating Blocks
When using table headers and repeating blocks in combination in a MailMerge process, there are some things you need to know before creating your templates. A table header can consist of n number…
ReportingCloud: Conditional Text Blocks Based on Merge Blocks
In several applications, it is required to render or to remove a complete text block in a template based on specific conditions. The following screenshot shows a template with a merge block…
Web API Test Sandbox Released on ReportingCloud Portal
We just released a Web API Test Sandbox at the ReportingCloud portal. This sandbox can be used to test Web API calls with your account data and your template storage (so not a completely isolated…
ReportingCloud: New Test Parameter for Document Quota Related Endpoints
The quota related endpoints merge, convert and findandreplace received the new, optional parameter test to send test calls that doesn't count against the document quota. This parameter allows you…
ReportingCloud: The MergeData JSON Object Format Explained
When merging templates with data, a JSON object contains merge data for all merge fields and merge blocks in the document. Using the language specific wrappers, the JSON object is created…