The Twilio/location
type allows you to send a location pin and an optional label, which you can use to enhance delivery notifications or provide location information to recipients.
You can send location templates during an active 24-hour session with the recipient. You can't use them to initiate a business-initiated session.
Location templates aren't supported for approval on WhatsApp and can't be submitted for approval.
longitude:
latitude:
label:
1// Install the C# / .NET helper library from twilio.com/docs/csharp/install23using System;4using Twilio;5using Twilio.Rest.Content.V1;67TwilioClient.Init(accountSid, authToken);89// define the twilio/text10var twilioText = new TwilioText.Builder();11twilioText.WithBody("Owl Air: Time to board, SFO is located at San Francisco International Airport, P.O. Box 8097, San Francisco, CA 94128 ");1213// define the twilio/location14var twilioLocation = new TwilioLocation.Builder();15twilioLocation.WithLabel("Time to Board @ SFO");16twilioLocaiton.WithLatitude(37.62159755922449)17twilioLocaiton.WithLongitude(-122.37888566473057)1819// define all the content types to be part of the template20var types = new Types.Builder();21types.WithTwilioText(twilioText.Build());22types.WithTwilioLocation(twilioLocation.Build());2324// build the create request object25var contentCreateRequest = new ContentCreateRequest.Builder();26contentCreateRequest.WithTypes(types.Build());27contentCreateRequest.WithLanguage("en");28contentCreateRequest.WithFriendlyName("owl_air_location");2930// create the twilio template31var contentTemplate = await CreateAsync(contentCreateRequest.Build());3233Console.WriteLine($"Created Twilio Content Template SID: {contentTemplate.Sid}");
1{2"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",3"date_created": "2022-08-29T15:23:12Z",4"date_updated": "2022-08-29T15:23:12Z",5"friendly_name": "owl_air_location",6"language": "en",7"links": {8"approval_create": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ApprovalRequests/whatsapp",9"approval_fetch": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ApprovalRequests"10},11"sid": "HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",12"types": {13"twilio/location": {14"label": "Time to Board @ SFO",15"latitude": 37.62159755922449,16"longitude": -122.3788856647305717},18"twilio/text": {19"body": "Owl Air: Time to board, SFO is located at San Francisco International Airport, P.O. Box 8097, San Francisco, CA 94128 "20}21},22"url": "https://content.twilio.com/v1/Content/HXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",23"variables": {}24}