Create SMS Message Template

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 HeaderDescription
content-typeapplication/json
authorizationAccess token or API Secret Key in Bearer format

Example: Bearer $(key)

Body Parameters

The following table describes the elements in the request body:

ParameterTypeMandatoryDescription
channelStringMandatorySpecifies the channel. The options are:
* sms
smsTemplateObjectMandatorySpecifies the content for the SMS template. The parameters are:


  • name: (Mandatory)
    Specifies a name for the template.

  • content: (Mandatory) Specifies the text content in base64 format for the template. The length of the SMS content should not exceed 65535 characters.

  • description: (Optional) specifies the description for the template in base64 format.

  • personalizationSource: (Optional)
    Enable or disable the personalization. The options are:
    1 - enable (default)
    0 - disable

  • personalizationReferenceTargetId: (Optional) Specifies the target group id to make the personalization headers available in the content.

  • mastertemplateId: (Optional) Specifies the template id from which a new sms template is being created.

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:

ParameterDescription
nameReturns the name of the SMS template that is created.
messageReturns the confirmation message.
idReturns 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 CodeCode within API ResponseDescription
400400NAME length is too long.
400400Name should be 'Alphabets,numbers and special characters _ are allowed'.
400400Invalid channel :: channel name
400400CONTENT length is too long.
400400SMS content is required.
400400Name is required.
401430Authorization failed. This resource is not allowed to access using this TOKEN or KEY
401NAInvalid token or Access token expired
404404Not found
409409Another Message Template with the same name already exists in one of the User Groups. Please choose another name for this template.
5001001Invalid input JSON
Language