Create SMS Template
The Create SMS Template API adds SMS templates into Engagement server.
Note: This API will create an SMS Template for Text, Voice and WhatsApp SMS.
URL
The HTTP URL for Create SMS Template API is:
http://<host>:<port>/api/v1/templates/smstemplates
Method
POST
Header
The payload's request header includes Content-Type as application/json;charset=UTF-8.
Input Parameters
The following fields are input parameters:
| Input Parameter | Required | Type | Description |
|---|---|---|---|
| smsType | Yes | string | SMS Type either SMS/Voice or WhatsApp |
| templatename | Yes | string | The unique name assigned to a template |
| template | Yes | string | SMS template details |
| mediaUrl | Optional | string | Subject of the WhatsApp SMS message Multimedia URL see |
SMS/Voice Sample Request
{
"smsType": "SMS/Voice",
"templateName": "Amazon Customer Service",
"template": " Hello. How we can help you ##Mobile Number##"
}
Sample Response
{
"id" : "4",
"message" : "Details added successfully"
}
WhatsApp Sample Request
{
"smsType": "WhatsApp",
"templateName": "Amazon Customer Service Online",
"template": " Hello. How we can help you ##Mobile Number##",
"mediaUrl":"https://whatsappmedia-6692.twil.io/images.jpg"
}
Sample Response
{
"id" : "5",
"message" : "Details added successfully"
}
Response Status
| Code | Description |
|---|---|
| Status 200 | Details added successfully |
| Status 400 | Template already existing with given nameTemplate name is requiredTemplate is required |
| Status 401 | Unauthorized request |
| Status 500 | Server failure to process request |