MSPro Services
About
  • MSPro.Services
    • Endpoints
      • Documents
        • Document Properties
          • Rank
          • Context
        • Use-Cases
          • Service Requests
          • CSV Files Import and data processing
      • Render Engine
        • The Basics
        • Templates on the /docs endpoint
          • Page 1
      • The Mirror
    • Hosting
    • Plans
    • Accounts
      • SharedAccount
    • General Information
      • HTTP-Status Codes
      • Custom Headers
      • Response Schema
  • MSPro Client
Powered by GitBook
On this page
  • Templates
  • Create or update a template
  • Render a document
  1. MSPro.Services
  2. Endpoints
  3. Render Engine
  4. Templates on the /docs endpoint

Page 1

Last updated 2 months ago

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 .

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 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!

get a dedicated account
Freemarker