Twilio/quick-reply
templates let recipients tap, rather than type, to respond to the message. Up to five quick replies buttons are supported. If the content template is being sent in session over WhatsApp without approval, only three buttons are allowed.
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.
WhatsApp, Facebook Messenger
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.
actions:
QUICK_REPLY:
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/text type for less rich channels (e.g. SMS)10var twilioText = new TwilioText.Builder();11twilioText.WithBody("Hi {{1}}. Thanks for contacting Owl Air Support. How can we help?");1213// define the twilio/quick-reply type for more rich channels14var twilioQuickReply = new TwilioQuickReply.Builder();15twilioQuickReply.WithBody("Owl Air Support");16var quickreply1 = new QuickReplyAction.Builder()17.WithTitle("Contact Us")18.WithId("flightid1")19.Build();20var quickreply2 = new QuickReplyAction.Builder()21.WithTitle("Check gate number")22.WithId("gateid1")23.Build();24var quickreply3 = new QuickReplyAction.Builder()25.WithTitle("Speak with an agent")26.WithId("agentid1")27.Build();28twilioQuickReply.WithActions(new List<QuickReplyAction>() { quickreply1, quickreply2, quickreply3 });2930// define all the content types to be part of the template31var types = new Types.Builder();32types.WithTwilioText(twilioText.Build());33types.WithTwilioQuickReply(twilioQuickReply.Build());3435// build the create request object36var contentCreateRequest = new ContentCreateRequest.Builder();37contentCreateRequest.WithTypes(types.Build());38contentCreateRequest.WithLanguage("en");39contentCreateRequest.WithFriendlyName("owl_air_qr");40contentCreateRequest.WithVariables(new Dictionary<string, string>() { {"1", "John"} });4142// create the twilio template43var contentTemplate = await CreateAsync(contentCreateRequest.Build());4445Console.WriteLine($"Created Twilio Content Template SID: {contentTemplate.Sid}");
1{2"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",3"date_created": "2022-08-29T10:43:20Z",4"date_updated": "2022-08-29T10:43:20Z",5"friendly_name": "owl_air_qr",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/text": {14"body": "Hi, {{ 1 }}. \n Thanks for contacting Owl Air Support. How can I help?."15},16"twilio/quick-reply": {17"body": "Hi, {{ 1 }}. \n Thanks for contacting Owl Air Support. How can I help?",18"actions": [19{20"id": "flightid1",21"title": "Check flight status"22},23{24"id": "gateid1",25"title": "Check gate number"26},27{28"id": "agentid1",29"title": "Speak with an agent"30}31]32}33},34"url": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",35"variables": {36"1": "Owl Air Customer"37}38}