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

twilio/list-picker


The twilio/list-picker content type includes a menu of up to 10 options for users to make a selection.

(information)

Info

List-picker templates are only available once the end user is in a 24 hour session. They can't initiate a business initiated session.

List-picker templates aren't supported for approval on WhatsApp and can't be submitted for approval.


Supported channels

supported-channels page anchor

WhatsApp


Owl Air Flash Sale message with destination selection options for flights to NYC, Denver, and Chicago.

ParameterTypeRequiredVariable supportDescription
bodystringYesYesThe text of the message you want to send. This is included as a regular text message.
Maximum length: 1,024 characters
buttonstringYesYesDisplay value for the primary button.
itemsarrayYesSee items properties.Array of list item objects.
Minimum: 1 item
Maximum: 10 items

items properties

items-properties page anchor
PropertyTypeRequiredVariable supportDescription
itemstringYesYesDisplay value for the item.
Maximum length: 24 characters
idstringYesYesUnique item identifier. Not visible to the recipient.
Maximum length: 200 characters
descriptionstringYesYesDescription of the item.
Maximum length: 72 characters

Code examples and responses

code-examples-and-responses page anchor
Create a list picker templateLink to code sample: Create a list picker 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_list",
13
variables: {
14
1: "end_date",
15
},
16
language: "en",
17
types: {
18
"twilio/text": {
19
body: "We have flights to the following destinations: (1) SFO, (2) OAK, (3) LAX. Hurry! Sale ends on {{1}}!",
20
},
21
"twilio/list-picker": {
22
body: "Owl Air Flash Sale! Hurry! Sale ends on {{1}}!",
23
button: "Select a destination",
24
items: [
25
{
26
id: "SFO1337",
27
item: "SFO to NYC for $299",
28
description: "Owl Air Flight 1337 to LGA",
29
},
30
{
31
id: "OAK5280",
32
item: "OAK to Denver for $149",
33
description: "Owl Air Flight 5280 to DEN",
34
},
35
{
36
id: "LAX96",
37
item: "LAX to Chicago for $199",
38
description: "Owl Air Flight 96 to ORD",
39
},
40
],
41
},
42
},
43
});
44
45
console.log(content.dateCreated);
46
}
47
48
createContent();

Response

Note about this response
1
{
2
"sid": "HXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"friendly_name": "owl_air_list",
5
"language": "en",
6
"variables": {
7
"1": "end_date"
8
},
9
"types": {
10
"twilio/text": {
11
"body": "We have flights to the following destinations: (1) SFO, (2) OAK, (3) LAX. Hurry! Sale ends on {{1}}!"
12
},
13
"twilio/list-picker": {
14
"body": "Owl Air Flash Sale! Hurry! Sale ends on {{1}}!",
15
"button": "Select a destination",
16
"items": [
17
{
18
"id": "SFO1337",
19
"item": "SFO to NYC for $299",
20
"description": "Owl Air Flight 1337 to LGA"
21
},
22
{
23
"id": "OAK5280",
24
"item": "OAK to Denver for $149",
25
"description": "Owl Air Flight 5280 to DEN"
26
},
27
{
28
"id": "LAX96",
29
"item": "LAX to Chicago for $199",
30
"description": "Owl Air Flight 96 to ORD"
31
}
32
]
33
}
34
},
35
"url": "https://content.twilio.com/v1/Content/HXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
36
"date_created": "2015-07-30T19:00:00Z",
37
"date_updated": "2015-07-30T19:00:00Z",
38
"links": {
39
"approval_create": "https://content.twilio.com/v1/Content/HXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ApprovalRequests/whatsapp",
40
"approval_fetch": "https://content.twilio.com/v1/Content/HXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ApprovalRequests"
41
}
42
}