Skip to contentSkip to navigationSkip to topbar
Rate this Page:

Using Proxy with Flex A2P SMS


(information)

Info

This guide is for Flex UI 1.x and channels that use Programmable Chat and Proxy. If you are using Flex UI 2.x or you are starting out, we recommend that you build with Flex Conversations.

If your contact center is sending SMS traffic in the United States, you're likely sending Application-to-Person SMS. As your contact center goes into production and scales its outbound traffic, you might notice that carriers are filtering some of your messages as potential spam. When your contact center gets to this point—or if you plan to send a high volume of outbound messages—it means that you'll need to:

  1. Register your SMS traffic with US carriers and
  2. Configure your contact center's messaging orchestration to use that registration.

This helps show that your messaging traffic is relevant to your customers and prevents it from being filtered by the US carrier network.

(information)

Info

Carrier filtering is more of an art than a science. Work with your Twilio team to discuss your traffic and come up with a strategy for scaling your traffic. If you're just testing your contact center, however, you shouldn't have any issues. Feel free to return to this document when you're in production!


Key Concepts for A2P-10DLC in Flex

key-concepts-for-a2p-10dlc-in-flex page anchor

Phone Numbers/10DLC: A phone number in the US is also sometimes called a 10-digit long code (10DLC). If you plan to send traffic to your customers in the US, you'll need to register that Application-to-Person (A2P) traffic with the US Carriers.

Messaging Services: A messaging service is a software layer for Programmable SMS that contains a link to your A2P registration. It contains a pool of phone numbers that will all behave according to the messaging service's configuration.

Twilio Proxy: Twilio Proxy is another software product that your Flex Contact Center uses to orchestrate inbound messages and connect them to unique chat channels.


Register for an Application-to-Person use case

register-for-an-application-to-person-use-case page anchor

Your first step will be to register for an A2P use case. You can learn more about how to register and what you'll need for registration in the Direct Brand Onboarding documentation.


Associate your Phone Numbers with your A2P Registration

associate-your-phone-numbers-with-your-a2p-registration page anchor

Typically, Flex messaging orchestration sends inbound messages directly to a software layer called Proxy, as described in the Flex Messaging overview. With A2P-10DLC, however, you first need to associate your phone numbers with your registration from the first step. You can do this using another handy piece of messaging software called a Messaging Service. The messaging service will associate your number with your A2P registration before sending traffic to your normal Flex messaging orchestration.

Create a Messaging Service via the Twilio Console

create-a-messaging-service-via-the-twilio-console page anchor

You'll need to navigate to the Messaging Services(link takes you to an external page) section of the Twilio Console to create a new messaging service. This will take you through four main steps:

  1. In Step 1, choose a Friendly Name and use case that feels appropriate for you.
  2. Add in any phone numbers that you want to use for messaging. This could be one phone number or many.
Screen Shot 2022-04-26 at 5.47.34 PM.
  1. Set your integration to Defer to Sender Webhook - this means that your phone number will keep using Flex messaging orchestration configuration, instead of using any of the messaging service logic. This step is the most important!
  2. Click Complete Messaging Service Setup to finish setting up your new Messaging Service.
  3. Optionally try the Send an SMS with a Messaging Service(link takes you to an external page) option to confirm your newly created Messaging Service is working. For more guidance, see the Messaging Service docs .

Create a Messaging Service via API

create-a-messaging-service-via-api page anchor

You can also create and update a Messaging Service via the API. In this method, make sure that you have the useInboundWebhookOnNumber property set to True.

Set useInboundWebhookOnNumber to True

set-useinboundwebhookonnumber-to-true page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.messaging.v1.services('MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_10
.update({useInboundWebhookOnNumber: true})
_10
.then(service => console.log(service.friendlyName));

Output

_33
{
_33
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_33
"friendly_name": "My Service!",
_33
"sid": "MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_33
"date_created": "2015-07-30T20:12:31Z",
_33
"date_updated": "2015-07-30T20:12:33Z",
_33
"sticky_sender": false,
_33
"mms_converter": true,
_33
"smart_encoding": false,
_33
"fallback_to_long_code": true,
_33
"scan_message_content": "inherit",
_33
"synchronous_validation": true,
_33
"area_code_geomatch": true,
_33
"validity_period": 600,
_33
"inbound_request_url": "https://www.example.com",
_33
"inbound_method": "POST",
_33
"fallback_url": null,
_33
"fallback_method": "POST",
_33
"status_callback": "https://www.example.com",
_33
"usecase": "marketing",
_33
"us_app_to_person_registered": false,
_33
"use_inbound_webhook_on_number": true,
_33
"links": {
_33
"phone_numbers": "https://messaging.twilio.com/v1/Services/MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/PhoneNumbers",
_33
"short_codes": "https://messaging.twilio.com/v1/Services/MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ShortCodes",
_33
"alpha_senders": "https://messaging.twilio.com/v1/Services/MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/AlphaSenders",
_33
"messages": "https://messaging.twilio.com/v1/Services/MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages",
_33
"us_app_to_person": "https://messaging.twilio.com/v1/Services/MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Compliance/Usa2p",
_33
"us_app_to_person_usecases": "https://messaging.twilio.com/v1/Services/MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Compliance/Usa2p/Usecases",
_33
"channel_senders": "https://messaging.twilio.com/v1/Services/MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ChannelSenders"
_33
},
_33
"url": "https://messaging.twilio.com/v1/Services/MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_33
}



Rate this Page: