post https://yourapihubdomain.io/v1/message-templates
This API is used to create an SMS message template. The content and description should be provided in base64 format.
Know your endpoint
Based on the domain you use to log in to Webex Campaign, the endpoint domain for your API varies. For more information, refer to the Know Your API Endpoints section.
Headers
The following table describes the request headers:
Request Header | Description |
---|---|
content-type | application/json |
authorization | Access token or API Secret Key in Bearer format Example: Bearer $(key) |
Body Parameters
The following table describes the elements in the request body:
Parameter | Type | Mandatory | Description |
---|---|---|---|
channel | String | Mandatory | Specifies the channel. The options are: * sms |
smsTemplate | Object | Mandatory | Specifies the content for the SMS template. The parameters are:
|
Request Example
{
"channel": "sms",
"smsTemplate": {
"name": "sample_SMSTemplate",
"content": "JChUR19DRUxMX0NPREVOVU1CUil7YXNzZXRfbGlua3NfMTY0NDQ5MjI0NzAxMDZ9e3thdF9wZXJzb25hbGl6ZWRDb250ZW50TGlua319",
"description": "U01TVGVtcGxhdGVfRGVjZW1iZXJfb2ZmZXJz",
"personalizationSource": 1,
"personalizationReferenceTargetId": "16206272370102",
"masterTemplateId": ""
}
}
Response Example
{
"id": "16715338090115",
"name": "SMSTemplate_December_offers",
"message": "SMS Template created successfully."
}
Response Parameters
This API will return the following response parameters:
Parameter | Description |
---|---|
name | Returns the name of the SMS template that is created. |
message | Returns the confirmation message. |
id | Returns the unique Transaction ID of the operation in case of success. |
Failure Response Codes
The API will return code within the response as per the following table in case of failure scenarios.
HTTP Status Code | Code within API Response | Description |
---|---|---|
400 | 400 | NAME length is too long. |
400 | 400 | Name should be 'Alphabets,numbers and special characters _ are allowed'. |
400 | 400 | Invalid channel :: channel name |
400 | 400 | CONTENT length is too long. |
400 | 400 | SMS content is required. |
400 | 400 | Name is required. |
401 | 430 | Authorization failed. This resource is not allowed to access using this TOKEN or KEY |
401 | NA | Invalid token or Access token expired |
404 | 404 | Not found |
409 | 409 | Another Message Template with the same name already exists in one of the User Groups. Please choose another name for this template. |
500 | 1001 | Invalid input JSON |