We just released a new endpoint to the ReportingCloud Web API:

http://api.reporting.cloud/v1/templates/info

This endpoint returns information about a template located in the template storage. It returns a JSON structure with the template name, the contained merge fields, the nested merge block structure and included merge fields of the merge blocks.

The following sample CURL shows the usage and the return value:

Loading...
Loading...

The wrappers implement a new TemplateInfo object that returns the merge block and merge field structure like in this sample:

Loading...
Loading...

This new method allows you to retrieve the contained merge fields of a template. Consider the following scenario: You would like to create an HTML form with input elements based on merge fields of a template. Using the templates/info endpoint, you can loop through all fields in order to create input form elements for user input. After the users completed this HTML form, you can merge back the data into the template in order to create a resulting document.

Start today with ReportingCloud and sign up for a free trial account.

Happy coding!