Page 1

Templates

In case you are using the SharedAccount make sure your template names are unique, because you are "sharing" your templates with other users. I recommend to preceed your template name with"{CompanyName}.". For example: MSPro.Invoice.Ok.EMail

Alternatively, you can get a dedicated account.

Create or update a template

A simple Freemarker template containing two placeholders.

POST {{host}}/Templates?templateName={{templateName}}
Content-Type: text/plain
Authorization: Basic {{basicToken}}

Hello ${contact.firstname} ${contact.lastname} - direct POST!

To understand the syntaxt of a template, see Freemarker template engine.

Render a document

To render a document we refer to the template's name and send (POST) the data to the service:

POST {{host}}/render?templateName={{templateName}}
Content-Type: application/json
Authorization: Basic {{basicToken}}

{
    "contact" : {
        "firstname" : "Markus",
        "lastname" : "Schmidt"
    }
}
HTTP/1.1 200 OK
Content-Type: text/plain; charset=utf-8

Hello Markus Schmidt - direct POST!

Last updated