The Basics

Working with the /templates endpoint is a two steps process:

  1. Send your named template to the service: POST {{host}}/templates?templateName=Freemarker.HelloWorld ...template...

  2. Render your data with reference to the name of the template POST {{host}}/templates/render?templateName=Freemarker.HelloWorld

    { "UserName" : "Markus Schmidt" }

Templates are persisted. To manage your templates you can use the Get, Query, Upsert and Delete functions on the /template endpoint (see OpenAPI Description). Once a template is available (posted) you can use it with as many datasets you want, to /templates/render documents.

The rendered documents responded by the /templates/render endpoint are not persisted. However, you may want to use the Documents endpoint to persist the document in a business context.

Example

POST {{host}}/templates?templateName=Freemarker.HelloWorld
Content-Type: text/plain
Authorization: Basic {{basicToken}}

Hello ${UserName}!
Welcome to the Freemarker render engine.

###

POST {{host}}/templates/render?templateName=Freemarker.HelloWorld
Content-Type: application/json
Accept: text/plain
Authorization: Basic {{basicToken}}

{
    "UserName" : "Lisa Mueller"
}

###

POST {{host}}/templates/render?templateName=Freemarker.HelloWorld
Content-Type: application/json
Accept: text/plain
Authorization: Basic {{basicToken}}

Hello Markus Schmidt!
Welcome to the Freemarker render engine.

Last updated