Skip to contentSkip to navigationSkip to topbar
Page toolsOn this page
Looking for more inspiration?Visit the

twilio/quick-reply


The twilio/quick-reply content type lets recipients tap, rather than type, to respond to a message. You can include up to ten quick-reply buttons. When you send an in-session WhatsApp message that does not require template approval, only three buttons are allowed.

(warning)

Warning

twilio/quick-reply content templates can be sent over WhatsApp for out-of-session messages that include variables. If the template body starts or ends with a variable, or if two variables appear adjacent to each other, WhatsApp will reject the template. A sample value for each variable is required. For details, see Using Variables with Content Templates.


Supported channels

supported-channels page anchor
  • WhatsApp
  • Facebook Messenger

Chat options: Check Flight Status, Check Gate Number, Speak with an Agent.
Chat from Owl Air Support offering options to check flight status, gate number, or see all options.
Menu with options for flight status, gate number, agent contact, and weather at DEP and ARR.

ParameterTypeRequiredVariable supportDescription
bodystringYesYesText that appears above the quick-reply buttons.
Maximum length: 1,024 characters.
actionsarrayYesYesAn array that contains between 1 and 10 quick-reply buttons.

actions properties

actions-properties page anchor

For an overview of shared properties, see Common components.

PropertySupported channelsParameters
QUICK_REPLY
  • WhatsApp
  • Facebook Messenger
  • title: Text that appears on the button. The same text is returned in the inbound Body and ButtonText fields when the end user selects the button. Variables are supported for in-session messages.
    Maximum length: 20 characters.
  • id: A developer-defined payload that is not visible to the end user. The value is returned in the inbound ButtonPayload field when the end user selects the button. Variables are supported.
    Maximum length: 200 characters.

Code examples and responses

code-examples-and-responses page anchor
Create a quick-reply templateLink to code sample: Create a quick-reply template
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function createContent() {
11
const content = await client.content.v1.contents.create({
12
friendly_name: "owl_air_qr",
13
variables: {
14
1: "Owl Air Customer",
15
},
16
language: "en",
17
types: {
18
"twilio/text": {
19
body: "Hi, {{1}}. \n Thanks for contacting Owl Air Support. How can I help?.",
20
},
21
"twilio/quick-reply": {
22
body: "Hi, {{1}} 👋 \nThanks for contacting Owl Air Support. How can I help?",
23
actions: [
24
{
25
title: "Check flight status",
26
id: "flightid1",
27
},
28
{
29
title: "Check gate number",
30
id: "gateid1",
31
},
32
{
33
title: "Speak with an agent",
34
id: "agentid1",
35
},
36
],
37
},
38
},
39
});
40
41
console.log(content.dateCreated);
42
}
43
44
createContent();

Response

Note about this response
1
{
2
"sid": "HXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"friendly_name": "owl_air_qr",
5
"language": "en",
6
"variables": {
7
"1": "Owl Air Customer"
8
},
9
"types": {
10
"twilio/text": {
11
"body": "Hi, {{1}}. \n Thanks for contacting Owl Air Support. How can I help?."
12
},
13
"twilio/quick-reply": {
14
"body": "Hi, {{1}} 👋 \nThanks for contacting Owl Air Support. How can I help?",
15
"actions": [
16
{
17
"title": "Check flight status",
18
"id": "flightid1"
19
},
20
{
21
"title": "Check gate number",
22
"id": "gateid1"
23
},
24
{
25
"title": "Speak with an agent",
26
"id": "agentid1"
27
}
28
]
29
}
30
},
31
"url": "https://content.twilio.com/v1/Content/HXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
32
"date_created": "2015-07-30T19:00:00Z",
33
"date_updated": "2015-07-30T19:00:00Z",
34
"links": {
35
"approval_create": "https://content.twilio.com/v1/Content/HXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ApprovalRequests/whatsapp",
36
"approval_fetch": "https://content.twilio.com/v1/Content/HXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ApprovalRequests"
37
}
38
}