Twilio/list-picker
includes a menu of up to 10 options for users to make a selection.
List-picker templates are only available once the end user is in a 24 hr session. They can not initiate a business initiated session.
List-picker templates are not supported for approval on WhatsApp and can't be submitted for approval.
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.
button:
Type: string
Required: yes
Variable Support: yes
Description: Display value for the primary button.
items:
Type: array[List Items]
Required: yes
Variable Support: See List Item definition below.
Description: Array of list item objects.
item:
Type: string
Required: yes
Variable Support: yes
Description: Display value for the item
id:
Type: string
Required: yes
Variable Support: yes
Description: Unique item identifier. Not visible to the recipient.
description:
Type: string
Required: no
Variable Support: yes
Description: Description of the item.
1// Install the C# / .NET helper library from twilio.com/docs/csharp/install23using System;4using Twilio;5using Twilio.Rest.Content.V1;67TwilioClient.Init(accountSid, authToken);89// define the twilio/list-picker10var twilioListPicker = new TwilioListPicker.Builder();11twilioListPicker.WithBody("Owl Air Flash Sale! Hurry! Sale ends on {{1}}!");12var item1 = new ListPickerItems.Builder()13.WithItem("SFO to NYC for $299")14.WithDescription("Owl Air Flight 1337 to LGA")15.WithId("SFO1337")16.Build();17var item2 = new ListPickerItems.Builder()18.WithItem("OAK to Denver for $149")19.WithDescription("Owl Air Flight 5280 to DEN")20.WithId("OAK5280")21.Build();22var item3 = new ListPickerItems.Builder()23.WithItem("LAX to Chicago for $199")24.WithDescription("Owl Air Flight 96 to ORD")25.WithId("LAX96")26.Build();27twilioListPicker.WithItems(new List<ListPickerItems>() { item1, item2, item3 });2829// define all the content types to be part of the template30var types = new Types.Builder();31types.WithTwilioListPicker(twilioListPicker.Build());3233// build the create request object34var contentCreateRequest = new ContentCreateRequest.Builder();35contentCreateRequest.WithTypes(types.Build());36contentCreateRequest.WithLanguage("en");37contentCreateRequest.WithFriendlyName("owl_sale_list");38contentCreateRequest.WithVariables(new Dictionary<string, string>() { {"1", "end_date"} });3940// create the twilio template41var contentTemplate = await CreateAsync(contentCreateRequest.Build());4243Console.WriteLine($"Created Twilio Content Template SID: {contentTemplate.Sid}");
1{2"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",3"date_created": "2022-08-29T15:46:11Z",4"date_updated": "2022-08-29T15:46:11Z",5"friendly_name": "owl_air_list",6"language": "en",7"links": {8"approval_create": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ApprovalRequests/whatsapp",9"approval_fetch": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ApprovalRequests"10},11"sid": "HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",12"types": {13"twilio/list-picker": {14"body": "Owl Air Flash Sale! Hurry! Sale ends on {{1}}!",15"button": "Select a destination",16"items": [17{18"description": "Owl Air Flight 1337 to LGA",19"id": "SFO1337",20"item": "SFO to NYC for $299"21},22{23"description": "Owl Air Flight 5280 to DEN",24"id": "OAK5280",25"item": "OAK to Denver for $149"26},27{28"description": "Owl Air Flight 96 to ORD",29"id": "LAX96",30"item": "LAX to Chicago for $199"31}32]33},34"twilio/text": {35"body": "We have flights to the following destinations: (1) SFO, (2) OAK, (3) LAX. Hurry! Sale ends on {{1}}!"36}37},38"url": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",39"variables": {40"1": "end_date"41}42}