Create a template for notification.

POST {{baseUrl}}/templates

Create a new template definition for sending notifications. Templates can be created for Email, SMS and PUSH type of notifications. When providing templates, the place holders defined in the templates need to be specified as params in the api metadata attribute. Provided below is a sample template for reference.

 Dear PlantEngineer,

   The regular maintenance of the machines is completed for %FactoryName%. Please plan to start the assembly line.

 Kind regards,
 Maintenance Engineer

While creating a template definition for the above sample template, provide FactoryName as params in metadata attribute.
The maximum size of the email template is limited to 8 MB. However, the email message resulting from the Email template along with its attachments is limited by the email size limit; i.e. 8 MB.
In case of SMS, the sms message resulting from the template is limited to maximum size of SMS notification; i.e. 1500 bytes.
The following table lists the supported filetypes for various notifications:

Notification typeSupported filetypes
Email.html, .txt
SMS.txt
Push*.json

Templates for Push notification should follow the model as described in definitions/PushMessageModel.

Request Body

[{"name"=>"metadata", "value"=>"<json>", "datatype"=>"string"}, {"name"=>"templateFile", "value"=>nil, "datatype"=>"null"}]

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring
Acceptstring

RESPONSES

status: Created

{&quot;name&quot;:&quot;FactoryAlertTemplate&quot;,&quot;type&quot;:&quot;SMS&quot;,&quot;id&quot;:&quot;0bff7e7a-cd25-4576-9908-4180ef086174&quot;,&quot;templateFileName&quot;:&quot;FactoryNotificationTemplate.html&quot;,&quot;params&quot;:[{&quot;sunta&quot;:{},&quot;fugiat7&quot;:{},&quot;ea86&quot;:{},&quot;ex7&quot;:{},&quot;veniam_30&quot;:{},&quot;Lorem_e0&quot;:{},&quot;irure0&quot;:{},&quot;cillum_9&quot;:{},&quot;esse_8&quot;:{},&quot;quia&quot;:{},&quot;doec&quot;:{},&quot;elit_68c&quot;:{},&quot;dolorf1&quot;:{}},{&quot;id_ed1&quot;:{},&quot;sinte_&quot;:{},&quot;laborea01&quot;:{},&quot;nostrud_46&quot;:{},&quot;aliqua1dd&quot;:{},&quot;aliquip60&quot;:{},&quot;consectetur0&quot;:{},&quot;sede&quot;:{},&quot;nulla_d&quot;:{},&quot;quis_0a0&quot;:{},&quot;do_&quot;:{},&quot;irure_315&quot;:{},&quot;ut_e&quot;:{},&quot;ut2&quot;:{},&quot;nisi39&quot;:{},&quot;ut8&quot;:{},&quot;enim_f&quot;:{},&quot;esse_36&quot;:{},&quot;eu_b&quot;:{},&quot;Excepteur4&quot;:{},&quot;occaecate6&quot;:{},&quot;occaecat_52&quot;:{},&quot;voluptate_e&quot;:{},&quot;laboris_6e0&quot;:{},&quot;nulla_d8d&quot;:{},&quot;enim8&quot;:{},&quot;aliquip_09f&quot;:{},&quot;adipisicing_e9e&quot;:{},&quot;aliquipd&quot;:{},&quot;in_d1d&quot;:{}}],&quot;eTag&quot;:&quot;1&quot;}