diff --git a/messaging/content-templates/create-a-quick-reply-template/create-a-quick-reply-template.cs b/messaging/content-templates/create-a-quick-reply-template/create-a-quick-reply-template.cs new file mode 100644 index 000000000..022d8effd --- /dev/null +++ b/messaging/content-templates/create-a-quick-reply-template/create-a-quick-reply-template.cs @@ -0,0 +1,45 @@ +// Install the C# / .NET helper library from twilio.com/docs/csharp/install + +using System; +using Twilio; +using Twilio.Rest.Content.V1; + + TwilioClient.Init(accountSid, authToken); + + // define the twilio/text type for less rich channels (e.g. SMS) + var twilioText = new TwilioText.Builder(); + twilioText.WithBody("Hi {{1}}. Thanks for contacting Owl Air Support. How can we help?"); + + // define the twilio/quick-reply type for more rich channels + var twilioQuickReply = new TwilioQuickReply.Builder(); + twilioQuickReply.WithBody("Owl Air Support"); + var quickreply1 = new QuickReplyAction.Builder() + .WithTitle("Contact Us") + .WithId("flightid1") + .Build(); + var quickreply2 = new QuickReplyAction.Builder() + .WithTitle("Check gate number") + .WithId("gateid1") + .Build(); + var quickreply3 = new QuickReplyAction.Builder() + .WithTitle("Speak with an agent") + .WithId("agentid1") + .Build(); + twilioQuickReply.WithActions(new List() { quickreply1, quickreply2, quickreply3 }); + + // define all the content types to be part of the template + var types = new Types.Builder(); + types.WithTwilioText(twilioText.Build()); + types.WithTwilioQuickReply(twilioQuickReply.Build()); + + // build the create request object + var contentCreateRequest = new ContentCreateRequest.Builder(); + contentCreateRequest.WithTypes(types.Build()); + contentCreateRequest.WithLanguage("en"); + contentCreateRequest.WithFriendlyName("owl_air_qr"); + contentCreateRequest.WithVariables(new Dictionary() { {"1", "John"} }); + + // create the twilio template + var contentTemplate = await CreateAsync(contentCreateRequest.Build()); + + Console.WriteLine($"Created Twilio Content Template SID: {contentTemplate.Sid}"); diff --git a/messaging/content-templates/create-a-quick-reply-template/create-a-quick-reply-template.curl b/messaging/content-templates/create-a-quick-reply-template/create-a-quick-reply-template.curl new file mode 100644 index 000000000..501f1c2bb --- /dev/null +++ b/messaging/content-templates/create-a-quick-reply-template/create-a-quick-reply-template.curl @@ -0,0 +1,30 @@ +curl -X POST 'https://content.twilio.com/v1/Content' \ +-H 'Content-Type: application/json' \ +-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN \ +-d '{ + "friendly_name": "owl_air_qr", + "language": "en", + "variables": {"1":"Owl Air Customer"}, + "types": { + "twilio/quick-reply": { + "body": "Hi, {{1}} 👋 \nThanks for contacting Owl Air Support. How can I help?", + "actions": [ + { + "title": "Check flight status", + "id": "flightid1" + }, + { + "title": "Check gate number", + "id": "gateid1" + }, + { + "title": "Speak with an agent", + "id": "agentid1" + } + ] + }, + "twilio/text": { + "body": "Hi, {{1}}. \n Thanks for contacting Owl Air Support. How can I help?." + } + } +}' diff --git a/messaging/content-templates/create-a-quick-reply-template/create-a-quick-reply-template.java b/messaging/content-templates/create-a-quick-reply-template/create-a-quick-reply-template.java new file mode 100644 index 000000000..35e2c82f1 --- /dev/null +++ b/messaging/content-templates/create-a-quick-reply-template/create-a-quick-reply-template.java @@ -0,0 +1,47 @@ +package Examples; + +import com.twilio.rest.content.v1.Content; + +import java.util.Arrays; +import java.util.Map; + +public class TwilioQuickReply { + public static String CreateTemplate() { + var twilioText = new Content.TwilioText(); + twilioText.setBody("Hi {{1}}. Thanks for contacting Owl Air Support. How can we help?"); + + var twilioQuickReply = new Content.TwilioQuickReply(); + twilioQuickReply.setBody("Owl Air Support"); + + var action1 = new Content.QuickReplyAction(); + action1.setType(Content.QuickReplyActionType.QUICK_REPLY); + action1.setTitle("Contact Us"); + action1.setId("contact_us"); + + var action2 = new Content.QuickReplyAction(); + action1.setType(Content.QuickReplyActionType.QUICK_REPLY); + action1.setTitle("Check gate number"); + action1.setId("gate_id_1"); + + var action3 = new Content.QuickReplyAction(); + action1.setType(Content.QuickReplyActionType.QUICK_REPLY); + action1.setTitle("Speak with an agent"); + action1.setId("agent_id_1"); + + twilioQuickReply.setActions(Arrays.asList(action1, action2, action3)); + + var types = new Content.Types(); + types.setTwilioText(twilioText); + types.setTwilioQuickReply(twilioQuickReply); + + var createRequest = new Content.ContentCreateRequest("en", types); + createRequest.setFriendlyName("owl_air_qr"); + createRequest.setVariables(Map.of( + "1", "first_name" + )); + + var content = Content.creator(createRequest).create(); + + return content.getSid(); + } +} diff --git a/messaging/content-templates/create-a-quick-reply-template/meta.json b/messaging/content-templates/create-a-quick-reply-template/meta.json new file mode 100644 index 000000000..9fa69172a --- /dev/null +++ b/messaging/content-templates/create-a-quick-reply-template/meta.json @@ -0,0 +1,4 @@ +{ + "title": "Content Templates API - Create Quick-Reply Template", + "type": "server" +} diff --git a/messaging/content-templates/create-a-quick-reply-template/output/create-a-quick-reply-template.json b/messaging/content-templates/create-a-quick-reply-template/output/create-a-quick-reply-template.json new file mode 100644 index 000000000..f8d40ecd5 --- /dev/null +++ b/messaging/content-templates/create-a-quick-reply-template/output/create-a-quick-reply-template.json @@ -0,0 +1,38 @@ +{ + "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "date_created": "2022-08-29T10:43:20Z", + "date_updated": "2022-08-29T10:43:20Z", + "friendly_name": "owl_air_qr", + "language": "en", + "links": { + "approval_create": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ApprovalRequests/whatsapp", + "approval_fetch": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ApprovalRequests" + }, + "sid": "HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "types": { + "twilio/text": { + "body": "Hi, {{ 1 }}. \n Thanks for contacting Owl Air Support. How can I help?." + }, + "twilio/quick-reply": { + "body": "Hi, {{ 1 }}. \n Thanks for contacting Owl Air Support. How can I help?", + "actions": [ + { + "id": "flightid1", + "title": "Check flight status" + }, + { + "id": "gateid1", + "title": "Check gate number" + }, + { + "id": "agentid1", + "title": "Speak with an agent" + } + ] + } + }, + "url": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "variables": { + "1": "Owl Air Customer" + } +} diff --git a/messaging/content-templates/create-call-to-action-template/create-call-to-action-template.cs b/messaging/content-templates/create-call-to-action-template/create-call-to-action-template.cs new file mode 100644 index 000000000..035e97d6c --- /dev/null +++ b/messaging/content-templates/create-call-to-action-template/create-call-to-action-template.cs @@ -0,0 +1,38 @@ +// Install the C# / .NET helper library from twilio.com/docs/csharp/install + +using System; +using Twilio; +using Twilio.Rest.Content.V1; + + TwilioClient.Init(accountSid, authToken); + + // define the twilio/call-to-action type + var twilioCallToAction = new TwilioCallToAction.Builder(); + twilioCallToAction.WithBody("Owl Air: We will see you soon! Flight {{1}} to {{2}} departs at {{3}} from Gate {{4}}."); + var cta1 = new CallToAction.Builder() + .WithType(CallToActionActionType.Url) + .WithUrl("https://owlair.com/%7B%7B5%7D%7D") + .WithTitle("Check Flight Status") + .Build(); + var cta2 = new CallToAction.Builder() + .WithType(CallToActionActionType.PhoneNumber) + .WithPhone("+15555551234") + .WithTitle("Call Support") + .Build(); + twilioCallToAction.WithActions(new List() { cta1, cta2 }); + + // define all the content types to be part of the template + var types = new Types.Builder(); + types.WithTwilioCallToAction(twilioCallToAction.Build()); + + // build the create request object + var contentCreateRequest = new ContentCreateRequest.Builder(); + contentCreateRequest.WithTypes(types.Build()); + contentCreateRequest.WithLanguage("en"); + contentCreateRequest.WithFriendlyName("owl_air_cta"); + contentCreateRequest.WithVariables(new Dictionary() { {"1", "flight_number"}, {"2", "arrival_city"}, {"3", "departure_time"}, {"4", "gate_number"}, {"5", "url_suffix"} }); + + // create the twilio template + var contentTemplate = await CreateAsync(contentCreateRequest.Build()); + + Console.WriteLine($"Created Twilio Content Template SID: {contentTemplate.Sid}"); diff --git a/messaging/content-templates/create-call-to-action-template/create-call-to-action-template.curl b/messaging/content-templates/create-call-to-action-template/create-call-to-action-template.curl new file mode 100644 index 000000000..12626720c --- /dev/null +++ b/messaging/content-templates/create-call-to-action-template/create-call-to-action-template.curl @@ -0,0 +1,27 @@ +curl -X POST 'https://content.twilio.com/v1/Content' \ +-H 'Content-Type: application/json' \ +-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN \ +-d '{ + "friendly_name": "owl_air_cta", + "language": "en", + "variables": {"1": "flight_number", + "2": "arrival_city", + "3": "departure_time", + "4": "gate_number", + "5": "url_suffix"}, + "types": { + "twilio/call-to-action": { + "body": "Owl Air: We will see you soon! Flight {{1}} to {{2}} departs at {{3}} from Gate {{4}}.", + "actions": [{ + "type": "URL", + "title": "Check Flight Status", + "url": "https://owlair.com/%7B%7B5%7D%7D" + }, + { + "type": "PHONE_NUMBER", + "title": "Call Support", + "phone": "+15555551234" + }] + } + } +}' diff --git a/messaging/content-templates/create-call-to-action-template/create-call-to-action-template.java b/messaging/content-templates/create-call-to-action-template/create-call-to-action-template.java new file mode 100644 index 000000000..8290aefe1 --- /dev/null +++ b/messaging/content-templates/create-call-to-action-template/create-call-to-action-template.java @@ -0,0 +1,41 @@ +package Examples; + +import com.twilio.rest.content.v1.Content; +import java.util.Arrays; +import java.util.Map; + +public class TwilioCallToAction { + public static String CreateTemplate() { + var twilioCallToAction = new Content.TwilioCallToAction(); + twilioCallToAction.setBody("Owl Air: We will see you soon! Flight {{1}} to {{2}} departs at {{3}} from Gate {{4}}."); + + var action1 = new Content.CallToActionAction(); + action1.setType(Content.CallToActionActionType.URL); + action1.setUrl("https://owlair.com/%7B%7B5%7D%7D"); + action1.setTitle("Check Flight Status"); + + var action2 = new Content.CallToActionAction(); + action2.setType(Content.CallToActionActionType.PHONE_NUMBER); + action2.setPhone("+18005551234"); + action2.setTitle("Call Support"); + + twilioCallToAction.setActions(Arrays.asList(action1, action2)); + + var types = new Content.Types(); + types.setTwilioCallToAction(twilioCallToAction); + + var createRequest = new Content.ContentCreateRequest("en", types); + createRequest.setFriendlyName("owl_air_cta"); + createRequest.setVariables(Map.of( + "1", "flight_number", + "2", "arrival_city", + "3", "departure_time", + "4", "gate_number", + "5", "url_suffix" + )); + + var content = Content.creator(createRequest).create(); + + return content.getSid(); + } +} diff --git a/messaging/content-templates/create-call-to-action-template/meta.json b/messaging/content-templates/create-call-to-action-template/meta.json new file mode 100644 index 000000000..079fe3569 --- /dev/null +++ b/messaging/content-templates/create-call-to-action-template/meta.json @@ -0,0 +1,4 @@ +{ + "title": "Content Templates API - Create a Call-to-action Template", + "type": "server" +} diff --git a/messaging/content-templates/create-call-to-action-template/output/create-call-to-action-template.json b/messaging/content-templates/create-call-to-action-template/output/create-call-to-action-template.json new file mode 100644 index 000000000..8f64bad1c --- /dev/null +++ b/messaging/content-templates/create-call-to-action-template/output/create-call-to-action-template.json @@ -0,0 +1,37 @@ +{ + "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "date_created": "2022-01-15T17:09:58Z", + "date_updated": "2022-01-15T17:09:58Z", + "friendly_name": "owl_air_cta", + "language": "en", + "links": { + "approval_fetch": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ApprovalRequests", + "approval_create": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ApprovalRequests/whatsapp" + }, + "sid": "HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "types": { + "twilio/call-to-action": { + "actions": [ + { + "url": "https://owlair.com/%7B%7B5%7D%7D", + "type": "URL", + "title": "Check Flight Status" + }, + { + "phone_number": "+15555551234", + "type": "PHONE_NUMBER", + "title": "Call Support" + } + ], + "body": "Owl Air: We will see you soon! Flight {{1}} to {{2}} departs at {{3}} from Gate {{4}}." + } + }, + "url": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "variables": { + "1": "flight_number", + "3": "departure_time", + "2": "arrival_city", + "5": "url_suffix", + "4": "gate_number" + } +} diff --git a/messaging/content-templates/create-card-template/create-card-template.cs b/messaging/content-templates/create-card-template/create-card-template.cs new file mode 100644 index 000000000..8c4282201 --- /dev/null +++ b/messaging/content-templates/create-card-template/create-card-template.cs @@ -0,0 +1,38 @@ +// Install the C# / .NET helper library from twilio.com/docs/csharp/install + +using System; +using Twilio; +using Twilio.Rest.Content.V1; + + TwilioClient.Init(accountSid, authToken); + + // define the twilio/text type for less rich channels (e.g. SMS) + var twilioText = new TwilioText.Builder(); + twilioText.WithBody("Hi {{1}}. Thanks for contacting Owl Air Support. How can we help?"); + + // define the twilio/card type for more rich channels + var twilioCard = new TwilioCard.Builder(); + twilioCard.WithTitle("Owl Air Support"); + var cardAction1 = new CardAction.Builder() + .WithType(CardActionType.Url) + .WithUrl("https://www.twilio.com/") + .WithTitle("Contact Us") + .Build(); + twilioCard.WithActions(new List() { cardAction1 }); + + // define all the content types to be part of the template + var types = new Types.Builder(); + types.WithTwilioText(twilioText.Build()); + types.WithTwilioCard(twilioCard.Build()); + + // build the create request object + var contentCreateRequest = new ContentCreateRequest.Builder(); + contentCreateRequest.WithTypes(types.Build()); + contentCreateRequest.WithLanguage("en"); + contentCreateRequest.WithFriendlyName("owl_air_card"); + contentCreateRequest.WithVariables(new Dictionary() { {"1", "John"} }); + + // create the twilio template + var contentTemplate = await CreateAsync(contentCreateRequest.Build()); + + Console.WriteLine($"Created Twilio Content Template SID: {contentTemplate.Sid}"); diff --git a/messaging/content-templates/create-card-template/create-card-template.curl b/messaging/content-templates/create-card-template/create-card-template.curl new file mode 100644 index 000000000..3d2963d3f --- /dev/null +++ b/messaging/content-templates/create-card-template/create-card-template.curl @@ -0,0 +1,31 @@ +curl -X POST 'https://content.twilio.com/v1/Content' \ +-H 'Content-Type: application/json' \ +-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN \ +-d '{ + "friendly_name": "owl_air_card", + "language": "en", + "variables": { + "1": "coupon_code" + }, + "types": { + "twilio/card": { + "title": "Congratulations, you'\''ve reached Elite status! Add code {{1}} for 10% off.", + "subtitle": "To unsubscribe, reply Stop", + "actions": [ + { + "url": "https://owlair.com/", + "title": "Order Online", + "type": "URL" + }, + { + "phone": "+15551234567", + "title": "Call Us", + "type": "PHONE_NUMBER" + } + ] + }, + "twilio/text": { + "body": "Congratulations, your account reached Elite status, you are now eligible for 10% off any flight! Just add coupon code {{1}} to check out." + } + } +}' diff --git a/messaging/content-templates/create-card-template/create-card-template.java b/messaging/content-templates/create-card-template/create-card-template.java new file mode 100644 index 000000000..554e77a0f --- /dev/null +++ b/messaging/content-templates/create-card-template/create-card-template.java @@ -0,0 +1,35 @@ +package Examples; + +import com.twilio.rest.content.v1.Content; +import java.util.Arrays; +import java.util.Map; + +public class TwilioCard { + public static String CreateTemplate() { + var twilioText = new Content.TwilioText(); + twilioText.setBody("Hi {{1}}, thanks for contacting Owl Air Support"); + + var twilioCard = new Content.TwilioCard(); + twilioCard.setTitle("Owl Air Support"); + + var action1 = new Content.CardAction(); + action1.setType(Content.CardActionType.URL); + action1.setUrl("https://www.owlair.com/"); + action1.setTitle("Contact Us"); + + twilioCard.setActions(Arrays.asList(action1)); + + var types = new Content.Types(); + types.setTwilioCard(twilioCard); + + var createRequest = new Content.ContentCreateRequest("en", types); + createRequest.setFriendlyName("owl_air_card"); + createRequest.setVariables(Map.of( + "1", "John" + )); + + var content = Content.creator(createRequest).create(); + + return content.getSid(); + } +} diff --git a/messaging/content-templates/create-card-template/meta.json b/messaging/content-templates/create-card-template/meta.json new file mode 100644 index 000000000..ace121433 --- /dev/null +++ b/messaging/content-templates/create-card-template/meta.json @@ -0,0 +1,4 @@ +{ + "title": "Content Templates API - Create a Card Template", + "type": "server" +} diff --git a/messaging/content-templates/create-card-template/output/create-card-template.json b/messaging/content-templates/create-card-template/output/create-card-template.json new file mode 100644 index 000000000..c4719f121 --- /dev/null +++ b/messaging/content-templates/create-card-template/output/create-card-template.json @@ -0,0 +1,39 @@ +{ + "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "date_created": "2022-08-30T09:19:17Z", + "date_updated": "2022-08-30T09:19:17Z", + "friendly_name": "owl_air_card", + "language": "en", + "links": { + "approval_create": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ApprovalRequests/whatsapp", + "approval_fetch": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ApprovalRequests" + }, + "sid": "HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "types": { + "twilio/card": { + "actions": [ + { + "title": "Order Online", + "type": "URL", + "url": "https://www.owlair.com/" + }, + { + "phone_number": "+15551234567", + "title": "Call Us", + "type": "PHONE_NUMBER" + } + ], + "body": null, + "media": null, + "subtitle": "To unsubscribe, reply Stop", + "title": "Congratulations, you have reached Elite status! Add code {{1}} for 10% off." + }, + "twilio/text": { + "body": "Congratulations, your account reached Elite status, you are now eligible for 10% off any flight! Just add coupon code {{1}} to check out." + } + }, + "url": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "variables": { + "1": "coupon_code" + } +} diff --git a/messaging/content-templates/create-carousel-template/create-carousel-template.curl b/messaging/content-templates/create-carousel-template/create-carousel-template.curl new file mode 100644 index 000000000..f3b33ac93 --- /dev/null +++ b/messaging/content-templates/create-carousel-template/create-carousel-template.curl @@ -0,0 +1,85 @@ +curl -X POST 'https://content.twilio.com/v1/Content' \ +-H 'Content-Type: application/json' \ +-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN \ +-d '{ + "friendly_name": "twilio_deal", + "language": "en", + "variables": { + "1": "Twilio" + }, + "types": { + "twilio/carousel": { + "body": "New {{1}} merch just dropped! 👀", + "cards": [ + { + "title":"Twilio Hoodie", + "body":"Warm as owl feathers.", + "media":"https://sienna-grasshopper-3262.twil.io/assets/hoodie.jpeg", + "actions":[ + { + "type":"QUICK_REPLY", + "title":"I want it!", + "id":"want_hoodie" + }, + { + "type":"URL", + "title":"I am taking this!", + "url":"https://sienna-grasshopper-3262.twil.io/assets/hoodie.jpeg" + } + ] + }, + { + "title":"Twilio Tote", + "body":"Carry a little more.", + "media":"https://sienna-grasshopper-3262.twil.io/assets/tote.jpeg", + "actions":[ + { + "type":"QUICK_REPLY", + "title":"I want it!", + "id":"want_tote" + }, + { + "type":"URL", + "title":"Take the tote!", + "url":"https://sienna-grasshopper-3262.twil.io/assets/tote.jpeg" + } + ] + }, + { + "title":"Twilio Bucket Hat", + "body":"Stay in the shade.", + "media":"https://sienna-grasshopper-3262.twil.io/assets/hat.jpeg", + "actions":[ + { + "type":"QUICK_REPLY", + "title":"I want it!", + "id":"want_hat" + }, + { + "type":"URL", + "title":"Hand me the hat!", + "url":"https://sienna-grasshopper-3262.twil.io/assets/hat.jpeg" + } + ] + }, + { + "title":"Twilio Mug", + "body":"Sip a little.", + "media":"https://sienna-grasshopper-3262.twil.io/assets/mug.jpeg", + "actions":[ + { + "type":"QUICK_REPLY", + "title":"I want it!", + "id":"want_mug" + }, + { + "type":"URL", + "title":"Make me a mug!", + "url":"https://sienna-grasshopper-3262.twil.io/assets/mug.jpeg" + } + ] + } +] + } + } +}' diff --git a/messaging/content-templates/create-carousel-template/meta.json b/messaging/content-templates/create-carousel-template/meta.json new file mode 100644 index 000000000..c9d5e7050 --- /dev/null +++ b/messaging/content-templates/create-carousel-template/meta.json @@ -0,0 +1,6 @@ +{ + "title": "Content Templates API - Create a Carousel Template", + "title_override": "Create Carousel Content Template", + "description_override": "", + "type": "server" +} \ No newline at end of file diff --git a/messaging/content-templates/create-carousel-template/output/create-carousel-template.json b/messaging/content-templates/create-carousel-template/output/create-carousel-template.json new file mode 100644 index 000000000..d09173709 --- /dev/null +++ b/messaging/content-templates/create-carousel-template/output/create-carousel-template.json @@ -0,0 +1,95 @@ +{ + "account_sid": "ACXXXXXXXX", + "date_created": "2024-07-24T20:35:59Z", + "date_updated": "2024-07-24T20:35:59Z", + "friendly_name": "twilio_deal", + "language": "en", + "links": { + "approval_create": "https://content.twilio.com/v1/Content/HXxxxxxxxxx/ApprovalRequests/whatsapp", + "approval_fetch": "https://content.twilio.com/v1/Content/HXxxxxxxxxx/ApprovalRequests" + }, + "sid": "HXxxxxxxx", + "types": { + "twilio/carousel": { + "body": "New {{1}} merch just dropped! 👀", + "cards": [ + { + "actions": [ + { + "id": "want_hoodie", + "index": 0, + "title": "I want it!", + "type": "QUICK_REPLY" + }, + { + "title": "I'm taking this!", + "type": "URL", + "url": "https://sienna-grasshopper-3262.twil.io/assets/hoodie.jpeg" + } + ], + "body": "Warm as owl feathers.", + "media": "https://sienna-grasshopper-3262.twil.io/assets/hoodie.jpeg", + "title": "Twilio Hoodie" + }, + { + "actions": [ + { + "id": "want_tote", + "index": 0, + "title": "I want it!", + "type": "QUICK_REPLY" + }, + { + "title": "Take the tote!", + "type": "URL", + "url": "https://sienna-grasshopper-3262.twil.io/assets/tote.jpeg" + } + ], + "body": "Carry a little more.", + "media": "https://sienna-grasshopper-3262.twil.io/assets/tote.jpeg", + "title": "Twilio Tote" + }, + { + "actions": [ + { + "id": "want_hat", + "index": 0, + "title": "I want it!", + "type": "QUICK_REPLY" + }, + { + "title": "Hand me the hat!", + "type": "URL", + "url": "https://sienna-grasshopper-3262.twil.io/assets/hat.jpeg" + } + ], + "body": "Stay in the shade.", + "media": "https://sienna-grasshopper-3262.twil.io/assets/hat.jpeg", + "title": "Twilio Bucket Hat" + }, + { + "actions": [ + { + "id": "want_mug", + "index": 0, + "title": "I want it!", + "type": "QUICK_REPLY" + }, + { + "title": "Make me a mug!", + "type": "URL", + "url": "https://sienna-grasshopper-3262.twil.io/assets/mug.jpeg" + } + ], + "body": "Sip a little.", + "media": "https://sienna-grasshopper-3262.twil.io/assets/mug.jpeg", + "title": "Twilio Mug" + } + ] + } + }, + "url": "https://content.twilio.com/v1/Content/HXxxxxxxxxx", + "variables": { + "1": "Twilio" + } +} diff --git a/messaging/content-templates/create-catalog-all-items/create-catalog-all-items.curl b/messaging/content-templates/create-catalog-all-items/create-catalog-all-items.curl new file mode 100644 index 000000000..3d723917e --- /dev/null +++ b/messaging/content-templates/create-catalog-all-items/create-catalog-all-items.curl @@ -0,0 +1,18 @@ +curl -X POST 'https://content.twilio.com/v1/Content' \ +-H 'Content-Type: application/json' \ +-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN \ +-d '{ + "friendly_name": "Catalog - all products", + "language": "en", + "variables": {"1": "menu_title", "2": "menu_name"}, + "types": { + "twilio/catalog": { + "id": "1017234312776586", + "title": "The Menu: {{1}}", + "body": "Hi, check out this menu {{2}}", + "subtitle": "Great deals", + "thumbnail_item_id": "48rme2i4po" + } + } + }' + diff --git a/messaging/content-templates/create-catalog-all-items/meta.json b/messaging/content-templates/create-catalog-all-items/meta.json new file mode 100644 index 000000000..76de9f286 --- /dev/null +++ b/messaging/content-templates/create-catalog-all-items/meta.json @@ -0,0 +1,6 @@ +{ + "title": "Content Templates API - Create a Full Catalog Template", + "title_override": "Create Full Catalog Content Template", + "description_override": "", + "type": "server" +} diff --git a/messaging/content-templates/create-catalog-all-items/output/create-catalog-all-items.json b/messaging/content-templates/create-catalog-all-items/output/create-catalog-all-items.json new file mode 100644 index 000000000..bad56c50f --- /dev/null +++ b/messaging/content-templates/create-catalog-all-items/output/create-catalog-all-items.json @@ -0,0 +1,28 @@ +{ + "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "date_created": "2024-06-10T22:02:53Z", + "date_updated": "2024-06-10T22:02:53Z", + "friendly_name": "Catalog - all products", + "language": "en", + "links": { + "approval_create": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ApprovalRequests/whatsapp", + "approval_fetch": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ApprovalRequests" + }, + "sid": "HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "types": { + "twilio/catalog": { + "body": "Hi, check out this menu {{2}}", + "dynamic_items": null, + "id": "1017234312776586", + "items": null, + "subtitle": "Great deals", + "thumbnail_item_id": "48rme2i4po", + "title": "The Menu: {{1}}" + } + }, + "url": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "variables": { + "1": "menu_title", + "2": "menu_name" + } +} \ No newline at end of file diff --git a/messaging/content-templates/create-catalog-static-items/create-catalog-static-items.curl b/messaging/content-templates/create-catalog-static-items/create-catalog-static-items.curl new file mode 100644 index 000000000..087278f21 --- /dev/null +++ b/messaging/content-templates/create-catalog-static-items/create-catalog-static-items.curl @@ -0,0 +1,18 @@ +curl -X POST 'https://content.twilio.com/v1/Content' \ +-H 'Content-Type: application/json' \ +-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN \ +-d '{ + "friendly_name": "fixedproducts", + "language": "en", + "variables": {"1": "menu_ad", "2": "menu_name"}, + "types": { + "twilio/catalog": { + "id": "1017234312776586", + "body": "Hi, check out this menu {{1}}", + "subtitle": "Great deals", + "title": "The Menu: {{2}}", + "thumbnail_item_id": "48rme2i4po", + "items": [ {"id": "48rme2i4po", "section_title": "veggies"}] + } +} +}' diff --git a/messaging/content-templates/create-catalog-static-items/meta.json b/messaging/content-templates/create-catalog-static-items/meta.json new file mode 100644 index 000000000..30bee9c31 --- /dev/null +++ b/messaging/content-templates/create-catalog-static-items/meta.json @@ -0,0 +1,7 @@ +{ + "title": "Content Templates API - Create Static Catalog Template", + "highlight": "{}", + "title_override": "Create Static Catalog Content Template", + "description_override": "", + "type": "server" +} diff --git a/messaging/content-templates/create-catalog-static-items/output/create-catalog-static-items.json b/messaging/content-templates/create-catalog-static-items/output/create-catalog-static-items.json new file mode 100644 index 000000000..72dc63ce5 --- /dev/null +++ b/messaging/content-templates/create-catalog-static-items/output/create-catalog-static-items.json @@ -0,0 +1,37 @@ +{ + "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "date_created": "2024-06-10T22:16:39Z", + "date_updated": "2024-06-10T22:16:39Z", + "friendly_name": "fixedproducts", + "language": "en", + "links": { + "approval_create": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ApprovalRequests/whatsapp", + "approval_fetch": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ApprovalRequests" + }, + "sid": "HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "types": { + "twilio/catalog": { + "body": "Hi, check out this menu {{1}}", + "dynamic_items": null, + "id": "1017234312776586", + "items": [ + { + "description": null, + "id": "48rme2i4po", + "media_url": null, + "name": null, + "price": null, + "section_title": "veggies" + } + ], + "subtitle": "Great deals", + "thumbnail_item_id": "48rme2i4po", + "title": "The Menu: {{2}}" + } + }, + "url": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "variables": { + "1": "menu_ad", + "2": "menu_name" + } +} diff --git a/messaging/content-templates/create-catalog-template-dynamic-items/create-catalog-template-dynamic-items.curl b/messaging/content-templates/create-catalog-template-dynamic-items/create-catalog-template-dynamic-items.curl new file mode 100644 index 000000000..07714e0e1 --- /dev/null +++ b/messaging/content-templates/create-catalog-template-dynamic-items/create-catalog-template-dynamic-items.curl @@ -0,0 +1,18 @@ +curl -X POST 'https://content.twilio.com/v1/Content' \ +-H 'Content-Type: application/json' \ +-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN \ +-d '{ + "friendly_name": "dynamicproducts", + "language": "en", + "variables": {"1": "Hi, check out this menu menu_name", "2": "footer text"}, + "types": { + "twilio/catalog": { + "id": "1017234312776586", + "title": "The Menu: {{1}}", + "body": "{{2}}", + "subtitle": "{{3}}", + "dynamic_items": "{{products}}" + } +} +}' + diff --git a/messaging/content-templates/create-catalog-template-dynamic-items/meta.json b/messaging/content-templates/create-catalog-template-dynamic-items/meta.json new file mode 100644 index 000000000..62e41acd3 --- /dev/null +++ b/messaging/content-templates/create-catalog-template-dynamic-items/meta.json @@ -0,0 +1,5 @@ +{ + "title": "Content Templates API - Create Catalog Template with Dynamic Items", + "title_override": "Create Dynamic Catalog Content Template", + "type": "server" +} diff --git a/messaging/content-templates/create-catalog-template-dynamic-items/output/create-catalog-template-dynamic-items.json b/messaging/content-templates/create-catalog-template-dynamic-items/output/create-catalog-template-dynamic-items.json new file mode 100644 index 000000000..2936bf608 --- /dev/null +++ b/messaging/content-templates/create-catalog-template-dynamic-items/output/create-catalog-template-dynamic-items.json @@ -0,0 +1,28 @@ +{ + "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "date_created": "2024-06-10T22:25:37Z", + "date_updated": "2024-06-10T22:25:37Z", + "friendly_name": "dynamicproducts", + "language": "en", + "links": { + "approval_create": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ApprovalRequests/whatsapp", + "approval_fetch": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ApprovalRequests" + }, + "sid": "HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "types": { + "twilio/catalog": { + "body": "{{2}}", + "dynamic_items": "{{products}}", + "id": "1017234312776586", + "items": null, + "subtitle": "{{3}}", + "thumbnail_item_id": null, + "title": "The Menu: {{1}}" + } + }, + "url": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "variables": { + "1": "Hi, check out this menu menu_name", + "2": "footer text" + } +} \ No newline at end of file diff --git a/messaging/content-templates/create-list-picker-template/create-list-picker-template.cs b/messaging/content-templates/create-list-picker-template/create-list-picker-template.cs new file mode 100644 index 000000000..c775fb40d --- /dev/null +++ b/messaging/content-templates/create-list-picker-template/create-list-picker-template.cs @@ -0,0 +1,43 @@ +// Install the C# / .NET helper library from twilio.com/docs/csharp/install + +using System; +using Twilio; +using Twilio.Rest.Content.V1; + + TwilioClient.Init(accountSid, authToken); + + // define the twilio/list-picker + var twilioListPicker = new TwilioListPicker.Builder(); + twilioListPicker.WithBody("Owl Air Flash Sale! Hurry! Sale ends on {{1}}!"); + var item1 = new ListPickerItems.Builder() + .WithItem("SFO to NYC for $299") + .WithDescription("Owl Air Flight 1337 to LGA") + .WithId("SFO1337") + .Build(); + var item2 = new ListPickerItems.Builder() + .WithItem("OAK to Denver for $149") + .WithDescription("Owl Air Flight 5280 to DEN") + .WithId("OAK5280") + .Build(); + var item3 = new ListPickerItems.Builder() + .WithItem("LAX to Chicago for $199") + .WithDescription("Owl Air Flight 96 to ORD") + .WithId("LAX96") + .Build(); + twilioListPicker.WithItems(new List() { item1, item2, item3 }); + + // define all the content types to be part of the template + var types = new Types.Builder(); + types.WithTwilioListPicker(twilioListPicker.Build()); + + // build the create request object + var contentCreateRequest = new ContentCreateRequest.Builder(); + contentCreateRequest.WithTypes(types.Build()); + contentCreateRequest.WithLanguage("en"); + contentCreateRequest.WithFriendlyName("owl_sale_list"); + contentCreateRequest.WithVariables(new Dictionary() { {"1", "end_date"} }); + + // create the twilio template + var contentTemplate = await CreateAsync(contentCreateRequest.Build()); + + Console.WriteLine($"Created Twilio Content Template SID: {contentTemplate.Sid}"); diff --git a/messaging/content-templates/create-list-picker-template/create-list-picker-template.curl b/messaging/content-templates/create-list-picker-template/create-list-picker-template.curl new file mode 100644 index 000000000..32b53f88c --- /dev/null +++ b/messaging/content-templates/create-list-picker-template/create-list-picker-template.curl @@ -0,0 +1,36 @@ +curl -X POST 'https://content.twilio.com/v1/Content' \ +-H 'Content-Type: application/json' \ +-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN \ +-d '{ + "friendly_name": "owl_air_list", + "language": "en", + "variables": { + "1": "end_date" + }, + "types": { + "twilio/list-picker": { + "body": "Owl Air Flash Sale! Hurry! Sale ends on {{1}}!", + "button": "Select a destination", + "items": [ + { + "item": "SFO to NYC for $299", + "description": "Owl Air Flight 1337 to LGA", + "id": "SFO1337" + }, + { + "item": "OAK to Denver for $149", + "description": "Owl Air Flight 5280 to DEN", + "id": "OAK5280" + }, + { + "item": "LAX to Chicago for $199", + "description": "Owl Air Flight 96 to ORD", + "id": "LAX96" + } + ] + }, + "twilio/text": { + "body": "We have flights to the following destinations: (1) SFO, (2) OAK, (3) LAX. Hurry! Sale ends on {{1}}!" + } + } +}' diff --git a/messaging/content-templates/create-list-picker-template/create-list-picker-template.java b/messaging/content-templates/create-list-picker-template/create-list-picker-template.java new file mode 100644 index 000000000..7e3b01843 --- /dev/null +++ b/messaging/content-templates/create-list-picker-template/create-list-picker-template.java @@ -0,0 +1,44 @@ +package Examples; + +import com.twilio.rest.content.v1.Content; + +import java.util.Arrays; +import java.util.Map; + +public class TwilioListPicker { + public static String CreateTemplate() { + var twilioListPicker = new Content.TwilioListPicker(); + twilioListPicker.setBody("Owl Air Flash Sale! Hurry! Sale ends on {{1}}!"); + + var item1 = new Content.ListItem(); + item1.setItem("SFO to NYC for $299"); + item1.setDescription("Owl Air Flight 1337 to LGA"); + item1.setId("SFO1337"); + + var item2 = new Content.ListItem(); + item1.setItem("OAK to Denver for $149"); + item1.setDescription("Owl Air Flight 5280 to DEN"); + item1.setId("OAK5280"); + + var item3 = new Content.ListItem(); + item1.setItem("LAX to Chicago for $199"); + item1.setDescription("Owl Air Flight 96 to ORD"); + item1.setId("LAX96"); + + twilioListPicker.setItems(Arrays.asList(item1)); + twilioListPicker.setButton("Select Flight"); + + var types = new Content.Types(); + types.setTwilioListPicker(twilioListPicker); + + var createRequest = new Content.ContentCreateRequest("en", types); + createRequest.setFriendlyName("owl_air_list"); + createRequest.setVariables(Map.of( + "1", "end_date" + )); + + var content = Content.creator(createRequest).create(); + + return content.getSid(); + } +} diff --git a/messaging/content-templates/create-list-picker-template/meta.json b/messaging/content-templates/create-list-picker-template/meta.json new file mode 100644 index 000000000..ac3e3c912 --- /dev/null +++ b/messaging/content-templates/create-list-picker-template/meta.json @@ -0,0 +1,4 @@ +{ + "title": "Content Templates API - Create a List Picker Template", + "type": "server" +} diff --git a/messaging/content-templates/create-list-picker-template/output/create-list-picker-template.json b/messaging/content-templates/create-list-picker-template/output/create-list-picker-template.json new file mode 100644 index 000000000..70d2e1e26 --- /dev/null +++ b/messaging/content-templates/create-list-picker-template/output/create-list-picker-template.json @@ -0,0 +1,42 @@ +{ + "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "date_created": "2022-08-29T15:46:11Z", + "date_updated": "2022-08-29T15:46:11Z", + "friendly_name": "owl_air_list", + "language": "en", + "links": { + "approval_create": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ApprovalRequests/whatsapp", + "approval_fetch": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ApprovalRequests" + }, + "sid": "HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "types": { + "twilio/list-picker": { + "body": "Owl Air Flash Sale! Hurry! Sale ends on {{1}}!", + "button": "Select a destination", + "items": [ + { + "description": "Owl Air Flight 1337 to LGA", + "id": "SFO1337", + "item": "SFO to NYC for $299" + }, + { + "description": "Owl Air Flight 5280 to DEN", + "id": "OAK5280", + "item": "OAK to Denver for $149" + }, + { + "description": "Owl Air Flight 96 to ORD", + "id": "LAX96", + "item": "LAX to Chicago for $199" + } + ] + }, + "twilio/text": { + "body": "We have flights to the following destinations: (1) SFO, (2) OAK, (3) LAX. Hurry! Sale ends on {{1}}!" + } + }, + "url": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "variables": { + "1": "end_date" + } +} diff --git a/messaging/content-templates/create-location-template/create-location-template.cs b/messaging/content-templates/create-location-template/create-location-template.cs new file mode 100644 index 000000000..e7123aedb --- /dev/null +++ b/messaging/content-templates/create-location-template/create-location-template.cs @@ -0,0 +1,33 @@ +// Install the C# / .NET helper library from twilio.com/docs/csharp/install + +using System; +using Twilio; +using Twilio.Rest.Content.V1; + + TwilioClient.Init(accountSid, authToken); + + // define the twilio/text + var twilioText = new TwilioText.Builder(); + twilioText.WithBody("Owl Air: Time to board, SFO is located at San Francisco International Airport, P.O. Box 8097, San Francisco, CA 94128 "); + + // define the twilio/location + var twilioLocation = new TwilioLocation.Builder(); + twilioLocation.WithLabel("Time to Board @ SFO"); + twilioLocaiton.WithLatitude(37.62159755922449) + twilioLocaiton.WithLongitude(-122.37888566473057) + + // define all the content types to be part of the template + var types = new Types.Builder(); + types.WithTwilioText(twilioText.Build()); + types.WithTwilioLocation(twilioLocation.Build()); + + // build the create request object + var contentCreateRequest = new ContentCreateRequest.Builder(); + contentCreateRequest.WithTypes(types.Build()); + contentCreateRequest.WithLanguage("en"); + contentCreateRequest.WithFriendlyName("owl_air_location"); + + // create the twilio template + var contentTemplate = await CreateAsync(contentCreateRequest.Build()); + + Console.WriteLine($"Created Twilio Content Template SID: {contentTemplate.Sid}"); diff --git a/messaging/content-templates/create-location-template/create-location-template.curl b/messaging/content-templates/create-location-template/create-location-template.curl new file mode 100644 index 000000000..d4d2e9b41 --- /dev/null +++ b/messaging/content-templates/create-location-template/create-location-template.curl @@ -0,0 +1,17 @@ +curl -X POST 'https://content.twilio.com/v1/Content' \ +-H 'Content-Type: application/json' \ +-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN \ +-d '{ + "friendly_name": "owl_air_location", + "language": "en", + "types": { + "twilio/text": { + "body": "Owl Air: Time to board, SFO is located at San Francisco International Airport, P.O. Box 8097, San Francisco, CA 94128 " + }, + "twilio/location": { + "latitude": 37.62159755922449, + "longitude": -122.37888566473057, + "label": "Time to Board @ SFO" + } + } +}' diff --git a/messaging/content-templates/create-location-template/create-location-template.java b/messaging/content-templates/create-location-template/create-location-template.java new file mode 100644 index 000000000..43462a43d --- /dev/null +++ b/messaging/content-templates/create-location-template/create-location-template.java @@ -0,0 +1,32 @@ +package Examples; + +import com.twilio.rest.content.v1.Content; +import java.math.BigDecimal; +import java.util.Arrays; +import java.util.Map; + +public class TwilioLocation { + public static String CreateTemplate() { + var twilioText = new Content.TwilioText(); + twilioText.setBody("Owl Air: Time to board, SFO is located at San Francisco International Airport, P.O. Box 8097, San Francisco, CA 94128"); + + var twilioLocation = new Content.TwilioLocation(); + twilioLocation.setLabel("Time to Board @ SFO"); + twilioLocation.setLatitude(new BigDecimal(37.62159755922449)); + twilioLocation.setLongitude(new BigDecimal(-122.37888566473057)); + + var types = new Content.Types(); + types.setTwilioText(twilioText); + types.setTwilioLocation(twilioLocation); + + var createRequest = new Content.ContentCreateRequest("en", types); + createRequest.setFriendlyName("owl_air_location"); + createRequest.setVariables(Map.of( + "1", "John" + )); + + var content = Content.creator(createRequest).create(); + + return content.getSid(); + } +} diff --git a/messaging/content-templates/create-location-template/meta.json b/messaging/content-templates/create-location-template/meta.json new file mode 100644 index 000000000..9fbd2ff24 --- /dev/null +++ b/messaging/content-templates/create-location-template/meta.json @@ -0,0 +1,4 @@ +{ + "title": "Content Templates API - Create a Location Template", + "type": "server" +} diff --git a/messaging/content-templates/create-location-template/output/create-location-template.json b/messaging/content-templates/create-location-template/output/create-location-template.json new file mode 100644 index 000000000..d72a46022 --- /dev/null +++ b/messaging/content-templates/create-location-template/output/create-location-template.json @@ -0,0 +1,24 @@ +{ + "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "date_created": "2022-08-29T15:23:12Z", + "date_updated": "2022-08-29T15:23:12Z", + "friendly_name": "owl_air_location", + "language": "en", + "links": { + "approval_create": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ApprovalRequests/whatsapp", + "approval_fetch": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ApprovalRequests" + }, + "sid": "HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "types": { + "twilio/location": { + "label": "Time to Board @ SFO", + "latitude": 37.62159755922449, + "longitude": -122.37888566473057 + }, + "twilio/text": { + "body": "Owl Air: Time to board, SFO is located at San Francisco International Airport, P.O. Box 8097, San Francisco, CA 94128 " + } + }, + "url": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "variables": {} +} diff --git a/messaging/content-templates/create-media-template/create-media-template.cs b/messaging/content-templates/create-media-template/create-media-template.cs new file mode 100644 index 000000000..6eb28b426 --- /dev/null +++ b/messaging/content-templates/create-media-template/create-media-template.cs @@ -0,0 +1,31 @@ +// Install the C# / .NET helper library from twilio.com/docs/csharp/install + +using System; +using Twilio; +using Twilio.Rest.Content.V1; + + TwilioClient.Init(accountSid, authToken); + + // define the twilio/media type + var twilioMedia = new TwilioMedia.Builder(); + twilioMedia.WithBody("Thank you for your order {{1}}"); + var media1 = new Media.Builder() + .WithMedia("https://twilio-cms-prod.s3.amazonaws.com/images/library-logo-resource2x.width-1000.png") + .Build(); + twilioMedia.WithMedia(new List() { media1 }); + + // define all the content types to be part of the template + var types = new Types.Builder(); + types.WithTwilioMedia(twilioMedia.Build()); + + // build the create request object + var contentCreateRequest = new ContentCreateRequest.Builder(); + contentCreateRequest.WithTypes(types.Build()); + contentCreateRequest.WithLanguage("en"); + contentCreateRequest.WithFriendlyName("media_template"); + contentCreateRequest.WithVariables(new Dictionary() { {"1", "OrderNumber"} }); + + // create the twilio template + var contentTemplate = await CreateAsync(contentCreateRequest.Build()); + + Console.WriteLine($"Created Twilio Content Template SID: {contentTemplate.Sid}"); diff --git a/messaging/content-templates/create-media-template/create-media-template.curl b/messaging/content-templates/create-media-template/create-media-template.curl new file mode 100644 index 000000000..772943688 --- /dev/null +++ b/messaging/content-templates/create-media-template/create-media-template.curl @@ -0,0 +1,14 @@ +curl -X POST 'https://content.twilio.com/v1/Content' \ +-H 'Content-Type: application/json' \ +-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN \ +-d '{ + "friendly_name": "media_template", + "language": "en", + "variables": {"1":"OrderNumber"}, + "types": { + "twilio/media": { + "body": "Thank you for your order {{1}}", + "media": ["https://twilio-cms-prod.s3.amazonaws.com/images/library-logo-resource2x.width-1000.png"] + } + } +}' diff --git a/messaging/content-templates/create-media-template/create-media-template.java b/messaging/content-templates/create-media-template/create-media-template.java new file mode 100644 index 000000000..98c231079 --- /dev/null +++ b/messaging/content-templates/create-media-template/create-media-template.java @@ -0,0 +1,27 @@ +package Examples; + +import com.twilio.rest.content.v1.Content; + +import java.util.Arrays; +import java.util.Map; + +public class TwilioMedia { + public static String CreateTemplate() { + var twilioMedia = new Content.TwilioMedia(); + twilioMedia.setBody("Thank you for your order {{1}}"); + twilioMedia.setMedia(Arrays.asList("https://twilio-cms-prod.s3.amazonaws.com/images/library-logo-resource2x.width-1000.png")); + + var types = new Content.Types(); + types.setTwilioMedia(twilioMedia); + + var createRequest = new Content.ContentCreateRequest("en", types); + createRequest.setFriendlyName("media_template"); + createRequest.setVariables(Map.of( + "1", "order_number" + )); + + var content = Content.creator(createRequest).create(); + + return content.getSid(); + } +} diff --git a/messaging/content-templates/create-media-template/meta.json b/messaging/content-templates/create-media-template/meta.json new file mode 100644 index 000000000..f0d57d7f4 --- /dev/null +++ b/messaging/content-templates/create-media-template/meta.json @@ -0,0 +1,4 @@ +{ + "title": "Content Templates API - Create a Media Template", + "type": "server" +} diff --git a/messaging/content-templates/create-media-template/output/create-media-template.json b/messaging/content-templates/create-media-template/output/create-media-template.json new file mode 100644 index 000000000..ab1b59f51 --- /dev/null +++ b/messaging/content-templates/create-media-template/output/create-media-template.json @@ -0,0 +1,24 @@ +{ + "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "date_created": "2022-08-29T15:12:22Z", + "date_updated": "2022-08-29T15:12:22Z", + "friendly_name": "media_template", + "language": "en", + "links": { + "approval_create": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ApprovalRequests/whatsapp", + "approval_fetch": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ApprovalRequests" + }, + "sid": "HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "types": { + "twilio/media": { + "body": "Thank you for your order {{1}}", + "media": [ + "https://twilio-cms-prod.s3.amazonaws.com/images/library-logo-resource2x.width-1000.png" + ] + } + }, + "url": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "variables": { + "1": "OrderNumber" + } +} diff --git a/messaging/content-templates/create-text-template/create-text-template.cs b/messaging/content-templates/create-text-template/create-text-template.cs new file mode 100644 index 000000000..4bc3b28d2 --- /dev/null +++ b/messaging/content-templates/create-text-template/create-text-template.cs @@ -0,0 +1,27 @@ +// Install the C# / .NET helper library from twilio.com/docs/csharp/install + +using System; +using Twilio; +using Twilio.Rest.Content.V1; + + TwilioClient.Init(accountSid, authToken); + + // define the twilio/text + var twilioText = new TwilioText.Builder(); + twilioText.WithBody("Hi {{1}}. Thanks for contacting Owl Air Support. How can we help?"); + + // define all the content types to be part of the template + var types = new Types.Builder(); + types.WithTwilioText(twilioText.Build()); + + // build the create request object + var contentCreateRequest = new ContentCreateRequest.Builder(); + contentCreateRequest.WithTypes(types.Build()); + contentCreateRequest.WithLanguage("en"); + contentCreateRequest.WithFriendlyName("text_template"); + contentCreateRequest.WithVariables(new Dictionary() { {"1", "John"} }); + + // create the twilio template + var contentTemplate = await CreateAsync(contentCreateRequest.Build()); + + Console.WriteLine($"Created Twilio Content Template SID: {contentTemplate.Sid}"); diff --git a/messaging/content-templates/create-text-template/create-text-template.curl b/messaging/content-templates/create-text-template/create-text-template.curl new file mode 100644 index 000000000..6348db7f9 --- /dev/null +++ b/messaging/content-templates/create-text-template/create-text-template.curl @@ -0,0 +1,13 @@ +curl -X POST 'https://content.twilio.com/v1/Content' \ +-H 'Content-Type: application/json' \ +-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN \ +-d '{ + "friendly_name": "media_template", + "language": "en", + "variables": {"1":"name"}, + "types": { + "twilio/text": { + "body": "Hi, {{1}}. \n Thanks for contacting Owl Air Support. How can I help?." + } + } +}' diff --git a/messaging/content-templates/create-text-template/create-text-template.java b/messaging/content-templates/create-text-template/create-text-template.java new file mode 100644 index 000000000..96a515776 --- /dev/null +++ b/messaging/content-templates/create-text-template/create-text-template.java @@ -0,0 +1,26 @@ +package Examples; + +import com.twilio.rest.content.v1.Content; + +import java.util.Arrays; +import java.util.Map; + +public class TwilioText { + public static String CreateTemplate() { + var twilioText = new Content.TwilioText(); + twilioText.setBody("Hi {{1}}, thanks for contacting Owl Air Support. How can we help?"); + + var types = new Content.Types(); + types.setTwilioText(twilioText); + + var createRequest = new Content.ContentCreateRequest("en", types); + createRequest.setFriendlyName("media_template"); + createRequest.setVariables(Map.of( + "1", "first_name" + )); + + var content = Content.creator(createRequest).create(); + + return content.getSid(); + } +} diff --git a/messaging/content-templates/create-text-template/meta.json b/messaging/content-templates/create-text-template/meta.json new file mode 100644 index 000000000..bb7181e1f --- /dev/null +++ b/messaging/content-templates/create-text-template/meta.json @@ -0,0 +1,4 @@ +{ + "title": "Content Templates API - Create a Text Template", + "type": "server" +} diff --git a/messaging/content-templates/create-text-template/output/create-text-template.json b/messaging/content-templates/create-text-template/output/create-text-template.json new file mode 100644 index 000000000..1e6d81847 --- /dev/null +++ b/messaging/content-templates/create-text-template/output/create-text-template.json @@ -0,0 +1,21 @@ +{ + "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "date_created": "2022-09-01T12:39:19Z", + "date_updated": "2022-09-01T12:39:19Z", + "friendly_name": "media_template", + "language": "en", + "links": { + "approval_create": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ApprovalRequests/whatsapp", + "approval_fetch": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ApprovalRequests" + }, + "sid": "HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "types": { + "twilio/text": { + "body": "Hi, {{1}}. \n Thanks for contacting Owl Air Support. How can I help?." + } + }, + "url": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "variables": { + "1": "name" + } +} diff --git a/messaging/content-templates/create-wa-otp-button-template/create-wa-otp-button-template.cs b/messaging/content-templates/create-wa-otp-button-template/create-wa-otp-button-template.cs new file mode 100644 index 000000000..efec7c679 --- /dev/null +++ b/messaging/content-templates/create-wa-otp-button-template/create-wa-otp-button-template.cs @@ -0,0 +1,30 @@ +// Install the C# / .NET helper library from twilio.com/docs/csharp/install + +using System; +using Twilio; +using Twilio.Rest.Content.V1; + + TwilioClient.Init(accountSid, authToken); + + // define the whatsapp/authentication type + var whatsappAuthentication = new WhatsappAuthentication.Builder(); + var auth1 = new WhatsappAuthAction.Builder() + .WithType(WhatsappAuthActionType.CopyCode) + .WithCopyCodeText("Check Flight Status") + .Build(); + whatsappAuthentication.WithActions(new List() { auth1 }); + + // define all the content types to be part of the template + var types = new Types.Builder(); + types.WithWhatsappAuthentication(whatsappAuthentication.Build()); + + // build the create request object + var contentCreateRequest = new ContentCreateRequest.Builder(); + contentCreateRequest.WithTypes(types.Build()); + contentCreateRequest.WithLanguage("en"); + contentCreateRequest.WithFriendlyName("whatsapp_otp"); + + // create the twilio template + var contentTemplate = await CreateAsync(contentCreateRequest.Build()); + + Console.WriteLine($"Created Twilio Content Template SID: {contentTemplate.Sid}"); diff --git a/messaging/content-templates/create-wa-otp-button-template/create-wa-otp-button-template.curl b/messaging/content-templates/create-wa-otp-button-template/create-wa-otp-button-template.curl new file mode 100644 index 000000000..c091ccde1 --- /dev/null +++ b/messaging/content-templates/create-wa-otp-button-template/create-wa-otp-button-template.curl @@ -0,0 +1,17 @@ +curl -X POST 'https://content.twilio.com/v1/Content' \ +-H 'Content-Type: application/json' \ +-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN \ +-d '{ + "friendly_name": "whatsapp_otp", + "language": "en", + "types": { + "whatsapp/authentication":{ + "add_security_recommendation": true, + "code_expiration_minutes": "30", + "actions": [{ + "type": "COPY_CODE", + "copy_code_text": "Copy verification code" + }] + } + } + }' diff --git a/messaging/content-templates/create-wa-otp-button-template/create-wa-otp-button-template.java b/messaging/content-templates/create-wa-otp-button-template/create-wa-otp-button-template.java new file mode 100644 index 000000000..d8892b820 --- /dev/null +++ b/messaging/content-templates/create-wa-otp-button-template/create-wa-otp-button-template.java @@ -0,0 +1,30 @@ +package Examples; + +import com.twilio.rest.content.v1.Content; +import java.math.BigDecimal; +import java.util.Arrays; +import java.util.Map; + +public class WhatsAppAuthentication { + public static String CreateTemplate() { + var waAuth = new Content.WhatsappAuthentication(); + + var action1 = new Content.AuthenticationAction(); + action1.setType(Content.AuthenticationActionType.COPY_CODE); + action1.setCopyCodeText("Copy Code"); + + waAuth.setActions(Arrays.asList(action1)); + waAuth.setAddSecurityRecommendation(true); + waAuth.setCodeExpirationMinutes(new BigDecimal(10)); + + var types = new Content.Types(); + types.setWhatsappAuthentication(waAuth); + + var createRequest = new Content.ContentCreateRequest("en", types); + createRequest.setFriendlyName("whatsapp_otp"); + + var content = Content.creator(createRequest).create(); + + return content.getSid(); + } +} diff --git a/messaging/content-templates/create-wa-otp-button-template/meta.json b/messaging/content-templates/create-wa-otp-button-template/meta.json new file mode 100644 index 000000000..7d1952fbb --- /dev/null +++ b/messaging/content-templates/create-wa-otp-button-template/meta.json @@ -0,0 +1,4 @@ +{ + "title": "Content Templates API - Create a WhatsApp One-time Passcode (OTP) Button Template", + "type": "server" +} diff --git a/messaging/content-templates/create-wa-otp-button-template/output/create-wa-otp-button-template.json b/messaging/content-templates/create-wa-otp-button-template/output/create-wa-otp-button-template.json new file mode 100644 index 000000000..109480045 --- /dev/null +++ b/messaging/content-templates/create-wa-otp-button-template/output/create-wa-otp-button-template.json @@ -0,0 +1,27 @@ +{ + "account_sid": "$TWILIO_ACCOUNT_SID", + "date_created": "2023-06-02T14:34:25Z", + "date_updated": "2023-06-02T14:34:25Z", + "friendly_name": "whatsapp_otp", + "language": "en", + "links": { + "approval_create": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ApprovalRequests/whatsapp", + "approval_fetch": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ApprovalRequests" + }, + "sid": "HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "types": { + "whatsapp/authentication": { + "actions": [ + { + "copy_code_text": "Copy verification code", + "type": "COPY_CODE" + } + ], + "add_security_recommendation": true, + "body": "{{1}}", + "code_expiration_minutes": 30 + } + }, + "url": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "variables": {} +} diff --git a/messaging/content-templates/create-whatsapp-card/create-whatsapp-card.cs b/messaging/content-templates/create-whatsapp-card/create-whatsapp-card.cs new file mode 100644 index 000000000..eadc6e1a7 --- /dev/null +++ b/messaging/content-templates/create-whatsapp-card/create-whatsapp-card.cs @@ -0,0 +1,40 @@ +// Install the C# / .NET helper library from twilio.com/docs/csharp/install + +using System; +using Twilio; +using Twilio.Rest.Content.V1; + + TwilioClient.Init(accountSid, authToken); + + // define the whatsapp/card + var whatsappCard = new WhatsappCard.Builder(); + whatsappCard.WithBody("Congratulations, you have reached Elite status! Add code {{1}} for 10% off."); + whatsappCard.WithHeaderText("This is a {{1}} card"); + whatsappCard.WithFooter("To unsubscribe, reply Stop"); + var cardAction1 = new CardAction.Builder() + .WithType(CardActionType.Url) + .WithUrl("https://www.twilio.com/") + .WithTitle("Order Online") + .Build(); + var cardAction2 = new CardAction.Builder() + .WithType(CardActionType.PhoneNumber) + .WithPhone("+15551234567") + .WithTitle("Call Us") + .Build(); + whatsappCard.WithActions(new List() { cardAction1, cardAction2 }); + + // define all the content types to be part of the template + var types = new Types.Builder(); + types.WithWhatsappCard(whatsappCard.Build()); + + // build the create request object + var contentCreateRequest = new ContentCreateRequest.Builder(); + contentCreateRequest.WithTypes(types.Build()); + contentCreateRequest.WithLanguage("en"); + contentCreateRequest.WithFriendlyName("owl_coupon_code"); + contentCreateRequest.WithVariables(new Dictionary() { {"1", "coupon_code"} }); + + // create the twilio template + var contentTemplate = await CreateAsync(contentCreateRequest.Build()); + + Console.WriteLine($"Created Twilio Content Template SID: {contentTemplate.Sid}"); diff --git a/messaging/content-templates/create-whatsapp-card/create-whatsapp-card.curl b/messaging/content-templates/create-whatsapp-card/create-whatsapp-card.curl new file mode 100644 index 000000000..d0b69a230 --- /dev/null +++ b/messaging/content-templates/create-whatsapp-card/create-whatsapp-card.curl @@ -0,0 +1,29 @@ +curl -X POST 'https://content.twilio.com/v1/Content' \ +-H 'Content-Type: application/json' \ +-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN \ +-d '{ + "friendly_name": "owl_coupon_code", + "language": "en", + "variables": { + "1": "coupon_code" + }, + "types": { + "whatsapp/card": { + "body": "Congratulations, you have reached Elite status! Add code {{1}} for 10% off.", + "header_text": "This is a {{1}} card", + "footer": "To unsubscribe, reply Stop", + "actions": [ + { + "url": "https://owlair.example.com/", + "title": "Order Online", + "type": "URL" + }, + { + "phone": "+15555554567", + "title": "Call Us", + "type": "PHONE_NUMBER" + } + ] + } + } +}' diff --git a/messaging/content-templates/create-whatsapp-card/create-whatsapp-card.java b/messaging/content-templates/create-whatsapp-card/create-whatsapp-card.java new file mode 100644 index 000000000..454f36e85 --- /dev/null +++ b/messaging/content-templates/create-whatsapp-card/create-whatsapp-card.java @@ -0,0 +1,40 @@ +package Examples; + +import com.twilio.rest.content.v1.Content; + +import java.util.Arrays; +import java.util.Map; + +public class WhatsAppCard { + public static String CreateTemplate() { + var waCard = new Content.WhatsappCard(); + waCard.setBody("Congratulations, you have reached Elite status! Add code {{1}} for 10% off."); + waCard.setHeaderText("This is a {{1}} card"); + waCard.setFooter("To unsubscribe, reply Stop"); + + var action1 = new Content.CardAction(); + action1.setType(Content.CardActionType.URL); + action1.setUrl("https://www.twilio.com/"); + action1.setTitle("Order Online"); + + var action2 = new Content.CardAction(); + action1.setType(Content.CardActionType.PHONE_NUMBER); + action1.setPhone("+15551234567"); + action1.setTitle("Call Us"); + + waCard.setActions(Arrays.asList(action1)); + + var types = new Content.Types(); + types.setWhatsappCard(waCard); + + var createRequest = new Content.ContentCreateRequest("en", types); + createRequest.setFriendlyName("owl_coupon_code"); + createRequest.setVariables(Map.of( + "1", "coupon_code" + )); + + var content = Content.creator(createRequest).create(); + + return content.getSid(); + } +} diff --git a/messaging/content-templates/create-whatsapp-card/meta.json b/messaging/content-templates/create-whatsapp-card/meta.json new file mode 100644 index 000000000..6c34b97b3 --- /dev/null +++ b/messaging/content-templates/create-whatsapp-card/meta.json @@ -0,0 +1,6 @@ +{ + "title": "Content Templates API - Create a WhatsApp Card Template", + "highlight": "{}", + "title_override": "Create a WhatsApp Card Template", + "description_override": "" +} diff --git a/messaging/content-templates/create-whatsapp-card/output/create-whatsapp-card.json b/messaging/content-templates/create-whatsapp-card/output/create-whatsapp-card.json new file mode 100644 index 000000000..ef88ac2fc --- /dev/null +++ b/messaging/content-templates/create-whatsapp-card/output/create-whatsapp-card.json @@ -0,0 +1,36 @@ +{ + "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "date_created": "2023-08-03T14:54:47Z", + "date_updated": "2023-08-03T14:54:47Z", + "friendly_name": "owl_coupon_code", + "language": "en", + "links": { + "approval_create": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ApprovalRequests/whatsapp", + "approval_fetch": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ApprovalRequests" + }, + "sid": "HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "types": { + "whatsapp/card": { + "actions": [ + { + "title": "Order Online", + "type": "URL", + "url": "https://owlair.example.com/" + }, + { + "phone": "+1555554567", + "title": "Call Us", + "type": "PHONE_NUMBER" + } + ], + "body": "Congratulations, you have reached Elite status! Add code {{1}} for 10% off.", + "footer": "To unsubscribe, reply Stop", + "header_text": "This is a {{1}} card", + "media": null + } + }, + "url": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "variables": { + "1": "coupon_code" + } +} diff --git a/messaging/content-templates/fetch-all-content-resources/fetch-all-content-resources-example.json.curl b/messaging/content-templates/fetch-all-content-resources/fetch-all-content-resources-example.json.curl new file mode 100644 index 000000000..0a970287e --- /dev/null +++ b/messaging/content-templates/fetch-all-content-resources/fetch-all-content-resources-example.json.curl @@ -0,0 +1,2 @@ +curl -X GET "https://content.twilio.com/v1/Content" +-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN diff --git a/messaging/content-templates/fetch-all-content-resources/meta.json b/messaging/content-templates/fetch-all-content-resources/meta.json new file mode 100644 index 000000000..66b8c1504 --- /dev/null +++ b/messaging/content-templates/fetch-all-content-resources/meta.json @@ -0,0 +1,5 @@ +{ + "title": "Content Templates API - Fetch all Content Resources", + "title_override": "Fetch all Content Resources", + "type": "server" +} diff --git a/messaging/content-templates/fetch-all-content-resources/output/fetch-all-content-resources.json b/messaging/content-templates/fetch-all-content-resources/output/fetch-all-content-resources.json new file mode 100644 index 000000000..d7ec03de4 --- /dev/null +++ b/messaging/content-templates/fetch-all-content-resources/output/fetch-all-content-resources.json @@ -0,0 +1,84 @@ +{ + "meta": { + "page": 0, + "page_size": 50, + "first_page_url": "https://content.twilio.com/v1/Content?PageSize=50&Page=0", + "previous_page_url": null, + "url": "https://content.twilio.com/v1/Content?PageSize=50&Page=0", + "next_page_url": "https://content.twilio.com/v1/Content?PageSize=50&Page=1&PageToken=DNHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-1678723520", + "key": "contents" + }, + "contents": [ + { + "language": "en", + "date_updated": "2023-03-31T16:06:50Z", + "variables": { + "1": "07:00", + "3": "owl.jpg", + "2": "03/01/2023" + }, + "friendly_name": "whatsappcard2", + "account_sid": "ACXXXXXXXXXXXXXXX", + "url": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "sid": "HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "date_created": "2023-03-31T16:06:50Z", + "types": { + "twilio/card": { + "body": null, + "media": [ + "https://twilio.example.com/%7B%7B3%7D%7D" + ], + "subtitle": null, + "actions": [ + { + "index": 0, + "type": "QUICK_REPLY", + "id": "Stop", + "title": "Stop Updates" + } + ], + "title": "See you at {{1}} on {{2}}. Thank you." + } + }, + "links": { + "approval_fetch": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ApprovalRequests", + "approval_create": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ApprovalRequests/whatsapp" + } + }, + { + "language": "en", + "date_updated": "2023-03-31T15:50:24Z", + "variables": { + "1": "07:00", + "2": "03/01/2023" + }, + "friendly_name": "whatswppward_01234", + "account_sid": "ACXXXXXXXXXXXXXXX", + "url": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "sid": "HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "date_created": "2023-03-31T15:50:24Z", + "types": { + "twilio/card": { + "body": null, + "media": [ + "https://twilio.example.com/owl.jpg" + ], + "subtitle": null, + "actions": [ + { + "index": 0, + "type": "QUICK_REPLY", + "id": "Stop", + "title": "Stop Updates" + } + ], + "title": "See you at {{1}} on {{2}}. Thank you." + } + }, + "links": { + "approval_fetch": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ApprovalRequests", + "approval_create": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ApprovalRequests/whatsapp" + } + } + ] +} diff --git a/messaging/content-templates/get-template-approval-status-from-whatsapp/get-template-approval-status-from-whatsapp.curl b/messaging/content-templates/get-template-approval-status-from-whatsapp/get-template-approval-status-from-whatsapp.curl new file mode 100644 index 000000000..a92aaf1b0 --- /dev/null +++ b/messaging/content-templates/get-template-approval-status-from-whatsapp/get-template-approval-status-from-whatsapp.curl @@ -0,0 +1,3 @@ +curl -X GET 'https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ApprovalRequests' \ +-H 'Content-Type: application/json' \ +-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN diff --git a/messaging/content-templates/get-template-approval-status-from-whatsapp/meta.json b/messaging/content-templates/get-template-approval-status-from-whatsapp/meta.json new file mode 100644 index 000000000..52fc61317 --- /dev/null +++ b/messaging/content-templates/get-template-approval-status-from-whatsapp/meta.json @@ -0,0 +1,5 @@ +{ + "title": "Content API - Fetch an ApprovalRequest", + "description": "Check a Template's WhatsApp Approval Status", + "type": "server" +} diff --git a/messaging/content-templates/get-template-approval-status-from-whatsapp/output/get-template-approval-status-from-whatsapp.json b/messaging/content-templates/get-template-approval-status-from-whatsapp/output/get-template-approval-status-from-whatsapp.json new file mode 100644 index 000000000..1e22cfca7 --- /dev/null +++ b/messaging/content-templates/get-template-approval-status-from-whatsapp/output/get-template-approval-status-from-whatsapp.json @@ -0,0 +1,13 @@ +{ + "url": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ApprovalRequests", + "whatsapp": { + "category": "TRANSPORTATION_UPDATE", + "status": "pending", + "name": "flight_replies", + "type": "whatsapp", + "content_type": "twilio/quick-reply", + "rejection_reason": "" + }, + "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "sid": "HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" +} diff --git a/messaging/content-templates/submit-a-template-for-whatsapp-approval/meta.json b/messaging/content-templates/submit-a-template-for-whatsapp-approval/meta.json new file mode 100644 index 000000000..00957afb6 --- /dev/null +++ b/messaging/content-templates/submit-a-template-for-whatsapp-approval/meta.json @@ -0,0 +1,5 @@ +{ + "title": "Content API - Create WhatsApp ApprovalRequest", + "description": "Submit a Content Template for WhatsApp Approval", + "type": "server" +} \ No newline at end of file diff --git a/messaging/content-templates/submit-a-template-for-whatsapp-approval/output/submit-a-template-for-whatsapp-approval.json b/messaging/content-templates/submit-a-template-for-whatsapp-approval/output/submit-a-template-for-whatsapp-approval.json new file mode 100644 index 000000000..4cf5f3a9f --- /dev/null +++ b/messaging/content-templates/submit-a-template-for-whatsapp-approval/output/submit-a-template-for-whatsapp-approval.json @@ -0,0 +1,7 @@ +{ + "category": "TRANSPORTATION_UPDATE", + "status": "received", + "rejection_reason": "", + "name": "flight_replies", + "content_type": "twilio/quick-reply" +} \ No newline at end of file diff --git a/messaging/content-templates/submit-a-template-for-whatsapp-approval/submit-a-template-for-whatsapp-approval.curl b/messaging/content-templates/submit-a-template-for-whatsapp-approval/submit-a-template-for-whatsapp-approval.curl new file mode 100644 index 000000000..3dd66ac3c --- /dev/null +++ b/messaging/content-templates/submit-a-template-for-whatsapp-approval/submit-a-template-for-whatsapp-approval.curl @@ -0,0 +1,7 @@ +curl -X POST 'https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ApprovalRequests/whatsapp' \ +-H 'Content-Type: application/json' \ +-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN \ +-d '{ + "name": "flight_replies", + "category": "UTILITY" +}' \ No newline at end of file diff --git a/messaging/content-templates/use-content-variables/meta.json b/messaging/content-templates/use-content-variables/meta.json new file mode 100644 index 000000000..0c7aeda2a --- /dev/null +++ b/messaging/content-templates/use-content-variables/meta.json @@ -0,0 +1,4 @@ +{ + "title": "Content Templates API - Use Variables with Templates", + "type": "server" +} diff --git a/messaging/content-templates/use-content-variables/output/use-content-variables.json b/messaging/content-templates/use-content-variables/output/use-content-variables.json new file mode 100644 index 000000000..792f0b89a --- /dev/null +++ b/messaging/content-templates/use-content-variables/output/use-content-variables.json @@ -0,0 +1,38 @@ +{ + "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "date_created": "2022-11-17T08:52:12Z", + "date_updated": "2022-11-17T08:52:12Z", + "friendly_name": "Owl Air elite status card template", + "language": "en", + "links": { + "approval_create": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ApprovalRequests/whatsapp", + "approval_fetch": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ApprovalRequests" + }, + "sid": "HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "types": { + "twilio/card": { + "actions": [ + { + "title": "Order Online", + "type": "URL", + "url": "https://owlair.example.com/%7B%7B2%7D%7D" + } + ], + "body": null, + "media": [ + "https://twilio-cms-prod.s3.amazonaws.com/%7B%7B3%7D%7D" + ], + "subtitle": "To unsubscribe, reply Stop", + "title": "Congratulations, you've reached Elite status! Add code {{1}} for 10% off." + }, + "twilio/text": { + "body": "Congratulations, you've reached Elite status! Add code {{1}} for 10% off." + } + }, + "url": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "variables": { + "1": "coupon_code", + "2": "docs", + "3": "images/library-logo-resource2x.width-1000.png" + } +} diff --git a/messaging/content-templates/use-content-variables/use-content-variables.curl b/messaging/content-templates/use-content-variables/use-content-variables.curl new file mode 100644 index 000000000..82640e52e --- /dev/null +++ b/messaging/content-templates/use-content-variables/use-content-variables.curl @@ -0,0 +1,29 @@ +curl -X POST 'https://content.twilio.com/v1/Content' \ +-H 'Content-Type: application/json' \ +-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN \ +-d '{ + "friendly_name": "Owl Air elite status card template", + "language": "en", + "variables": { + "1": "coupon_code", + "2": "docs", + "3": "images/library-logo-resource2x.width-1000.png" + }, + "types": { + "twilio/card": { + "title": "Congratulations, you've reached Elite status! Add code {{1}} for 10% off.", + "subtitle": "To unsubscribe, reply Stop", + "actions": [ + { + "url": "https://twilio.com/%7B%7B2%7D%7D", + "title": "Order Online", + "type": "URL" + } + ], + "media": ["https://twilio-cms-prod.s3.amazonaws.com/%7B%7B3%7D%7D"] + }, + "twilio/text": { + "body": "Congratulations, you've reached Elite status! Add code {{1}} for 10% off." + } + } +}' diff --git a/messaging/link-shortening/link-shortening-domain-cert/link-shortening-domain-cert.10.x.java b/messaging/link-shortening/link-shortening-domain-cert/link-shortening-domain-cert.10.x.java index 5846bf9f8..3f8d8860a 100644 --- a/messaging/link-shortening/link-shortening-domain-cert/link-shortening-domain-cert.10.x.java +++ b/messaging/link-shortening/link-shortening-domain-cert/link-shortening-domain-cert.10.x.java @@ -9,7 +9,7 @@ public class Example { public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID"); public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN"); - Sring certAndPrivateKey = """-----BEGIN CERTIFICATE----- + String certAndPrivateKey = """-----BEGIN CERTIFICATE----- MIIDqDCCApACCQCBT5e22Q01fjANBgkqhkiG9w0BAQsFADCBlTELMAkGA1UEBhMC VVMxCzAJBgNVBAgMAkNBMRYwFAYDVQQHDA1TYW4gRnJhbmNpc2NvMRYwFAYDVQQK DA1FeGFtcGxlLCBJbmMuMRIwEAYDVQQLDAlUZXN0IERlcHQxFDASBgNVBAMMC2V4 diff --git a/twiml/voice/transcription/transcription-basic-usage/meta.json b/twiml/voice/transcription/transcription-basic-usage/meta.json new file mode 100644 index 000000000..4e2af60ad --- /dev/null +++ b/twiml/voice/transcription/transcription-basic-usage/meta.json @@ -0,0 +1,4 @@ +{ + "title": " - basic usage", + "type": "server" +} diff --git a/twiml/voice/transcription/transcription-basic-usage/output/transcription-basic-usage.twiml b/twiml/voice/transcription/transcription-basic-usage/output/transcription-basic-usage.twiml new file mode 100644 index 000000000..d559de1de --- /dev/null +++ b/twiml/voice/transcription/transcription-basic-usage/output/transcription-basic-usage.twiml @@ -0,0 +1,6 @@ + + + + + + diff --git a/twiml/voice/transcription/transcription-basic-usage/transcription-basic-usage.cs b/twiml/voice/transcription/transcription-basic-usage/transcription-basic-usage.cs new file mode 100644 index 000000000..5d2313f51 --- /dev/null +++ b/twiml/voice/transcription/transcription-basic-usage/transcription-basic-usage.cs @@ -0,0 +1,17 @@ +using System; +using Twilio.TwiML; +using Twilio.TwiML.Voice; + + +class Example +{ + static void Main() + { + var response = new VoiceResponse(); + var start = new Start(); + start.Transcription(statusCallbackUrl: "https://example.com/your-callback-url"); + response.Append(start); + + Console.WriteLine(response.ToString()); + } +} diff --git a/twiml/voice/transcription/transcription-basic-usage/transcription-basic-usage.java b/twiml/voice/transcription/transcription-basic-usage/transcription-basic-usage.java new file mode 100644 index 000000000..6a1bdc5e6 --- /dev/null +++ b/twiml/voice/transcription/transcription-basic-usage/transcription-basic-usage.java @@ -0,0 +1,19 @@ +import com.twilio.twiml.VoiceResponse; +import com.twilio.twiml.voice.Start; +import com.twilio.twiml.voice.Transcription; +import com.twilio.twiml.TwiMLException; + + +public class Example { + public static void main(String[] args) { + Transcription transcription = new Transcription.Builder().statusCallbackUrl("https://example.com/your-callback-url").build(); + Start start = new Start.Builder().transcription(transcription).build(); + VoiceResponse response = new VoiceResponse.Builder().start(start).build(); + + try { + System.out.println(response.toXml()); + } catch (TwiMLException e) { + e.printStackTrace(); + } + } +} diff --git a/twiml/voice/transcription/transcription-basic-usage/transcription-basic-usage.js b/twiml/voice/transcription/transcription-basic-usage/transcription-basic-usage.js new file mode 100644 index 000000000..18834b050 --- /dev/null +++ b/twiml/voice/transcription/transcription-basic-usage/transcription-basic-usage.js @@ -0,0 +1,7 @@ +const VoiceResponse = require('twilio').twiml.VoiceResponse; + +const response = new VoiceResponse(); +const start = response.start(); +start.transcription({statusCallbackUrl: 'https://example.com/your-callback-url'}); + +console.log(response.toString()); diff --git a/twiml/voice/transcription/transcription-basic-usage/transcription-basic-usage.php b/twiml/voice/transcription/transcription-basic-usage/transcription-basic-usage.php new file mode 100644 index 000000000..6775ba515 --- /dev/null +++ b/twiml/voice/transcription/transcription-basic-usage/transcription-basic-usage.php @@ -0,0 +1,9 @@ +start(); +$start->transcription(['statusCallbackUrl' => 'https://example.com/your-callback-url']); + +echo $response; diff --git a/twiml/voice/transcription/transcription-basic-usage/transcription-basic-usage.py b/twiml/voice/transcription/transcription-basic-usage/transcription-basic-usage.py new file mode 100644 index 000000000..3d138da17 --- /dev/null +++ b/twiml/voice/transcription/transcription-basic-usage/transcription-basic-usage.py @@ -0,0 +1,9 @@ +from twilio.twiml.voice_response import VoiceResponse, Start, Transcription + +response = VoiceResponse() +start = Start() +start.transcription( + status_callback_url='https://example.com/your-callback-url') +response.append(start) + +print(response) diff --git a/twiml/voice/transcription/transcription-basic-usage/transcription-basic-usage.rb b/twiml/voice/transcription/transcription-basic-usage/transcription-basic-usage.rb new file mode 100644 index 000000000..6eeda3379 --- /dev/null +++ b/twiml/voice/transcription/transcription-basic-usage/transcription-basic-usage.rb @@ -0,0 +1,8 @@ +require 'twilio-ruby' + +response = Twilio::TwiML::VoiceResponse.new +response.start do |start| + start.transcription(status_callback_url: 'https://example.com/your-callback-url') +end + +puts response diff --git a/twiml/voice/transcription/transcription-enableautomaticpunctuation/meta.json b/twiml/voice/transcription/transcription-enableautomaticpunctuation/meta.json new file mode 100644 index 000000000..403046f65 --- /dev/null +++ b/twiml/voice/transcription/transcription-enableautomaticpunctuation/meta.json @@ -0,0 +1,4 @@ +{ + "title": " with enableAutomaticPunctuation attribute", + "type": "server" +} diff --git a/twiml/voice/transcription/transcription-enableautomaticpunctuation/output/transcription-enableautomaticpunctuation.twiml b/twiml/voice/transcription/transcription-enableautomaticpunctuation/output/transcription-enableautomaticpunctuation.twiml new file mode 100644 index 000000000..874c9014d --- /dev/null +++ b/twiml/voice/transcription/transcription-enableautomaticpunctuation/output/transcription-enableautomaticpunctuation.twiml @@ -0,0 +1,6 @@ + + + + + + diff --git a/twiml/voice/transcription/transcription-enableautomaticpunctuation/transcription-enableautomaticpunctuation.cs b/twiml/voice/transcription/transcription-enableautomaticpunctuation/transcription-enableautomaticpunctuation.cs new file mode 100644 index 000000000..b2494dcac --- /dev/null +++ b/twiml/voice/transcription/transcription-enableautomaticpunctuation/transcription-enableautomaticpunctuation.cs @@ -0,0 +1,17 @@ +using System; +using Twilio.TwiML; +using Twilio.TwiML.Voice; + + +class Example +{ + static void Main() + { + var response = new VoiceResponse(); + var start = new Start(); + start.Transcription(statusCallbackUrl: "https://example.com/your-callback-url", enableAutomaticPunctuation: true, transcriptionEngine: "google"); + response.Append(start); + + Console.WriteLine(response.ToString()); + } +} diff --git a/twiml/voice/transcription/transcription-enableautomaticpunctuation/transcription-enableautomaticpunctuation.java b/twiml/voice/transcription/transcription-enableautomaticpunctuation/transcription-enableautomaticpunctuation.java new file mode 100644 index 000000000..1cd0cf3ad --- /dev/null +++ b/twiml/voice/transcription/transcription-enableautomaticpunctuation/transcription-enableautomaticpunctuation.java @@ -0,0 +1,19 @@ +import com.twilio.twiml.VoiceResponse; +import com.twilio.twiml.voice.Start; +import com.twilio.twiml.voice.Transcription; +import com.twilio.twiml.TwiMLException; + + +public class Example { + public static void main(String[] args) { + Transcription transcription = new Transcription.Builder().statusCallbackUrl("https://example.com/your-callback-url").enableAutomaticPunctuation(true).transcriptionEngine("google").build(); + Start start = new Start.Builder().transcription(transcription).build(); + VoiceResponse response = new VoiceResponse.Builder().start(start).build(); + + try { + System.out.println(response.toXml()); + } catch (TwiMLException e) { + e.printStackTrace(); + } + } +} diff --git a/twiml/voice/transcription/transcription-enableautomaticpunctuation/transcription-enableautomaticpunctuation.js b/twiml/voice/transcription/transcription-enableautomaticpunctuation/transcription-enableautomaticpunctuation.js new file mode 100644 index 000000000..f02b7d065 --- /dev/null +++ b/twiml/voice/transcription/transcription-enableautomaticpunctuation/transcription-enableautomaticpunctuation.js @@ -0,0 +1,7 @@ +const VoiceResponse = require('twilio').twiml.VoiceResponse; + +const response = new VoiceResponse(); +const start = response.start(); +start.transcription({statusCallbackUrl: 'https://example.com/your-callback-url', enableAutomaticPunctuation: true, transcriptionEngine: 'google'}); + +console.log(response.toString()); diff --git a/twiml/voice/transcription/transcription-enableautomaticpunctuation/transcription-enableautomaticpunctuation.php b/twiml/voice/transcription/transcription-enableautomaticpunctuation/transcription-enableautomaticpunctuation.php new file mode 100644 index 000000000..ebfb3ac71 --- /dev/null +++ b/twiml/voice/transcription/transcription-enableautomaticpunctuation/transcription-enableautomaticpunctuation.php @@ -0,0 +1,9 @@ +start(); +$start->transcription(['statusCallbackUrl' => 'https://example.com/your-callback-url', 'enableAutomaticPunctuation' => 'true', 'transcriptionEngine' => 'google']); + +echo $response; diff --git a/twiml/voice/transcription/transcription-enableautomaticpunctuation/transcription-enableautomaticpunctuation.py b/twiml/voice/transcription/transcription-enableautomaticpunctuation/transcription-enableautomaticpunctuation.py new file mode 100644 index 000000000..29be68bdc --- /dev/null +++ b/twiml/voice/transcription/transcription-enableautomaticpunctuation/transcription-enableautomaticpunctuation.py @@ -0,0 +1,11 @@ +from twilio.twiml.voice_response import VoiceResponse, Start, Transcription + +response = VoiceResponse() +start = Start() +start.transcription( + status_callback_url='https://example.com/your-callback-url', + enable_automatic_punctuation=True, + transcription_engine='google') +response.append(start) + +print(response) diff --git a/twiml/voice/transcription/transcription-enableautomaticpunctuation/transcription-enableautomaticpunctuation.rb b/twiml/voice/transcription/transcription-enableautomaticpunctuation/transcription-enableautomaticpunctuation.rb new file mode 100644 index 000000000..97796666f --- /dev/null +++ b/twiml/voice/transcription/transcription-enableautomaticpunctuation/transcription-enableautomaticpunctuation.rb @@ -0,0 +1,8 @@ +require 'twilio-ruby' + +response = Twilio::TwiML::VoiceResponse.new +response.start do |start| + start.transcription(status_callback_url: 'https://example.com/your-callback-url', enable_automatic_punctuation: true, transcription_engine: 'google') +end + +puts response diff --git a/twiml/voice/transcription/transcription-hints-tokens/meta.json b/twiml/voice/transcription/transcription-hints-tokens/meta.json new file mode 100644 index 000000000..6f18251c7 --- /dev/null +++ b/twiml/voice/transcription/transcription-hints-tokens/meta.json @@ -0,0 +1,4 @@ +{ + "title": "\\ with hints attribute using tokens", + "type": "server" +} diff --git a/twiml/voice/transcription/transcription-hints-tokens/output/transcription-hints-tokens.twiml b/twiml/voice/transcription/transcription-hints-tokens/output/transcription-hints-tokens.twiml new file mode 100644 index 000000000..68a175a54 --- /dev/null +++ b/twiml/voice/transcription/transcription-hints-tokens/output/transcription-hints-tokens.twiml @@ -0,0 +1,6 @@ + + + + + + diff --git a/twiml/voice/transcription/transcription-hints-tokens/transcription-hints-tokens.cs b/twiml/voice/transcription/transcription-hints-tokens/transcription-hints-tokens.cs new file mode 100644 index 000000000..9de49d05f --- /dev/null +++ b/twiml/voice/transcription/transcription-hints-tokens/transcription-hints-tokens.cs @@ -0,0 +1,17 @@ +using System; +using Twilio.TwiML; +using Twilio.TwiML.Voice; + + +class Example +{ + static void Main() + { + var response = new VoiceResponse(); + var start = new Start(); + start.Transcription(statusCallbackUrl: "https://example.com/your-callback-url", hints: "$OOV_CLASS_ALPHANUMERIC_SEQUENCE"); + response.Append(start); + + Console.WriteLine(response.ToString()); + } +} diff --git a/twiml/voice/transcription/transcription-hints-tokens/transcription-hints-tokens.java b/twiml/voice/transcription/transcription-hints-tokens/transcription-hints-tokens.java new file mode 100644 index 000000000..5e55eb563 --- /dev/null +++ b/twiml/voice/transcription/transcription-hints-tokens/transcription-hints-tokens.java @@ -0,0 +1,19 @@ +import com.twilio.twiml.VoiceResponse; +import com.twilio.twiml.voice.Start; +import com.twilio.twiml.voice.Transcription; +import com.twilio.twiml.TwiMLException; + + +public class Example { + public static void main(String[] args) { + Transcription transcription = new Transcription.Builder().statusCallbackUrl("https://example.com/your-callback-url").hints("$OOV_CLASS_ALPHANUMERIC_SEQUENCE").build(); + Start start = new Start.Builder().transcription(transcription).build(); + VoiceResponse response = new VoiceResponse.Builder().start(start).build(); + + try { + System.out.println(response.toXml()); + } catch (TwiMLException e) { + e.printStackTrace(); + } + } +} diff --git a/twiml/voice/transcription/transcription-hints-tokens/transcription-hints-tokens.js b/twiml/voice/transcription/transcription-hints-tokens/transcription-hints-tokens.js new file mode 100644 index 000000000..41db64eba --- /dev/null +++ b/twiml/voice/transcription/transcription-hints-tokens/transcription-hints-tokens.js @@ -0,0 +1,7 @@ +const VoiceResponse = require('twilio').twiml.VoiceResponse; + +const response = new VoiceResponse(); +const start = response.start(); +start.transcription({statusCallbackUrl: 'https://example.com/your-callback-url', hints: '$OOV_CLASS_ALPHANUMERIC_SEQUENCE'}); + +console.log(response.toString()); diff --git a/twiml/voice/transcription/transcription-hints-tokens/transcription-hints-tokens.php b/twiml/voice/transcription/transcription-hints-tokens/transcription-hints-tokens.php new file mode 100644 index 000000000..6c0b22911 --- /dev/null +++ b/twiml/voice/transcription/transcription-hints-tokens/transcription-hints-tokens.php @@ -0,0 +1,9 @@ +start(); +$start->transcription(['statusCallbackUrl' => 'https://example.com/your-callback-url', 'hints' => '$OOV_CLASS_ALPHANUMERIC_SEQUENCE']); + +echo $response; diff --git a/twiml/voice/transcription/transcription-hints-tokens/transcription-hints-tokens.py b/twiml/voice/transcription/transcription-hints-tokens/transcription-hints-tokens.py new file mode 100644 index 000000000..8e0813e31 --- /dev/null +++ b/twiml/voice/transcription/transcription-hints-tokens/transcription-hints-tokens.py @@ -0,0 +1,10 @@ +from twilio.twiml.voice_response import VoiceResponse, Start, Transcription + +response = VoiceResponse() +start = Start() +start.transcription( + status_callback_url='https://example.com/your-callback-url', + hints='$OOV_CLASS_ALPHANUMERIC_SEQUENCE') +response.append(start) + +print(response) diff --git a/twiml/voice/transcription/transcription-hints-tokens/transcription-hints-tokens.rb b/twiml/voice/transcription/transcription-hints-tokens/transcription-hints-tokens.rb new file mode 100644 index 000000000..260625991 --- /dev/null +++ b/twiml/voice/transcription/transcription-hints-tokens/transcription-hints-tokens.rb @@ -0,0 +1,8 @@ +require 'twilio-ruby' + +response = Twilio::TwiML::VoiceResponse.new +response.start do |start| + start.transcription(status_callback_url: 'https://example.com/your-callback-url', hints: '$OOV_CLASS_ALPHANUMERIC_SEQUENCE') +end + +puts response diff --git a/twiml/voice/transcription/transcription-hints/meta.json b/twiml/voice/transcription/transcription-hints/meta.json new file mode 100644 index 000000000..11ecbb4c4 --- /dev/null +++ b/twiml/voice/transcription/transcription-hints/meta.json @@ -0,0 +1,4 @@ +{ + "title": "\\ with hints attribute", + "type": "server" +} diff --git a/twiml/voice/transcription/transcription-hints/output/transcription-hints.twiml b/twiml/voice/transcription/transcription-hints/output/transcription-hints.twiml new file mode 100644 index 000000000..9f1273a7a --- /dev/null +++ b/twiml/voice/transcription/transcription-hints/output/transcription-hints.twiml @@ -0,0 +1,6 @@ + + + + + + diff --git a/twiml/voice/transcription/transcription-hints/transcription-hints.cs b/twiml/voice/transcription/transcription-hints/transcription-hints.cs new file mode 100644 index 000000000..22d8b957b --- /dev/null +++ b/twiml/voice/transcription/transcription-hints/transcription-hints.cs @@ -0,0 +1,17 @@ +using System; +using Twilio.TwiML; +using Twilio.TwiML.Voice; + + +class Example +{ + static void Main() + { + var response = new VoiceResponse(); + var start = new Start(); + start.Transcription(statusCallbackUrl: "https://example.com/your-callback-url", hints: "Alice Johnson, Bob Martin, ACME Corp, XYZ Enterprises, product demo, sales inquiry, customer feedback"); + response.Append(start); + + Console.WriteLine(response.ToString()); + } +} diff --git a/twiml/voice/transcription/transcription-hints/transcription-hints.java b/twiml/voice/transcription/transcription-hints/transcription-hints.java new file mode 100644 index 000000000..c938659ce --- /dev/null +++ b/twiml/voice/transcription/transcription-hints/transcription-hints.java @@ -0,0 +1,19 @@ +import com.twilio.twiml.VoiceResponse; +import com.twilio.twiml.voice.Start; +import com.twilio.twiml.voice.Transcription; +import com.twilio.twiml.TwiMLException; + + +public class Example { + public static void main(String[] args) { + Transcription transcription = new Transcription.Builder().statusCallbackUrl("https://example.com/your-callback-url").hints("Alice Johnson, Bob Martin, ACME Corp, XYZ Enterprises, product demo, sales inquiry, customer feedback").build(); + Start start = new Start.Builder().transcription(transcription).build(); + VoiceResponse response = new VoiceResponse.Builder().start(start).build(); + + try { + System.out.println(response.toXml()); + } catch (TwiMLException e) { + e.printStackTrace(); + } + } +} diff --git a/twiml/voice/transcription/transcription-hints/transcription-hints.js b/twiml/voice/transcription/transcription-hints/transcription-hints.js new file mode 100644 index 000000000..2a7a238a9 --- /dev/null +++ b/twiml/voice/transcription/transcription-hints/transcription-hints.js @@ -0,0 +1,7 @@ +const VoiceResponse = require('twilio').twiml.VoiceResponse; + +const response = new VoiceResponse(); +const start = response.start(); +start.transcription({statusCallbackUrl: 'https://example.com/your-callback-url', hints: 'Alice Johnson, Bob Martin, ACME Corp, XYZ Enterprises, product demo, sales inquiry, customer feedback'}); + +console.log(response.toString()); diff --git a/twiml/voice/transcription/transcription-hints/transcription-hints.php b/twiml/voice/transcription/transcription-hints/transcription-hints.php new file mode 100644 index 000000000..b29be1276 --- /dev/null +++ b/twiml/voice/transcription/transcription-hints/transcription-hints.php @@ -0,0 +1,9 @@ +start(); +$start->transcription(['statusCallbackUrl' => 'https://example.com/your-callback-url', 'hints' => 'Alice Johnson, Bob Martin, ACME Corp, XYZ Enterprises, product demo, sales inquiry, customer feedback']); + +echo $response; diff --git a/twiml/voice/transcription/transcription-hints/transcription-hints.py b/twiml/voice/transcription/transcription-hints/transcription-hints.py new file mode 100644 index 000000000..639b7c82b --- /dev/null +++ b/twiml/voice/transcription/transcription-hints/transcription-hints.py @@ -0,0 +1,12 @@ +from twilio.twiml.voice_response import VoiceResponse, Start, Transcription + +response = VoiceResponse() +start = Start() +start.transcription( + status_callback_url='https://example.com/your-callback-url', + hints= + 'Alice Johnson, Bob Martin, ACME Corp, XYZ Enterprises, product demo, sales inquiry, customer feedback' +) +response.append(start) + +print(response) diff --git a/twiml/voice/transcription/transcription-hints/transcription-hints.rb b/twiml/voice/transcription/transcription-hints/transcription-hints.rb new file mode 100644 index 000000000..d879d1438 --- /dev/null +++ b/twiml/voice/transcription/transcription-hints/transcription-hints.rb @@ -0,0 +1,8 @@ +require 'twilio-ruby' + +response = Twilio::TwiML::VoiceResponse.new +response.start do |start| + start.transcription(status_callback_url: 'https://example.com/your-callback-url', hints: 'Alice Johnson, Bob Martin, ACME Corp, XYZ Enterprises, product demo, sales inquiry, customer feedback') +end + +puts response diff --git a/twiml/voice/transcription/transcription-inboundtracklabel-outboundtracklabel/meta.json b/twiml/voice/transcription/transcription-inboundtracklabel-outboundtracklabel/meta.json new file mode 100644 index 000000000..3a303b523 --- /dev/null +++ b/twiml/voice/transcription/transcription-inboundtracklabel-outboundtracklabel/meta.json @@ -0,0 +1,4 @@ +{ + "title": "\\ with inboundTrackLabel and outboundTrackLabel attributes", + "type": "server" +} diff --git a/twiml/voice/transcription/transcription-inboundtracklabel-outboundtracklabel/output/transcription-inboundtracklabel-outboundtracklabel.twiml b/twiml/voice/transcription/transcription-inboundtracklabel-outboundtracklabel/output/transcription-inboundtracklabel-outboundtracklabel.twiml new file mode 100644 index 000000000..d153c67ea --- /dev/null +++ b/twiml/voice/transcription/transcription-inboundtracklabel-outboundtracklabel/output/transcription-inboundtracklabel-outboundtracklabel.twiml @@ -0,0 +1,6 @@ + + + + + + diff --git a/twiml/voice/transcription/transcription-inboundtracklabel-outboundtracklabel/transcription-inboundtracklabel-outboundtracklabel.cs b/twiml/voice/transcription/transcription-inboundtracklabel-outboundtracklabel/transcription-inboundtracklabel-outboundtracklabel.cs new file mode 100644 index 000000000..729019a3c --- /dev/null +++ b/twiml/voice/transcription/transcription-inboundtracklabel-outboundtracklabel/transcription-inboundtracklabel-outboundtracklabel.cs @@ -0,0 +1,17 @@ +using System; +using Twilio.TwiML; +using Twilio.TwiML.Voice; + + +class Example +{ + static void Main() + { + var response = new VoiceResponse(); + var start = new Start(); + start.Transcription(statusCallbackUrl: "https://example.com/your-callback-url", inboundTrackLabel: "agent", outboundTrackLabel: "customer"); + response.Append(start); + + Console.WriteLine(response.ToString()); + } +} diff --git a/twiml/voice/transcription/transcription-inboundtracklabel-outboundtracklabel/transcription-inboundtracklabel-outboundtracklabel.java b/twiml/voice/transcription/transcription-inboundtracklabel-outboundtracklabel/transcription-inboundtracklabel-outboundtracklabel.java new file mode 100644 index 000000000..2f2a3eaea --- /dev/null +++ b/twiml/voice/transcription/transcription-inboundtracklabel-outboundtracklabel/transcription-inboundtracklabel-outboundtracklabel.java @@ -0,0 +1,19 @@ +import com.twilio.twiml.VoiceResponse; +import com.twilio.twiml.voice.Start; +import com.twilio.twiml.voice.Transcription; +import com.twilio.twiml.TwiMLException; + + +public class Example { + public static void main(String[] args) { + Transcription transcription = new Transcription.Builder().statusCallbackUrl("https://example.com/your-callback-url").inboundTrackLabel("agent").outboundTrackLabel("customer").build(); + Start start = new Start.Builder().transcription(transcription).build(); + VoiceResponse response = new VoiceResponse.Builder().start(start).build(); + + try { + System.out.println(response.toXml()); + } catch (TwiMLException e) { + e.printStackTrace(); + } + } +} diff --git a/twiml/voice/transcription/transcription-inboundtracklabel-outboundtracklabel/transcription-inboundtracklabel-outboundtracklabel.js b/twiml/voice/transcription/transcription-inboundtracklabel-outboundtracklabel/transcription-inboundtracklabel-outboundtracklabel.js new file mode 100644 index 000000000..1b3c91207 --- /dev/null +++ b/twiml/voice/transcription/transcription-inboundtracklabel-outboundtracklabel/transcription-inboundtracklabel-outboundtracklabel.js @@ -0,0 +1,7 @@ +const VoiceResponse = require('twilio').twiml.VoiceResponse; + +const response = new VoiceResponse(); +const start = response.start(); +start.transcription({statusCallbackUrl: 'https://example.com/your-callback-url', inboundTrackLabel: 'agent', outboundTrackLabel: 'customer'}); + +console.log(response.toString()); diff --git a/twiml/voice/transcription/transcription-inboundtracklabel-outboundtracklabel/transcription-inboundtracklabel-outboundtracklabel.php b/twiml/voice/transcription/transcription-inboundtracklabel-outboundtracklabel/transcription-inboundtracklabel-outboundtracklabel.php new file mode 100644 index 000000000..50098443c --- /dev/null +++ b/twiml/voice/transcription/transcription-inboundtracklabel-outboundtracklabel/transcription-inboundtracklabel-outboundtracklabel.php @@ -0,0 +1,9 @@ +start(); +$start->transcription(['statusCallbackUrl' => 'https://example.com/your-callback-url', 'inboundTrackLabel' => 'agent', 'outboundTrackLabel' => 'customer']); + +echo $response; diff --git a/twiml/voice/transcription/transcription-inboundtracklabel-outboundtracklabel/transcription-inboundtracklabel-outboundtracklabel.py b/twiml/voice/transcription/transcription-inboundtracklabel-outboundtracklabel/transcription-inboundtracklabel-outboundtracklabel.py new file mode 100644 index 000000000..f8776c12f --- /dev/null +++ b/twiml/voice/transcription/transcription-inboundtracklabel-outboundtracklabel/transcription-inboundtracklabel-outboundtracklabel.py @@ -0,0 +1,11 @@ +from twilio.twiml.voice_response import VoiceResponse, Start, Transcription + +response = VoiceResponse() +start = Start() +start.transcription( + status_callback_url='https://example.com/your-callback-url', + inbound_track_label='agent', + outbound_track_label='customer') +response.append(start) + +print(response) diff --git a/twiml/voice/transcription/transcription-inboundtracklabel-outboundtracklabel/transcription-inboundtracklabel-outboundtracklabel.rb b/twiml/voice/transcription/transcription-inboundtracklabel-outboundtracklabel/transcription-inboundtracklabel-outboundtracklabel.rb new file mode 100644 index 000000000..b50d165a7 --- /dev/null +++ b/twiml/voice/transcription/transcription-inboundtracklabel-outboundtracklabel/transcription-inboundtracklabel-outboundtracklabel.rb @@ -0,0 +1,8 @@ +require 'twilio-ruby' + +response = Twilio::TwiML::VoiceResponse.new +response.start do |start| + start.transcription(status_callback_url: 'https://example.com/your-callback-url', inbound_track_label: 'agent', outbound_track_label: 'customer') +end + +puts response diff --git a/twiml/voice/transcription/transcription-languagecode/meta.json b/twiml/voice/transcription/transcription-languagecode/meta.json new file mode 100644 index 000000000..fa0130eb1 --- /dev/null +++ b/twiml/voice/transcription/transcription-languagecode/meta.json @@ -0,0 +1,4 @@ +{ + "title": "\\ with languageCode attribute", + "type": "server" +} diff --git a/twiml/voice/transcription/transcription-languagecode/output/transcription-languagecode.twiml b/twiml/voice/transcription/transcription-languagecode/output/transcription-languagecode.twiml new file mode 100644 index 000000000..315b1f400 --- /dev/null +++ b/twiml/voice/transcription/transcription-languagecode/output/transcription-languagecode.twiml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/twiml/voice/transcription/transcription-languagecode/transcription-languagecode.cs b/twiml/voice/transcription/transcription-languagecode/transcription-languagecode.cs new file mode 100644 index 000000000..dcbfdf06c --- /dev/null +++ b/twiml/voice/transcription/transcription-languagecode/transcription-languagecode.cs @@ -0,0 +1,17 @@ +using System; +using Twilio.TwiML; +using Twilio.TwiML.Voice; + + +class Example +{ + static void Main() + { + var response = new VoiceResponse(); + var start = new Start(); + start.Transcription(statusCallbackUrl: "https://example.com/your-callback-url", languageCode: "es-MX"); + response.Append(start); + + Console.WriteLine(response.ToString()); + } +} diff --git a/twiml/voice/transcription/transcription-languagecode/transcription-languagecode.java b/twiml/voice/transcription/transcription-languagecode/transcription-languagecode.java new file mode 100644 index 000000000..9a4868a95 --- /dev/null +++ b/twiml/voice/transcription/transcription-languagecode/transcription-languagecode.java @@ -0,0 +1,19 @@ +import com.twilio.twiml.VoiceResponse; +import com.twilio.twiml.voice.Start; +import com.twilio.twiml.voice.Transcription; +import com.twilio.twiml.TwiMLException; + + +public class Example { + public static void main(String[] args) { + Transcription transcription = new Transcription.Builder().statusCallbackUrl("https://example.com/your-callback-url").languageCode("es-MX").build(); + Start start = new Start.Builder().transcription(transcription).build(); + VoiceResponse response = new VoiceResponse.Builder().start(start).build(); + + try { + System.out.println(response.toXml()); + } catch (TwiMLException e) { + e.printStackTrace(); + } + } +} diff --git a/twiml/voice/transcription/transcription-languagecode/transcription-languagecode.js b/twiml/voice/transcription/transcription-languagecode/transcription-languagecode.js new file mode 100644 index 000000000..e559941ce --- /dev/null +++ b/twiml/voice/transcription/transcription-languagecode/transcription-languagecode.js @@ -0,0 +1,7 @@ +const VoiceResponse = require('twilio').twiml.VoiceResponse; + +const response = new VoiceResponse(); +const start = response.start(); +start.transcription({statusCallbackUrl: 'https://example.com/your-callback-url', languageCode: 'es-MX'}); + +console.log(response.toString()); diff --git a/twiml/voice/transcription/transcription-languagecode/transcription-languagecode.php b/twiml/voice/transcription/transcription-languagecode/transcription-languagecode.php new file mode 100644 index 000000000..c42f527c3 --- /dev/null +++ b/twiml/voice/transcription/transcription-languagecode/transcription-languagecode.php @@ -0,0 +1,9 @@ +start(); +$start->transcription(['statusCallbackUrl' => 'https://example.com/your-callback-url', 'languageCode' => 'es-MX']); + +echo $response; diff --git a/twiml/voice/transcription/transcription-languagecode/transcription-languagecode.py b/twiml/voice/transcription/transcription-languagecode/transcription-languagecode.py new file mode 100644 index 000000000..e4e70f6dd --- /dev/null +++ b/twiml/voice/transcription/transcription-languagecode/transcription-languagecode.py @@ -0,0 +1,10 @@ +from twilio.twiml.voice_response import VoiceResponse, Start, Transcription + +response = VoiceResponse() +start = Start() +start.transcription( + status_callback_url='https://example.com/your-callback-url', + language_code='es-MX') +response.append(start) + +print(response) diff --git a/twiml/voice/transcription/transcription-languagecode/transcription-languagecode.rb b/twiml/voice/transcription/transcription-languagecode/transcription-languagecode.rb new file mode 100644 index 000000000..614c24fc6 --- /dev/null +++ b/twiml/voice/transcription/transcription-languagecode/transcription-languagecode.rb @@ -0,0 +1,8 @@ +require 'twilio-ruby' + +response = Twilio::TwiML::VoiceResponse.new +response.start do |start| + start.transcription(status_callback_url: 'https://example.com/your-callback-url', language_code: 'es-MX') +end + +puts response diff --git a/twiml/voice/transcription/transcription-name/meta.json b/twiml/voice/transcription/transcription-name/meta.json new file mode 100644 index 000000000..1ce6be220 --- /dev/null +++ b/twiml/voice/transcription/transcription-name/meta.json @@ -0,0 +1,4 @@ +{ + "title": "\\ with name attribute", + "type": "server" +} diff --git a/twiml/voice/transcription/transcription-name/output/transcription-name.twiml b/twiml/voice/transcription/transcription-name/output/transcription-name.twiml new file mode 100644 index 000000000..4fa2aa746 --- /dev/null +++ b/twiml/voice/transcription/transcription-name/output/transcription-name.twiml @@ -0,0 +1,6 @@ + + + + + + diff --git a/twiml/voice/transcription/transcription-name/transcription-name.cs b/twiml/voice/transcription/transcription-name/transcription-name.cs new file mode 100644 index 000000000..819ba925b --- /dev/null +++ b/twiml/voice/transcription/transcription-name/transcription-name.cs @@ -0,0 +1,17 @@ +using System; +using Twilio.TwiML; +using Twilio.TwiML.Voice; + + +class Example +{ + static void Main() + { + var response = new VoiceResponse(); + var start = new Start(); + start.Transcription(statusCallbackUrl: "https://example.com/your-callback-url", name: "Contact center transcription"); + response.Append(start); + + Console.WriteLine(response.ToString()); + } +} diff --git a/twiml/voice/transcription/transcription-name/transcription-name.java b/twiml/voice/transcription/transcription-name/transcription-name.java new file mode 100644 index 000000000..1566bfdb2 --- /dev/null +++ b/twiml/voice/transcription/transcription-name/transcription-name.java @@ -0,0 +1,19 @@ +import com.twilio.twiml.VoiceResponse; +import com.twilio.twiml.voice.Start; +import com.twilio.twiml.voice.Transcription; +import com.twilio.twiml.TwiMLException; + + +public class Example { + public static void main(String[] args) { + Transcription transcription = new Transcription.Builder().statusCallbackUrl("https://example.com/your-callback-url").name("Contact center transcription").build(); + Start start = new Start.Builder().transcription(transcription).build(); + VoiceResponse response = new VoiceResponse.Builder().start(start).build(); + + try { + System.out.println(response.toXml()); + } catch (TwiMLException e) { + e.printStackTrace(); + } + } +} diff --git a/twiml/voice/transcription/transcription-name/transcription-name.js b/twiml/voice/transcription/transcription-name/transcription-name.js new file mode 100644 index 000000000..e6f960718 --- /dev/null +++ b/twiml/voice/transcription/transcription-name/transcription-name.js @@ -0,0 +1,7 @@ +const VoiceResponse = require('twilio').twiml.VoiceResponse; + +const response = new VoiceResponse(); +const start = response.start(); +start.transcription({statusCallbackUrl: 'https://example.com/your-callback-url', name: 'Contact center transcription'}); + +console.log(response.toString()); diff --git a/twiml/voice/transcription/transcription-name/transcription-name.php b/twiml/voice/transcription/transcription-name/transcription-name.php new file mode 100644 index 000000000..13ec51de3 --- /dev/null +++ b/twiml/voice/transcription/transcription-name/transcription-name.php @@ -0,0 +1,9 @@ +start(); +$start->transcription(['statusCallbackUrl' => 'https://example.com/your-callback-url', 'name' => 'Contact center transcription']); + +echo $response; diff --git a/twiml/voice/transcription/transcription-name/transcription-name.py b/twiml/voice/transcription/transcription-name/transcription-name.py new file mode 100644 index 000000000..fece2d43f --- /dev/null +++ b/twiml/voice/transcription/transcription-name/transcription-name.py @@ -0,0 +1,10 @@ +from twilio.twiml.voice_response import VoiceResponse, Start, Transcription + +response = VoiceResponse() +start = Start() +start.transcription( + status_callback_url='https://example.com/your-callback-url', + name='Contact center transcription') +response.append(start) + +print(response) diff --git a/twiml/voice/transcription/transcription-name/transcription-name.rb b/twiml/voice/transcription/transcription-name/transcription-name.rb new file mode 100644 index 000000000..916da65df --- /dev/null +++ b/twiml/voice/transcription/transcription-name/transcription-name.rb @@ -0,0 +1,8 @@ +require 'twilio-ruby' + +response = Twilio::TwiML::VoiceResponse.new +response.start do |start| + start.transcription(status_callback_url: 'https://example.com/your-callback-url', name: 'Contact center transcription') +end + +puts response diff --git a/twiml/voice/transcription/transcription-partialresults/meta.json b/twiml/voice/transcription/transcription-partialresults/meta.json new file mode 100644 index 000000000..b146f4f6d --- /dev/null +++ b/twiml/voice/transcription/transcription-partialresults/meta.json @@ -0,0 +1,4 @@ +{ + "title": "\\ with partialResults attribute", + "type": "server" +} diff --git a/twiml/voice/transcription/transcription-partialresults/output/transcription-partialresults.twiml b/twiml/voice/transcription/transcription-partialresults/output/transcription-partialresults.twiml new file mode 100644 index 000000000..e1ef209b0 --- /dev/null +++ b/twiml/voice/transcription/transcription-partialresults/output/transcription-partialresults.twiml @@ -0,0 +1,6 @@ + + + + + + diff --git a/twiml/voice/transcription/transcription-partialresults/transcription-partialresults.cs b/twiml/voice/transcription/transcription-partialresults/transcription-partialresults.cs new file mode 100644 index 000000000..59aa0bfe1 --- /dev/null +++ b/twiml/voice/transcription/transcription-partialresults/transcription-partialresults.cs @@ -0,0 +1,17 @@ +using System; +using Twilio.TwiML; +using Twilio.TwiML.Voice; + + +class Example +{ + static void Main() + { + var response = new VoiceResponse(); + var start = new Start(); + start.Transcription(statusCallbackUrl: "https://example.com/your-callback-url", partialResults: true, transcriptionEngine: "google"); + response.Append(start); + + Console.WriteLine(response.ToString()); + } +} diff --git a/twiml/voice/transcription/transcription-partialresults/transcription-partialresults.java b/twiml/voice/transcription/transcription-partialresults/transcription-partialresults.java new file mode 100644 index 000000000..385eef31f --- /dev/null +++ b/twiml/voice/transcription/transcription-partialresults/transcription-partialresults.java @@ -0,0 +1,19 @@ +import com.twilio.twiml.VoiceResponse; +import com.twilio.twiml.voice.Start; +import com.twilio.twiml.voice.Transcription; +import com.twilio.twiml.TwiMLException; + + +public class Example { + public static void main(String[] args) { + Transcription transcription = new Transcription.Builder().statusCallbackUrl("https://example.com/your-callback-url").partialResults(true).transcriptionEngine("google").build(); + Start start = new Start.Builder().transcription(transcription).build(); + VoiceResponse response = new VoiceResponse.Builder().start(start).build(); + + try { + System.out.println(response.toXml()); + } catch (TwiMLException e) { + e.printStackTrace(); + } + } +} diff --git a/twiml/voice/transcription/transcription-partialresults/transcription-partialresults.js b/twiml/voice/transcription/transcription-partialresults/transcription-partialresults.js new file mode 100644 index 000000000..dded38d40 --- /dev/null +++ b/twiml/voice/transcription/transcription-partialresults/transcription-partialresults.js @@ -0,0 +1,7 @@ +const VoiceResponse = require('twilio').twiml.VoiceResponse; + +const response = new VoiceResponse(); +const start = response.start(); +start.transcription({statusCallbackUrl: 'https://example.com/your-callback-url', partialResults: true, transcriptionEngine: 'google'}); + +console.log(response.toString()); diff --git a/twiml/voice/transcription/transcription-partialresults/transcription-partialresults.php b/twiml/voice/transcription/transcription-partialresults/transcription-partialresults.php new file mode 100644 index 000000000..f203f2a94 --- /dev/null +++ b/twiml/voice/transcription/transcription-partialresults/transcription-partialresults.php @@ -0,0 +1,9 @@ +start(); +$start->transcription(['statusCallbackUrl' => 'https://example.com/your-callback-url', 'partialResults' => 'true', 'transcriptionEngine' => 'google']); + +echo $response; diff --git a/twiml/voice/transcription/transcription-partialresults/transcription-partialresults.py b/twiml/voice/transcription/transcription-partialresults/transcription-partialresults.py new file mode 100644 index 000000000..4c6c0e252 --- /dev/null +++ b/twiml/voice/transcription/transcription-partialresults/transcription-partialresults.py @@ -0,0 +1,11 @@ +from twilio.twiml.voice_response import VoiceResponse, Start, Transcription + +response = VoiceResponse() +start = Start() +start.transcription( + status_callback_url='https://example.com/your-callback-url', + partial_results=True, + transcription_engine='google') +response.append(start) + +print(response) diff --git a/twiml/voice/transcription/transcription-partialresults/transcription-partialresults.rb b/twiml/voice/transcription/transcription-partialresults/transcription-partialresults.rb new file mode 100644 index 000000000..69e4a7cc3 --- /dev/null +++ b/twiml/voice/transcription/transcription-partialresults/transcription-partialresults.rb @@ -0,0 +1,8 @@ +require 'twilio-ruby' + +response = Twilio::TwiML::VoiceResponse.new +response.start do |start| + start.transcription(status_callback_url: 'https://example.com/your-callback-url', partial_results: true, transcription_engine: 'google') +end + +puts response diff --git a/twiml/voice/transcription/transcription-profanityfilter/meta.json b/twiml/voice/transcription/transcription-profanityfilter/meta.json new file mode 100644 index 000000000..78d650f0b --- /dev/null +++ b/twiml/voice/transcription/transcription-profanityfilter/meta.json @@ -0,0 +1,4 @@ +{ + "title": "\\ with profanityFilter attribute", + "type": "server" +} diff --git a/twiml/voice/transcription/transcription-profanityfilter/output/transcription-profanityfilter.twiml b/twiml/voice/transcription/transcription-profanityfilter/output/transcription-profanityfilter.twiml new file mode 100644 index 000000000..0f834fb3d --- /dev/null +++ b/twiml/voice/transcription/transcription-profanityfilter/output/transcription-profanityfilter.twiml @@ -0,0 +1,6 @@ + + + + + + diff --git a/twiml/voice/transcription/transcription-profanityfilter/transcription-profanityfilter.cs b/twiml/voice/transcription/transcription-profanityfilter/transcription-profanityfilter.cs new file mode 100644 index 000000000..dbaba7206 --- /dev/null +++ b/twiml/voice/transcription/transcription-profanityfilter/transcription-profanityfilter.cs @@ -0,0 +1,17 @@ +using System; +using Twilio.TwiML; +using Twilio.TwiML.Voice; + + +class Example +{ + static void Main() + { + var response = new VoiceResponse(); + var start = new Start(); + start.Transcription(statusCallbackUrl: "https://example.com/your-callback-url", profanityFilter: false, transcriptionEngine: "google"); + response.Append(start); + + Console.WriteLine(response.ToString()); + } +} diff --git a/twiml/voice/transcription/transcription-profanityfilter/transcription-profanityfilter.java b/twiml/voice/transcription/transcription-profanityfilter/transcription-profanityfilter.java new file mode 100644 index 000000000..08af0f357 --- /dev/null +++ b/twiml/voice/transcription/transcription-profanityfilter/transcription-profanityfilter.java @@ -0,0 +1,19 @@ +import com.twilio.twiml.VoiceResponse; +import com.twilio.twiml.voice.Start; +import com.twilio.twiml.voice.Transcription; +import com.twilio.twiml.TwiMLException; + + +public class Example { + public static void main(String[] args) { + Transcription transcription = new Transcription.Builder().statusCallbackUrl("https://example.com/your-callback-url").profanityFilter(false).transcriptionEngine("google").build(); + Start start = new Start.Builder().transcription(transcription).build(); + VoiceResponse response = new VoiceResponse.Builder().start(start).build(); + + try { + System.out.println(response.toXml()); + } catch (TwiMLException e) { + e.printStackTrace(); + } + } +} diff --git a/twiml/voice/transcription/transcription-profanityfilter/transcription-profanityfilter.js b/twiml/voice/transcription/transcription-profanityfilter/transcription-profanityfilter.js new file mode 100644 index 000000000..4ceb62dbd --- /dev/null +++ b/twiml/voice/transcription/transcription-profanityfilter/transcription-profanityfilter.js @@ -0,0 +1,7 @@ +const VoiceResponse = require('twilio').twiml.VoiceResponse; + +const response = new VoiceResponse(); +const start = response.start(); +start.transcription({statusCallbackUrl: 'https://example.com/your-callback-url', profanityFilter: false, transcriptionEngine: 'google'}); + +console.log(response.toString()); diff --git a/twiml/voice/transcription/transcription-profanityfilter/transcription-profanityfilter.php b/twiml/voice/transcription/transcription-profanityfilter/transcription-profanityfilter.php new file mode 100644 index 000000000..9c561eba1 --- /dev/null +++ b/twiml/voice/transcription/transcription-profanityfilter/transcription-profanityfilter.php @@ -0,0 +1,9 @@ +start(); +$start->transcription(['statusCallbackUrl' => 'https://example.com/your-callback-url', 'profanityFilter' => 'false', 'transcriptionEngine' => 'google']); + +echo $response; diff --git a/twiml/voice/transcription/transcription-profanityfilter/transcription-profanityfilter.py b/twiml/voice/transcription/transcription-profanityfilter/transcription-profanityfilter.py new file mode 100644 index 000000000..5503fe96c --- /dev/null +++ b/twiml/voice/transcription/transcription-profanityfilter/transcription-profanityfilter.py @@ -0,0 +1,11 @@ +from twilio.twiml.voice_response import VoiceResponse, Start, Transcription + +response = VoiceResponse() +start = Start() +start.transcription( + status_callback_url='https://example.com/your-callback-url', + profanity_filter=False, + transcription_engine='google') +response.append(start) + +print(response) diff --git a/twiml/voice/transcription/transcription-profanityfilter/transcription-profanityfilter.rb b/twiml/voice/transcription/transcription-profanityfilter/transcription-profanityfilter.rb new file mode 100644 index 000000000..2f84ba6bb --- /dev/null +++ b/twiml/voice/transcription/transcription-profanityfilter/transcription-profanityfilter.rb @@ -0,0 +1,8 @@ +require 'twilio-ruby' + +response = Twilio::TwiML::VoiceResponse.new +response.start do |start| + start.transcription(status_callback_url: 'https://example.com/your-callback-url', profanity_filter: false, transcription_engine: 'google') +end + +puts response diff --git a/twiml/voice/transcription/transcription-speechmodel/meta.json b/twiml/voice/transcription/transcription-speechmodel/meta.json new file mode 100644 index 000000000..9040c48a0 --- /dev/null +++ b/twiml/voice/transcription/transcription-speechmodel/meta.json @@ -0,0 +1,4 @@ +{ + "title": "\\ with speechModel attribute", + "type": "server" +} diff --git a/twiml/voice/transcription/transcription-speechmodel/output/transcription-speechmodel.twiml b/twiml/voice/transcription/transcription-speechmodel/output/transcription-speechmodel.twiml new file mode 100644 index 000000000..b83f9828f --- /dev/null +++ b/twiml/voice/transcription/transcription-speechmodel/output/transcription-speechmodel.twiml @@ -0,0 +1,6 @@ + + + + + + diff --git a/twiml/voice/transcription/transcription-speechmodel/transcription-speechmodel.cs b/twiml/voice/transcription/transcription-speechmodel/transcription-speechmodel.cs new file mode 100644 index 000000000..d671251fa --- /dev/null +++ b/twiml/voice/transcription/transcription-speechmodel/transcription-speechmodel.cs @@ -0,0 +1,17 @@ +using System; +using Twilio.TwiML; +using Twilio.TwiML.Voice; + + +class Example +{ + static void Main() + { + var response = new VoiceResponse(); + var start = new Start(); + start.Transcription(statusCallbackUrl: "https://example.com/your-callback-url", speechModel: "telephony", transcriptionEngine: "google"); + response.Append(start); + + Console.WriteLine(response.ToString()); + } +} diff --git a/twiml/voice/transcription/transcription-speechmodel/transcription-speechmodel.java b/twiml/voice/transcription/transcription-speechmodel/transcription-speechmodel.java new file mode 100644 index 000000000..5f4dd5e9a --- /dev/null +++ b/twiml/voice/transcription/transcription-speechmodel/transcription-speechmodel.java @@ -0,0 +1,19 @@ +import com.twilio.twiml.VoiceResponse; +import com.twilio.twiml.voice.Start; +import com.twilio.twiml.voice.Transcription; +import com.twilio.twiml.TwiMLException; + + +public class Example { + public static void main(String[] args) { + Transcription transcription = new Transcription.Builder().statusCallbackUrl("https://example.com/your-callback-url").speechModel("telephony").transcriptionEngine("google").build(); + Start start = new Start.Builder().transcription(transcription).build(); + VoiceResponse response = new VoiceResponse.Builder().start(start).build(); + + try { + System.out.println(response.toXml()); + } catch (TwiMLException e) { + e.printStackTrace(); + } + } +} diff --git a/twiml/voice/transcription/transcription-speechmodel/transcription-speechmodel.js b/twiml/voice/transcription/transcription-speechmodel/transcription-speechmodel.js new file mode 100644 index 000000000..a88e80f55 --- /dev/null +++ b/twiml/voice/transcription/transcription-speechmodel/transcription-speechmodel.js @@ -0,0 +1,7 @@ +const VoiceResponse = require('twilio').twiml.VoiceResponse; + +const response = new VoiceResponse(); +const start = response.start(); +start.transcription({statusCallbackUrl: 'https://example.com/your-callback-url', speechModel: 'telephony', transcriptionEngine: 'google'}); + +console.log(response.toString()); diff --git a/twiml/voice/transcription/transcription-speechmodel/transcription-speechmodel.php b/twiml/voice/transcription/transcription-speechmodel/transcription-speechmodel.php new file mode 100644 index 000000000..56c546d81 --- /dev/null +++ b/twiml/voice/transcription/transcription-speechmodel/transcription-speechmodel.php @@ -0,0 +1,9 @@ +start(); +$start->transcription(['statusCallbackUrl' => 'https://example.com/your-callback-url', 'speechModel' => 'telephony', 'transcriptionEngine' => 'google']); + +echo $response; diff --git a/twiml/voice/transcription/transcription-speechmodel/transcription-speechmodel.py b/twiml/voice/transcription/transcription-speechmodel/transcription-speechmodel.py new file mode 100644 index 000000000..561533b12 --- /dev/null +++ b/twiml/voice/transcription/transcription-speechmodel/transcription-speechmodel.py @@ -0,0 +1,11 @@ +from twilio.twiml.voice_response import VoiceResponse, Start, Transcription + +response = VoiceResponse() +start = Start() +start.transcription( + status_callback_url='https://example.com/your-callback-url', + speech_model='telephony', + transcription_engine='google') +response.append(start) + +print(response) diff --git a/twiml/voice/transcription/transcription-speechmodel/transcription-speechmodel.rb b/twiml/voice/transcription/transcription-speechmodel/transcription-speechmodel.rb new file mode 100644 index 000000000..b09a575e5 --- /dev/null +++ b/twiml/voice/transcription/transcription-speechmodel/transcription-speechmodel.rb @@ -0,0 +1,8 @@ +require 'twilio-ruby' + +response = Twilio::TwiML::VoiceResponse.new +response.start do |start| + start.transcription(status_callback_url: 'https://example.com/your-callback-url', speech_model: 'telephony', transcription_engine: 'google') +end + +puts response diff --git a/twiml/voice/transcription/transcription-stop/meta.json b/twiml/voice/transcription/transcription-stop/meta.json new file mode 100644 index 000000000..0a8dd67f3 --- /dev/null +++ b/twiml/voice/transcription/transcription-stop/meta.json @@ -0,0 +1,4 @@ +{ + "title": "Stop a \\", + "type": "server" +} diff --git a/twiml/voice/transcription/transcription-stop/output/transcription-stop.twiml b/twiml/voice/transcription/transcription-stop/output/transcription-stop.twiml new file mode 100644 index 000000000..7520bc895 --- /dev/null +++ b/twiml/voice/transcription/transcription-stop/output/transcription-stop.twiml @@ -0,0 +1,6 @@ + + + + + + diff --git a/twiml/voice/transcription/transcription-stop/transcription-stop.cs b/twiml/voice/transcription/transcription-stop/transcription-stop.cs new file mode 100644 index 000000000..1dbe72a7c --- /dev/null +++ b/twiml/voice/transcription/transcription-stop/transcription-stop.cs @@ -0,0 +1,17 @@ +using System; +using Twilio.TwiML; +using Twilio.TwiML.Voice; + + +class Example +{ + static void Main() + { + var response = new VoiceResponse(); + var stop = new Stop(); + stop.Transcription(name: "Contact center transcription"); + response.Append(stop); + + Console.WriteLine(response.ToString()); + } +} diff --git a/twiml/voice/transcription/transcription-stop/transcription-stop.java b/twiml/voice/transcription/transcription-stop/transcription-stop.java new file mode 100644 index 000000000..131f03f47 --- /dev/null +++ b/twiml/voice/transcription/transcription-stop/transcription-stop.java @@ -0,0 +1,19 @@ +import com.twilio.twiml.VoiceResponse; +import com.twilio.twiml.voice.Stop; +import com.twilio.twiml.voice.Transcription; +import com.twilio.twiml.TwiMLException; + + +public class Example { + public static void main(String[] args) { + Transcription transcription = new Transcription.Builder().name("Contact center transcription").build(); + Stop stop = new Stop.Builder().transcription(transcription).build(); + VoiceResponse response = new VoiceResponse.Builder().stop(stop).build(); + + try { + System.out.println(response.toXml()); + } catch (TwiMLException e) { + e.printStackTrace(); + } + } +} diff --git a/twiml/voice/transcription/transcription-stop/transcription-stop.js b/twiml/voice/transcription/transcription-stop/transcription-stop.js new file mode 100644 index 000000000..8bef4992b --- /dev/null +++ b/twiml/voice/transcription/transcription-stop/transcription-stop.js @@ -0,0 +1,7 @@ +const VoiceResponse = require('twilio').twiml.VoiceResponse; + +const response = new VoiceResponse(); +const stop = response.stop(); +stop.transcription({name: 'Contact center transcription'}); + +console.log(response.toString()); diff --git a/twiml/voice/transcription/transcription-stop/transcription-stop.php b/twiml/voice/transcription/transcription-stop/transcription-stop.php new file mode 100644 index 000000000..a061422f9 --- /dev/null +++ b/twiml/voice/transcription/transcription-stop/transcription-stop.php @@ -0,0 +1,9 @@ +stop(); +$stop->transcription(['name' => 'Contact center transcription']); + +echo $response; diff --git a/twiml/voice/transcription/transcription-stop/transcription-stop.py b/twiml/voice/transcription/transcription-stop/transcription-stop.py new file mode 100644 index 000000000..267be896b --- /dev/null +++ b/twiml/voice/transcription/transcription-stop/transcription-stop.py @@ -0,0 +1,8 @@ +from twilio.twiml.voice_response import VoiceResponse, Stop, Transcription + +response = VoiceResponse() +stop = Stop() +stop.transcription(name='Contact center transcription') +response.append(stop) + +print(response) diff --git a/twiml/voice/transcription/transcription-stop/transcription-stop.rb b/twiml/voice/transcription/transcription-stop/transcription-stop.rb new file mode 100644 index 000000000..89f632d12 --- /dev/null +++ b/twiml/voice/transcription/transcription-stop/transcription-stop.rb @@ -0,0 +1,8 @@ +require 'twilio-ruby' + +response = Twilio::TwiML::VoiceResponse.new +response.stop do |stop| + stop.transcription(name: 'Contact center transcription') +end + +puts response diff --git a/twiml/voice/transcription/transcription-track/meta.json b/twiml/voice/transcription/transcription-track/meta.json new file mode 100644 index 000000000..579b90759 --- /dev/null +++ b/twiml/voice/transcription/transcription-track/meta.json @@ -0,0 +1,4 @@ +{ + "title": "\\ with track attribute", + "type": "server" +} diff --git a/twiml/voice/transcription/transcription-track/output/transcription-track.twiml b/twiml/voice/transcription/transcription-track/output/transcription-track.twiml new file mode 100644 index 000000000..4c1d57c9a --- /dev/null +++ b/twiml/voice/transcription/transcription-track/output/transcription-track.twiml @@ -0,0 +1,6 @@ + + + + + + diff --git a/twiml/voice/transcription/transcription-track/transcription-track.cs b/twiml/voice/transcription/transcription-track/transcription-track.cs new file mode 100644 index 000000000..4e1a75cab --- /dev/null +++ b/twiml/voice/transcription/transcription-track/transcription-track.cs @@ -0,0 +1,17 @@ +using System; +using Twilio.TwiML; +using Twilio.TwiML.Voice; + + +class Example +{ + static void Main() + { + var response = new VoiceResponse(); + var start = new Start(); + start.Transcription(statusCallbackUrl: "https://example.com/your-callback-url", track: "inbound_track"); + response.Append(start); + + Console.WriteLine(response.ToString()); + } +} diff --git a/twiml/voice/transcription/transcription-track/transcription-track.java b/twiml/voice/transcription/transcription-track/transcription-track.java new file mode 100644 index 000000000..12cbf7437 --- /dev/null +++ b/twiml/voice/transcription/transcription-track/transcription-track.java @@ -0,0 +1,19 @@ +import com.twilio.twiml.VoiceResponse; +import com.twilio.twiml.voice.Start; +import com.twilio.twiml.voice.Transcription; +import com.twilio.twiml.TwiMLException; + + +public class Example { + public static void main(String[] args) { + Transcription transcription = new Transcription.Builder().statusCallbackUrl("https://example.com/your-callback-url").track(Transcription.Track.INBOUND_TRACK).build(); + Start start = new Start.Builder().transcription(transcription).build(); + VoiceResponse response = new VoiceResponse.Builder().start(start).build(); + + try { + System.out.println(response.toXml()); + } catch (TwiMLException e) { + e.printStackTrace(); + } + } +} diff --git a/twiml/voice/transcription/transcription-track/transcription-track.js b/twiml/voice/transcription/transcription-track/transcription-track.js new file mode 100644 index 000000000..da06e7203 --- /dev/null +++ b/twiml/voice/transcription/transcription-track/transcription-track.js @@ -0,0 +1,7 @@ +const VoiceResponse = require('twilio').twiml.VoiceResponse; + +const response = new VoiceResponse(); +const start = response.start(); +start.transcription({statusCallbackUrl: 'https://example.com/your-callback-url', track: 'inbound_track'}); + +console.log(response.toString()); diff --git a/twiml/voice/transcription/transcription-track/transcription-track.php b/twiml/voice/transcription/transcription-track/transcription-track.php new file mode 100644 index 000000000..2b891129b --- /dev/null +++ b/twiml/voice/transcription/transcription-track/transcription-track.php @@ -0,0 +1,9 @@ +start(); +$start->transcription(['statusCallbackUrl' => 'https://example.com/your-callback-url', 'track' => 'inbound_track']); + +echo $response; diff --git a/twiml/voice/transcription/transcription-track/transcription-track.py b/twiml/voice/transcription/transcription-track/transcription-track.py new file mode 100644 index 000000000..b59299e54 --- /dev/null +++ b/twiml/voice/transcription/transcription-track/transcription-track.py @@ -0,0 +1,10 @@ +from twilio.twiml.voice_response import VoiceResponse, Start, Transcription + +response = VoiceResponse() +start = Start() +start.transcription( + status_callback_url='https://example.com/your-callback-url', + track='inbound_track') +response.append(start) + +print(response) diff --git a/twiml/voice/transcription/transcription-track/transcription-track.rb b/twiml/voice/transcription/transcription-track/transcription-track.rb new file mode 100644 index 000000000..3d9dd40f6 --- /dev/null +++ b/twiml/voice/transcription/transcription-track/transcription-track.rb @@ -0,0 +1,8 @@ +require 'twilio-ruby' + +response = Twilio::TwiML::VoiceResponse.new +response.start do |start| + start.transcription(status_callback_url: 'https://example.com/your-callback-url', track: 'inbound_track') +end + +puts response diff --git a/twiml/voice/transcription/transcription-transcriptionengine/meta.json b/twiml/voice/transcription/transcription-transcriptionengine/meta.json new file mode 100644 index 000000000..179fe7d5b --- /dev/null +++ b/twiml/voice/transcription/transcription-transcriptionengine/meta.json @@ -0,0 +1,4 @@ +{ + "title": "\\ with transcriptionEngine attribute", + "type": "server" +} diff --git a/twiml/voice/transcription/transcription-transcriptionengine/output/transcription-transcriptionengine.twiml b/twiml/voice/transcription/transcription-transcriptionengine/output/transcription-transcriptionengine.twiml new file mode 100644 index 000000000..6d0e88c1f --- /dev/null +++ b/twiml/voice/transcription/transcription-transcriptionengine/output/transcription-transcriptionengine.twiml @@ -0,0 +1,6 @@ + + + + + + diff --git a/twiml/voice/transcription/transcription-transcriptionengine/transcription-transcriptionengine.cs b/twiml/voice/transcription/transcription-transcriptionengine/transcription-transcriptionengine.cs new file mode 100644 index 000000000..af298f224 --- /dev/null +++ b/twiml/voice/transcription/transcription-transcriptionengine/transcription-transcriptionengine.cs @@ -0,0 +1,17 @@ +using System; +using Twilio.TwiML; +using Twilio.TwiML.Voice; + + +class Example +{ + static void Main() + { + var response = new VoiceResponse(); + var start = new Start(); + start.Transcription(statusCallbackUrl: "https://example.com/your-callback-url", transcriptionEngine: "google"); + response.Append(start); + + Console.WriteLine(response.ToString()); + } +} diff --git a/twiml/voice/transcription/transcription-transcriptionengine/transcription-transcriptionengine.java b/twiml/voice/transcription/transcription-transcriptionengine/transcription-transcriptionengine.java new file mode 100644 index 000000000..e424233ce --- /dev/null +++ b/twiml/voice/transcription/transcription-transcriptionengine/transcription-transcriptionengine.java @@ -0,0 +1,19 @@ +import com.twilio.twiml.VoiceResponse; +import com.twilio.twiml.voice.Start; +import com.twilio.twiml.voice.Transcription; +import com.twilio.twiml.TwiMLException; + + +public class Example { + public static void main(String[] args) { + Transcription transcription = new Transcription.Builder().statusCallbackUrl("https://example.com/your-callback-url").transcriptionEngine("google").build(); + Start start = new Start.Builder().transcription(transcription).build(); + VoiceResponse response = new VoiceResponse.Builder().start(start).build(); + + try { + System.out.println(response.toXml()); + } catch (TwiMLException e) { + e.printStackTrace(); + } + } +} diff --git a/twiml/voice/transcription/transcription-transcriptionengine/transcription-transcriptionengine.js b/twiml/voice/transcription/transcription-transcriptionengine/transcription-transcriptionengine.js new file mode 100644 index 000000000..49683d6e9 --- /dev/null +++ b/twiml/voice/transcription/transcription-transcriptionengine/transcription-transcriptionengine.js @@ -0,0 +1,7 @@ +const VoiceResponse = require('twilio').twiml.VoiceResponse; + +const response = new VoiceResponse(); +const start = response.start(); +start.transcription({statusCallbackUrl: 'https://example.com/your-callback-url', transcriptionEngine: 'google'}); + +console.log(response.toString()); diff --git a/twiml/voice/transcription/transcription-transcriptionengine/transcription-transcriptionengine.php b/twiml/voice/transcription/transcription-transcriptionengine/transcription-transcriptionengine.php new file mode 100644 index 000000000..5ae2eb901 --- /dev/null +++ b/twiml/voice/transcription/transcription-transcriptionengine/transcription-transcriptionengine.php @@ -0,0 +1,9 @@ +start(); +$start->transcription(['statusCallbackUrl' => 'https://example.com/your-callback-url', 'transcriptionEngine' => 'google']); + +echo $response; diff --git a/twiml/voice/transcription/transcription-transcriptionengine/transcription-transcriptionengine.py b/twiml/voice/transcription/transcription-transcriptionengine/transcription-transcriptionengine.py new file mode 100644 index 000000000..f0383ba0f --- /dev/null +++ b/twiml/voice/transcription/transcription-transcriptionengine/transcription-transcriptionengine.py @@ -0,0 +1,10 @@ +from twilio.twiml.voice_response import VoiceResponse, Start, Transcription + +response = VoiceResponse() +start = Start() +start.transcription( + status_callback_url='https://example.com/your-callback-url', + transcription_engine='google') +response.append(start) + +print(response) diff --git a/twiml/voice/transcription/transcription-transcriptionengine/transcription-transcriptionengine.rb b/twiml/voice/transcription/transcription-transcriptionengine/transcription-transcriptionengine.rb new file mode 100644 index 000000000..28b3658b1 --- /dev/null +++ b/twiml/voice/transcription/transcription-transcriptionengine/transcription-transcriptionengine.rb @@ -0,0 +1,8 @@ +require 'twilio-ruby' + +response = Twilio::TwiML::VoiceResponse.new +response.start do |start| + start.transcription(status_callback_url: 'https://example.com/your-callback-url', transcription_engine: 'google') +end + +puts response