The POST /environments/{{envID}}/templates/{{templateName}}/contents
operation can be used to create a new customized text message content resource associated with the template specified in the request URL.
The size restriction on the content
value is derived from the content
encoding. UC-2 encoding is used for messages that contain non GSM-7 characters, and in this case, a size restriction of 67 characters is enforced. However, GSM-7 encoded messages may contain up to 153 characters. SMS content associated with the strong_authentication
template supports line breaks. When specifying a line break, you must escape the newline character in the content
property (for example, "content":" Your OTP is ${otp}. \\nPlease submit. "
).
The sender
value may contain only alphanumeric characters and spaces, and its length may be up to 11 characters.
In some countries, including the US, it is impossible to send an SMS with an alphanumeric sender ID. For those countries, the sender ID must be empty. For international alphanumeric sender support, please refer to https://support.twilio.com/hc/en-us/articles/223133767-International-support-for-Alphanumeric-Sender-ID.
Due to India’s pre-registration laws, “PingID” is always used as the sender ID for SMS recipients in India.
In addition, the variables restrictions should apply to text message notification content.
See Notifications for important overview information.
Use Read All Templates to retrieve a list of all notifications templates associated with the environment and select the specific templateName
for the endpoint. For more information, see Notifications Templates.
Property | Type | Required? |
---|---|---|
content |
String | Required |
deliveryMethod |
String | Required |
locale |
String | Required |
variant |
String | Optional |
See the Notifications templates property data models for full property descriptions.