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
  1. MSPro.Services
  2. Endpoints
  3. Render Engine

The Basics

Last updated 2 months ago

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 ). Once a template is available (posted) you can use it with as many datasets you want, to /templates/render documents.

Be aware:

If you use the SharedAccount to manage your templates, you are "sharing" your templates with other users on the same (public) account. Everyone can read or modify your templates, or, if someone else uses the same template name, he might "highjack" your template content. It is recommended to add {company name}. in front of the name of your template name, for example: MSPro.Invoice.EMail.

Alternatively, you can get a , where your information is no longer shared.

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.
OpenAPI Description
dedicated account