Skip to contentSkip to navigationSkip to topbar
Rate this Page:

twilio/text


Twilio/text type contains only plain text-based content. While text content may be sent to OTT channels without the use of content templates, the twilio/text type can be used as a fallback content type when sending to a mix of channels. Additionally, templates make it easy to utilize variables to create dynamic content.

(warning)

Warning

Twilio/text templates can be sent via WhatsApp for out of session messages with variables. If the template's body starts or ends with a variable or has two variables next to each other, the template will not be approved by WhatsApp without a sample variable. For additional information about variables see Using Variables with Content Templates.


Supported Channels

supported-channels page anchor

SMS, WhatsApp, Facebook Messenger


Content API - Text sample.

body:

  • Type: string
  • Required: yes
  • Variable Support: yes
  • Description: The text of the message you want to send.

    • Maximum 1,600 characters

Create Text Template

create-text-template page anchor
curl

_13
curl -X POST https://content.twilio.com/v1/Content \
_13
-H 'Content-Type: application/json' \
_13
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN \
_13
-d '{
_13
"friendly_name": "text_template",
_13
"language": "en",
_13
"variables": {"1":"name"},
_13
"types": {
_13
"twilio/text": {
_13
"body": "Hi, {{1}}. \n Thanks for contacting Owl Air Support. How can I help?."
_13
}
_13
}
_13
}'

Output

_21
{
_21
"language": "en",
_21
"date_updated": "2022-09-01T12:39:19Z",
_21
"variables": {
_21
"1": "name"
_21
},
_21
"friendly_name": "text_template",
_21
"account_sid": "ACXXXXXXXXXXXXXXXXXXX",
_21
"url": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXX",
_21
"sid": "HXXXXXXXXXXXXXXXXXXX",
_21
"date_created": "2022-09-01T12:39:19Z",
_21
"types": {
_21
"twilio/text": {
_21
"body": "Hi, {{1}}. \n Thanks for contacting Owl Air Support. How can I help?."
_21
}
_21
},
_21
"links": {
_21
"approval_fetch": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXX/ApprovalRequests",
_21
"approval_create": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXX/ApprovalRequests/whatsapp"
_21
}
_21
}


Rate this Page: