http://api.example.com/{version}
This module dedicated for storing templates and generating text, html, xml, doc, docx etc from the template.
Add a new template
POST /templates
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Template",
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Template id"
},
"description": {
"type": "string",
"description": "Template description"
},
"outputFormats": {
"type": "array",
"items": {
"type": "string"
},
"description": "Array of output formats"
},
"templateResolver": {
"type": "string",
"description": "Template engine name"
},
"localizedTemplates": {
"type": "object",
"description": "List of localized templates",
"additionalProperties": {
"type": "object",
"description": "Template content",
"$schema": "http://json-schema.org/draft-04/schema#",
"additionalProperties": false,
"properties": {
"header": {
"type": "string",
"pattern": "\\S+.*",
"description": "Template for header"
},
"body": {
"type": "string",
"pattern": "(?s)\\S+.*",
"description": "Template for body"
},
"attachments": {
"description": "List of attachments",
"id": "attachments",
"type": "array",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Message attachment",
"additionalProperties": false,
"properties": {
"contentType": {
"type": "string",
"description": "Content type"
},
"name": {
"type": "string",
"description": "Name"
},
"description": {
"type": "string",
"description": "Description"
},
"data": {
"type": "string",
"description": "Attachment data"
},
"disposition": {
"type": "string",
"description": "Disposition"
},
"contentId": {
"type": "string",
"description": "Content id"
}
}
}
}
},
"required": [
"header",
"body"
]
}
},
"metadata": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Metadata Schema",
"properties": {
"createdDate": {
"description": "Date and time when the record was created",
"type": "string",
"format": "date-time"
},
"createdByUserId": {
"description": "ID of the user who created the record",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"createdByUsername": {
"description": "Username of the user who created the record (when available)",
"type": "string"
},
"updatedDate": {
"description": "Date and time when the record was last updated",
"type": "string",
"format": "date-time"
},
"updatedByUserId": {
"description": "ID of the user who last updated the record",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"updatedByUsername": {
"description": "Username of the user who last updated the record (when available)",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"createdDate",
"createdByUserId"
]
}
},
"required": [
"templateResolver",
"localizedTemplates",
"outputFormats"
]
}
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Template",
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Template id"
},
"description": {
"type": "string",
"description": "Template description"
},
"outputFormats": {
"type": "array",
"items": {
"type": "string"
},
"description": "Array of output formats"
},
"templateResolver": {
"type": "string",
"description": "Template engine name"
},
"localizedTemplates": {
"type": "object",
"description": "List of localized templates",
"additionalProperties": {
"type": "object",
"description": "Template content",
"$schema": "http://json-schema.org/draft-04/schema#",
"additionalProperties": false,
"properties": {
"header": {
"type": "string",
"pattern": "\\S+.*",
"description": "Template for header"
},
"body": {
"type": "string",
"pattern": "(?s)\\S+.*",
"description": "Template for body"
},
"attachments": {
"description": "List of attachments",
"id": "attachments",
"type": "array",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Message attachment",
"additionalProperties": false,
"properties": {
"contentType": {
"type": "string",
"description": "Content type"
},
"name": {
"type": "string",
"description": "Name"
},
"description": {
"type": "string",
"description": "Description"
},
"data": {
"type": "string",
"description": "Attachment data"
},
"disposition": {
"type": "string",
"description": "Disposition"
},
"contentId": {
"type": "string",
"description": "Content id"
}
}
}
}
},
"required": [
"header",
"body"
]
}
},
"metadata": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Metadata Schema",
"properties": {
"createdDate": {
"description": "Date and time when the record was created",
"type": "string",
"format": "date-time"
},
"createdByUserId": {
"description": "ID of the user who created the record",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"createdByUsername": {
"description": "Username of the user who created the record (when available)",
"type": "string"
},
"updatedDate": {
"description": "Date and time when the record was last updated",
"type": "string",
"format": "date-time"
},
"updatedByUserId": {
"description": "ID of the user who last updated the record",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"updatedByUsername": {
"description": "Username of the user who last updated the record (when available)",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"createdDate",
"createdByUserId"
]
}
},
"required": [
"templateResolver",
"localizedTemplates",
"outputFormats"
]
}
Bad request
Media type: text/plain
Type: any
Example:
Bad request
Validation errors
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"errors": {
"id": "errors",
"type": "array",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"properties": {
"message": {
"type": "string"
},
"type": {
"type": "string"
},
"code": {
"type": "string"
},
"parameters": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
}
},
"required": [
"message"
]
}
},
"total_records": {
"type": "integer"
}
}
}
Example:
{
"errors": [
{
"message": "may not be null",
"type": "1",
"code": "-1",
"parameters": [
{
"key": "moduleTo",
"value": "null"
}
]
}
]
}
Internal server error
Media type: text/plain
Type: any
Example:
Internal server error
Get a list of templates
GET /templates
Skip over a number of elements by specifying an offset value for the query
Example:
0
Limit the number of elements returned in the response
Example:
10
A query string to filter templates based on matching criteria in fields.
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"description": "Collection of templates",
"properties": {
"templates": {
"type": "array",
"description": "List of templates",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Template",
"properties": {
"id": {
"type": "string",
"description": "Template id"
},
"description": {
"type": "string",
"description": "Template description"
},
"outputFormats": {
"type": "array",
"items": {
"type": "string"
},
"description": "Array of output formats"
},
"templateResolver": {
"type": "string",
"description": "Template engine name"
},
"localizedTemplates": {
"type": "object",
"description": "List of localized templates",
"additionalProperties": {
"type": "object",
"description": "Template content",
"$schema": "http://json-schema.org/draft-04/schema#",
"additionalProperties": false,
"properties": {
"header": {
"type": "string",
"pattern": "\\S+.*",
"description": "Template for header"
},
"body": {
"type": "string",
"pattern": "(?s)\\S+.*",
"description": "Template for body"
},
"attachments": {
"description": "List of attachments",
"id": "attachments",
"type": "array",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Message attachment",
"additionalProperties": false,
"properties": {
"contentType": {
"type": "string",
"description": "Content type"
},
"name": {
"type": "string",
"description": "Name"
},
"description": {
"type": "string",
"description": "Description"
},
"data": {
"type": "string",
"description": "Attachment data"
},
"disposition": {
"type": "string",
"description": "Disposition"
},
"contentId": {
"type": "string",
"description": "Content id"
}
}
}
}
},
"required": [
"header",
"body"
]
}
},
"metadata": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Metadata Schema",
"properties": {
"createdDate": {
"description": "Date and time when the record was created",
"type": "string",
"format": "date-time"
},
"createdByUserId": {
"description": "ID of the user who created the record",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"createdByUsername": {
"description": "Username of the user who created the record (when available)",
"type": "string"
},
"updatedDate": {
"description": "Date and time when the record was last updated",
"type": "string",
"format": "date-time"
},
"updatedByUserId": {
"description": "ID of the user who last updated the record",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"updatedByUsername": {
"description": "Username of the user who last updated the record (when available)",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"createdDate",
"createdByUserId"
]
}
},
"required": [
"templateResolver",
"localizedTemplates",
"outputFormats"
]
}
},
"totalRecords": {
"type": "integer"
}
},
"required": [
"templates",
"totalRecords"
]
}
Bad request
Media type: text/plain
Type: any
Example:
Bad request
Internal server error
Media type: text/plain
Type: any
Example:
Internal server error
Get template by id
GET /templates/{templateId}
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Template",
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Template id"
},
"description": {
"type": "string",
"description": "Template description"
},
"outputFormats": {
"type": "array",
"items": {
"type": "string"
},
"description": "Array of output formats"
},
"templateResolver": {
"type": "string",
"description": "Template engine name"
},
"localizedTemplates": {
"type": "object",
"description": "List of localized templates",
"additionalProperties": {
"type": "object",
"description": "Template content",
"$schema": "http://json-schema.org/draft-04/schema#",
"additionalProperties": false,
"properties": {
"header": {
"type": "string",
"pattern": "\\S+.*",
"description": "Template for header"
},
"body": {
"type": "string",
"pattern": "(?s)\\S+.*",
"description": "Template for body"
},
"attachments": {
"description": "List of attachments",
"id": "attachments",
"type": "array",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Message attachment",
"additionalProperties": false,
"properties": {
"contentType": {
"type": "string",
"description": "Content type"
},
"name": {
"type": "string",
"description": "Name"
},
"description": {
"type": "string",
"description": "Description"
},
"data": {
"type": "string",
"description": "Attachment data"
},
"disposition": {
"type": "string",
"description": "Disposition"
},
"contentId": {
"type": "string",
"description": "Content id"
}
}
}
}
},
"required": [
"header",
"body"
]
}
},
"metadata": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Metadata Schema",
"properties": {
"createdDate": {
"description": "Date and time when the record was created",
"type": "string",
"format": "date-time"
},
"createdByUserId": {
"description": "ID of the user who created the record",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"createdByUsername": {
"description": "Username of the user who created the record (when available)",
"type": "string"
},
"updatedDate": {
"description": "Date and time when the record was last updated",
"type": "string",
"format": "date-time"
},
"updatedByUserId": {
"description": "ID of the user who last updated the record",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"updatedByUsername": {
"description": "Username of the user who last updated the record (when available)",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"createdDate",
"createdByUserId"
]
}
},
"required": [
"templateResolver",
"localizedTemplates",
"outputFormats"
]
}
Template not found
Media type: text/plain
Type: any
Example:
Template not found
Internal server error
Media type: text/plain
Type: any
Example:
Internal server error
Modify a template
PUT /templates/{templateId}
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Template",
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Template id"
},
"description": {
"type": "string",
"description": "Template description"
},
"outputFormats": {
"type": "array",
"items": {
"type": "string"
},
"description": "Array of output formats"
},
"templateResolver": {
"type": "string",
"description": "Template engine name"
},
"localizedTemplates": {
"type": "object",
"description": "List of localized templates",
"additionalProperties": {
"type": "object",
"description": "Template content",
"$schema": "http://json-schema.org/draft-04/schema#",
"additionalProperties": false,
"properties": {
"header": {
"type": "string",
"pattern": "\\S+.*",
"description": "Template for header"
},
"body": {
"type": "string",
"pattern": "(?s)\\S+.*",
"description": "Template for body"
},
"attachments": {
"description": "List of attachments",
"id": "attachments",
"type": "array",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Message attachment",
"additionalProperties": false,
"properties": {
"contentType": {
"type": "string",
"description": "Content type"
},
"name": {
"type": "string",
"description": "Name"
},
"description": {
"type": "string",
"description": "Description"
},
"data": {
"type": "string",
"description": "Attachment data"
},
"disposition": {
"type": "string",
"description": "Disposition"
},
"contentId": {
"type": "string",
"description": "Content id"
}
}
}
}
},
"required": [
"header",
"body"
]
}
},
"metadata": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Metadata Schema",
"properties": {
"createdDate": {
"description": "Date and time when the record was created",
"type": "string",
"format": "date-time"
},
"createdByUserId": {
"description": "ID of the user who created the record",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"createdByUsername": {
"description": "Username of the user who created the record (when available)",
"type": "string"
},
"updatedDate": {
"description": "Date and time when the record was last updated",
"type": "string",
"format": "date-time"
},
"updatedByUserId": {
"description": "ID of the user who last updated the record",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"updatedByUsername": {
"description": "Username of the user who last updated the record (when available)",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"createdDate",
"createdByUserId"
]
}
},
"required": [
"templateResolver",
"localizedTemplates",
"outputFormats"
]
}
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Template",
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Template id"
},
"description": {
"type": "string",
"description": "Template description"
},
"outputFormats": {
"type": "array",
"items": {
"type": "string"
},
"description": "Array of output formats"
},
"templateResolver": {
"type": "string",
"description": "Template engine name"
},
"localizedTemplates": {
"type": "object",
"description": "List of localized templates",
"additionalProperties": {
"type": "object",
"description": "Template content",
"$schema": "http://json-schema.org/draft-04/schema#",
"additionalProperties": false,
"properties": {
"header": {
"type": "string",
"pattern": "\\S+.*",
"description": "Template for header"
},
"body": {
"type": "string",
"pattern": "(?s)\\S+.*",
"description": "Template for body"
},
"attachments": {
"description": "List of attachments",
"id": "attachments",
"type": "array",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Message attachment",
"additionalProperties": false,
"properties": {
"contentType": {
"type": "string",
"description": "Content type"
},
"name": {
"type": "string",
"description": "Name"
},
"description": {
"type": "string",
"description": "Description"
},
"data": {
"type": "string",
"description": "Attachment data"
},
"disposition": {
"type": "string",
"description": "Disposition"
},
"contentId": {
"type": "string",
"description": "Content id"
}
}
}
}
},
"required": [
"header",
"body"
]
}
},
"metadata": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Metadata Schema",
"properties": {
"createdDate": {
"description": "Date and time when the record was created",
"type": "string",
"format": "date-time"
},
"createdByUserId": {
"description": "ID of the user who created the record",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"createdByUsername": {
"description": "Username of the user who created the record (when available)",
"type": "string"
},
"updatedDate": {
"description": "Date and time when the record was last updated",
"type": "string",
"format": "date-time"
},
"updatedByUserId": {
"description": "ID of the user who last updated the record",
"type": "string",
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"updatedByUsername": {
"description": "Username of the user who last updated the record (when available)",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"createdDate",
"createdByUserId"
]
}
},
"required": [
"templateResolver",
"localizedTemplates",
"outputFormats"
]
}
Template not found
Media type: text/plain
Type: any
Example:
Template not found
Internal server error
Media type: text/plain
Type: any
Example:
Internal server error
Delete template by id
DELETE /templates/{templateId}
process specified template using given context
POST /template-request
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Request for template processing",
"type": "object",
"properties": {
"templateId": {
"type": "string",
"description": "Target template id"
},
"lang": {
"type": "string",
"description": "Target template language"
},
"outputFormat": {
"type": "string",
"description": "Output format"
},
"context": {
"type": "object",
"description": "Context object"
}
},
"required": [
"templateId",
"lang",
"outputFormat"
],
"additionalProperties": false
}
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Result of template processing",
"type": "object",
"properties": {
"templateId": {
"type": "string",
"description": "Source template id"
},
"result": {
"type": "object",
"description": "Template processing output",
"$schema": "http://json-schema.org/draft-04/schema#",
"additionalProperties": false,
"properties": {
"header": {
"type": "string",
"pattern": "\\S+.*",
"description": "Template for header"
},
"body": {
"type": "string",
"pattern": "(?s)\\S+.*",
"description": "Template for body"
},
"attachments": {
"description": "List of attachments",
"id": "attachments",
"type": "array",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Message attachment",
"additionalProperties": false,
"properties": {
"contentType": {
"type": "string",
"description": "Content type"
},
"name": {
"type": "string",
"description": "Name"
},
"description": {
"type": "string",
"description": "Description"
},
"data": {
"type": "string",
"description": "Attachment data"
},
"disposition": {
"type": "string",
"description": "Disposition"
},
"contentId": {
"type": "string",
"description": "Content id"
}
}
}
}
},
"required": [
"header",
"body"
]
},
"meta": {
"type": "object",
"description": "Template output metadata",
"properties": {
"size": {
"type": "integer",
"description": "Size of output in bytes"
},
"dateCreate": {
"type": "string",
"format": "date-time",
"description": "Date of template processing"
},
"lang": {
"type": "string",
"description": "Processed template language"
},
"outputFormat": {
"type": "string",
"description": "Output format"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
Media type: text/plain
Type: any
Example:
Bad request
Validation errors
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"errors": {
"id": "errors",
"type": "array",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"properties": {
"message": {
"type": "string"
},
"type": {
"type": "string"
},
"code": {
"type": "string"
},
"parameters": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
}
},
"required": [
"message"
]
}
},
"total_records": {
"type": "integer"
}
}
}
Example:
{
"errors": [
{
"message": "may not be null",
"type": "1",
"code": "-1",
"parameters": [
{
"key": "moduleTo",
"value": "null"
}
]
}
]
}
Media type: text/plain
Type: any
Example:
Internal server error