Create Mock US A2P 10DLC Brands and Campaigns
Info
New to US A2P 10DLC? See "What is A2P 10DLC?" (support article) for more information.
This guide shows you how to create a mock US A2P 10DLC Brand and Campaign that you can use to test and develop applications with. While the creation process of mock and real Brands and Campaigns is similar, there are some key differences to keep in mind:
- There are no A2P 10DLC fees from The Campaign Registry (TCR) or billing events for creating mock Brands and Campaigns because there is no vetting or validation of the submitted data.
- Mock Campaigns are not functional and cannot be used to send SMS traffic.
- Mock Sole Proprietor Brands cannot have mock Campaigns created for them and a one-time password (OTP) email will not be sent during mock Brand creation.
Before you can create a mock Brand and Campaign, you'll need to create a real Customer Profile as an ISV-type customer.
First, determine if you'll want to register a mock Standard, Low Volume Standard, or Sole Proprietor Brand with your Customer Profile. If you're not sure which Brand type to choose, check out this Support article for a detailed look at the differences. Note that mock Sole Proprietor Brands cannot have mock Campaigns created for them, because the OTP (one time password) will not be sent to the designated contact during Brand creation.
- For a mock Standard or Low Volume Standard Brand:
- Complete all steps before 3. Create a BrandRegistration in this API walkthrough, then proceed to Step 1.
- For a mock Sole Proprietor Brand:
- Complete all steps before 3. Create a new Sole Proprietor A2P Brand in this API walkthrough, then proceed to Step 1.
Now that your Customer Profile is set up and linked to an A2P Messaging Profile, you can create a mock Brand.
The process for creating a mock Brand is almost identical to creating a real Brand. The key difference is that you'll need to set the mock
request body parameter to True
when making the POST
request to the Messaging API BrandRegistration Resource. If mock
is not specified or set to False
, a real Brand will be created.
- For a mock Standard or Low Volume Standard Brand:
- Reference step 3. Create a BrandRegistration in this API walkthrough for constructing your API request, and set
mock
toTrue
.
- Reference step 3. Create a BrandRegistration in this API walkthrough for constructing your API request, and set
- For a mock Sole Proprietor Brand:
- Reference step 3. Create a new Sole Proprietor A2P Brand in this API walkthrough for constructing your API request, and set
mock
toTrue
.
- Reference step 3. Create a new Sole Proprietor A2P Brand in this API walkthrough for constructing your API request, and set
Parameter | Valid Values | Description |
---|---|---|
mock | True , False | Will create a mock Brand if set to True or a real Brand if either set to False or not specified. |
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createBrandRegistrations() {11const brandRegistration = await client.messaging.v1.brandRegistrations.create(12{13a2PProfileBundleSid: "BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX1",14brandType: "STANDARD",15customerProfileBundleSid: "BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX0",16mock: true,17}18);1920console.log(brandRegistration.sid);21}2223createBrandRegistrations();
Response
1{2"sid": "BN0044409f7e067e279523808d267e2d85",3"account_sid": "AC78e8e67fc0246521490fb9907fd0c165",4"customer_profile_bundle_sid": "BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX0",5"a2p_profile_bundle_sid": "BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX1",6"date_created": "2021-01-28T10:45:51Z",7"date_updated": "2021-01-28T10:45:51Z",8"brand_type": "STANDARD",9"status": "PENDING",10"tcr_id": "BXXXXXX",11"failure_reason": "Registration error",12"url": "https://messaging.twilio.com/v1/a2p/BrandRegistrations/BN0044409f7e067e279523808d267e2d85",13"brand_score": 42,14"brand_feedback": [15"TAX_ID",16"NONPROFIT"17],18"identity_status": "VERIFIED",19"russell_3000": true,20"government_entity": false,21"tax_exempt_status": "501c3",22"skip_automatic_sec_vet": false,23"errors": [],24"mock": true,25"links": {26"brand_vettings": "https://messaging.twilio.com/v1/a2p/BrandRegistrations/BN0044409f7e067e279523808d267e2d85/Vettings",27"brand_registration_otps": "https://messaging.twilio.com/v1/a2p/BrandRegistrations/BN0044409f7e067e279523808d267e2d85/SmsOtp"28}29}
You can confirm that the new Brand you created is a mock by checking for "mock": true
in the response. Real (non-mock) Brands will incur A2P 10DLC fees and billing events where applicable.
If you created a mock Sole Proprietor Brand, you will not be able to create mock Campaigns and can skip the remaining steps.
Danger
We highly discourage the use of existing Messaging Services with Senders in the Sender Pool to avoid any risks of your US messages failing.
Now you will need a Messaging Service to associate with the mock Campaign you are about to create. We recommend creating a new Messaging Service without any Senders. To do that, follow step 4. Create a Messaging Service in this API walkthrough.
Now that you've created a mock Brand and Messaging Service, you can create an associated mock Campaign. A Campaign represents a single messaging use case or the intent of the messages you wish to send. For example, your Campaign's use case might be to send marketing or account notifications.
The process for creating a mock Campaign is identical to creating a real Campaign. Any Campaign that is associated with a mock Brand automatically becomes a mock Campaign, so there is no need to pass in a mock
request parameter during Campaign creation.
Reference step 5. Create an A2P Campaign in this API walkthrough when constructing your API request.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createUsAppToPerson() {11const usAppToPerson = await client.messaging.v112.services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.usAppToPerson.create({14brandRegistrationSid: "BNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",15description: "Send marketing messages about sales and offers",16hasEmbeddedLinks: false,17hasEmbeddedPhone: false,18messageFlow: "MessageFlow",19messageSamples: ["Book your next OWL FLIGHT for just 1 EUR"],20usAppToPersonUsecase: "STANDARD",21});2223console.log(usAppToPerson.sid);24}2526createUsAppToPerson();
Response
1{2"sid": "QE2c6890da8086d771620e9b13fadeba0b",3"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"brand_registration_sid": "BNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",5"messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",6"description": "Send marketing messages about sales and offers",7"message_samples": [8"EXPRESS: Denim Days Event is ON",9"LAST CHANCE: Book your next flight for just 1 (ONE) EUR"10],11"us_app_to_person_usecase": "STANDARD",12"has_embedded_links": false,13"has_embedded_phone": false,14"subscriber_opt_in": false,15"age_gated": false,16"direct_lending": false,17"campaign_status": "PENDING",18"campaign_id": "CFOOBAR",19"is_externally_registered": false,20"rate_limits": {21"att": {22"mps": 600,23"msg_class": "A"24},25"tmobile": {26"brand_tier": "TOP"27}28},29"message_flow": "MessageFlow",30"opt_in_message": "Acme Corporation: You are now opted-in. For help, reply HELP. To opt-out, reply STOP",31"opt_out_message": "You have successfully been unsubscribed from Acme Corporation. You will not receive any more messages from this number.",32"help_message": "Acme Corporation: Please visit www.example.com to get support. To opt-out, reply STOP.",33"opt_in_keywords": [34"START"35],36"opt_out_keywords": [37"STOP"38],39"help_keywords": [40"HELP"41],42"date_created": "2021-02-18T14:48:52Z",43"date_updated": "2021-02-18T14:48:52Z",44"url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Compliance/Usa2p/QE2c6890da8086d771620e9b13fadeba0b",45"mock": false,46"errors": []47}
You can confirm that the new Campaign you created is a mock by checking for "mock": true
in the response.
Mock Brands cannot be manually deleted. They will expire and be automatically deleted 30 days after initial creation, along with all mock Campaigns associated with them.
Mock Campaigns can be deleted using the Messaging API with the US A2P identifier QE2c6890da8086d771620e9b13fadeba0b
as seen in the example below. This request will remove the mock Campaign associated with the specified Messaging Service.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function deleteUsAppToPerson() {11await client.messaging.v112.services("MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")13.usAppToPerson("QE2c6890da8086d771620e9b13fadeba0b")14.remove();15}1617deleteUsAppToPerson();
Need help building or registering your A2P 10DLC application? Learn more about Twilio Professional Services for A2P 10DLC.