Skip to contentSkip to navigationSkip to topbar
Rate this Page:

twilio/quick-reply


Twilio/quick-reply templates let recipients tap, rather than type, to respond to the message.

(warning)

Warning

Twilio/quick-reply 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

WhatsApp, Facebook Messenger


Content API - quick reply preview.

body:

  • Type: string
  • Required: yes
  • Variable Support: yes
  • Description: The text of the message you want to send. This is included as a regular text message.

    • Maximum 640 characters

actions:

  • Type: array[ actions ]
  • Required: yes
  • Variable Support: See Common Components: Actions definition
  • Description: Buttons that recipients can tap on to act on the message:

    • Up to 3 buttons can be created for Quick Reply buttons. Please use "type," "title", and "id" actions to create quick reply buttons within the actions array.

Create a Quick Reply Template

create-a-quick-reply-template page anchor

Code sample for creating a template using content API

curl

_30
curl -X POST 'https://content.twilio.com/v1/Content' \
_30
-H 'Content-Type: application/json' \
_30
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN \
_30
-d '{
_30
"friendly_name": "flight_replies",
_30
"language": "en",
_30
"variables": {"1":"Owl Air Customer"},
_30
"types": {
_30
"twilio/quick-reply": {
_30
"body": "Hi, {{1}} 👋 \nThanks for contacting Owl Air Support. How can I help?",
_30
"actions": [
_30
{
_30
"title": "Check flight status",
_30
"id": "flightid1"
_30
},
_30
{
_30
"title": "Check gate number",
_30
"id": "gateid1"
_30
},
_30
{
_30
"title": "Speak with an agent",
_30
"id": "agentid1"
_30
}
_30
]
_30
},
_30
"twilio/text": {
_30
"body": "Hi, {{1}}. \n Thanks for contacting Owl Air Support. How can I help?."
_30
}
_30
}
_30
}'

Output

_38
{
_38
"language": "en",
_38
"date_updated": "2022-08-29T10:43:20Z",
_38
"variables": {
_38
"1": "Owl Air Customer"
_38
},
_38
"friendly_name": "flight_replies",
_38
"account_sid": "ACXXXXXXXXXXXXXXXXXXX",
_38
"url": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_38
"sid": "HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_38
"date_created": "2022-08-29T10:43:20Z",
_38
"types": {
_38
"twilio/text": {
_38
"body": "Hi, {{ 1 }}. \n Thanks for contacting Owl Air Support. How can I help?."
_38
},
_38
"twilio/quick-reply": {
_38
"body": "Hi, {{ 1 }}. \n Thanks for contacting Owl Air Support. How can I help?",
_38
"actions": [
_38
{
_38
"id": "flightid1",
_38
"title": "Check flight status"
_38
},
_38
{
_38
"id": "gateid1",
_38
"title": "Check gate number"
_38
},
_38
{
_38
"id": "agentid1",
_38
"title": "Speak with an agent"
_38
}
_38
]
_38
}
_38
},
_38
"links": {
_38
"approval_fetch": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ApprovalRequests",
_38
"approval_create": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ApprovalRequests/whatsapp"
_38
}
_38
}


Rate this Page: