Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

US App to Person Campaign Resource


(information)

Info

This resource is related to United States A2P 10DLC registration. For more information on A2P 10DLC registration, please see our support article What is A2P 10DLC(link takes you to an external page)?

The US App to Person (A2P) Campaign Resource allows you to create a US A2P Campaign for a Messaging Service.

An A2P Campaign is built around a specific use case that will indicate the intent of the messages you send with your Messaging Service, in association with your A2P Brand. Some example A2P campaign use cases are:

  • Marketing messages
  • Notifications
  • Verification messages

With this REST API you can:

This resource is part of the A2P 10DLC registration process. For Independent Software Vendors (ISVs), please see this guide for registering your customers as Standard and Low-Volume Standard Brands for A2P messaging Campaigns via our API. See this guide for registering your customers as Sole Proprietor Brands for A2P messaging Campaigns.


US App to Person Campaign Resource Properties

us-app-to-person-campaign-resource-properties page anchor
Resource properties
sidtype: SID<QE>Not PII

The unique string that identifies a US A2P Compliance resource QE2c6890da8086d771620e9b13fadeba0b.


account_sidtype: SID<AC>Not PII

The SID of the Account(link takes you to an external page) that the Campaign belongs to.


brand_registration_sidtype: SID<BN>Not PII

The unique string to identify the A2P brand.


messaging_service_sidtype: SID<MG>Not PII

The SID of the Messaging Service(link takes you to an external page) that the resource is associated with.


descriptiontype: stringNot PII

A short description of what this SMS campaign does. Min length: 40 characters. Max length: 4096 characters.


message_samplestype: string[]Not PII

An array of sample message strings, min two and max five. Min length for each sample: 20 chars. Max length for each sample: 1024 chars.


us_app_to_person_usecasetype: stringNot PII

A2P Campaign Use Case. Examples: [ 2FA, EMERGENCY, MARKETING, SOLE_PROPRIETOR...]. SOLE_PROPRIETOR campaign use cases can only be created by SOLE_PROPRIETOR Brands, and there can only be one SOLE_PROPRIETOR campaign created per SOLE_PROPRIETOR Brand.


has_embedded_linkstype: booleanNot PII

Indicate that this SMS campaign will send messages that contain links.


has_embedded_phonetype: booleanNot PII

Indicates that this SMS campaign will send messages that contain phone numbers.


subscriber_opt_intype: booleanNot PII

A boolean that specifies whether campaign has Subscriber Optin or not.


age_gatedtype: booleanNot PII

A boolean that specifies whether campaign is age gated or not.


direct_lendingtype: booleanNot PII

A boolean that specifies whether campaign allows direct lending or not.


campaign_statustype: stringNot PII

Campaign status. Examples: IN_PROGRESS, VERIFIED, FAILED.


campaign_idtype: stringNot PII

The Campaign Registry (TCR) Campaign ID.


is_externally_registeredtype: booleanNot PII

Indicates whether the campaign was registered externally or not.


rate_limitstype: objectNot PII

Rate limit and/or classification set by each carrier, Ex. AT&T or T-Mobile.


message_flowtype: stringNot PII

Details around how a consumer opts-in to their campaign, therefore giving consent to receive their messages. If multiple opt-in methods can be used for the same campaign, they must all be listed. 40 character minimum. 2048 character maximum.


opt_in_messagetype: stringNot PII

If end users can text in a keyword to start receiving messages from this campaign, the auto-reply messages sent to the end users must be provided. The opt-in response should include the Brand name, confirmation of opt-in enrollment to a recurring message campaign, how to get help, and clear description of how to opt-out. This field is required if end users can text in a keyword to start receiving messages from this campaign. 20 character minimum. 320 character maximum.


opt_out_messagetype: stringNot PII

Upon receiving the opt-out keywords from the end users, Twilio customers are expected to send back an auto-generated response, which must provide acknowledgment of the opt-out request and confirmation that no further messages will be sent. It is also recommended that these opt-out messages include the brand name. This field is required if managing opt out keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). 20 character minimum. 320 character maximum.


help_messagetype: stringNot PII

When customers receive the help keywords from their end users, Twilio customers are expected to send back an auto-generated response; this may include the brand name and additional support contact information. This field is required if managing help keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). 20 character minimum. 320 character maximum.


opt_in_keywordstype: string[]Not PII

If end users can text in a keyword to start receiving messages from this campaign, those keywords must be provided. This field is required if end users can text in a keyword to start receiving messages from this campaign. Values must be alphanumeric. 255 character maximum.


opt_out_keywordstype: string[]Not PII

End users should be able to text in a keyword to stop receiving messages from this campaign. Those keywords must be provided. This field is required if managing opt out keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum.


help_keywordstype: string[]Not PII

End users should be able to text in a keyword to receive help. Those keywords must be provided as part of the campaign registration request. This field is required if managing help keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum.


date_createdtype: string<DATE TIME>Not PII

The date and time in GMT when the resource was created specified in ISO 8601(link takes you to an external page) format.


date_updatedtype: string<DATE TIME>Not PII

The date and time in GMT when the resource was last updated specified in ISO 8601(link takes you to an external page) format.


urltype: string<URI>Not PII

The absolute URL of the US App to Person resource.


mocktype: booleanNot PII

A boolean that specifies whether campaign is a mock or not. Mock campaigns will be automatically created if using a mock brand. Mock campaigns should only be used for testing purposes.


errorstype: arrayNot PII

Details indicating why a campaign registration failed. These errors can indicate one or more fields that were incorrect or did not meet review requirements.


Create a US A2P Campaign

create-a-us-a2p-campaign page anchor
POST https://messaging.twilio.com/v1/Services/{MessagingServiceSid}/Compliance/Usa2p

Parameters

create-parameters page anchor
URI parameters
MessagingServiceSidtype: SID<MG>Not PII
Path Parameter

The SID of the Messaging Service(link takes you to an external page) to create the resources from.


Request body parameters
BrandRegistrationSidtype: SID<BN>Not PII
Required

A2P Brand Registration SID


Descriptiontype: stringNot PII
Required

A short description of what this SMS campaign does. Min length: 40 characters. Max length: 4096 characters.


MessageFlowtype: stringNot PII
Required

Required for all Campaigns. Details around how a consumer opts-in to their campaign, therefore giving consent to receive their messages. If multiple opt-in methods can be used for the same campaign, they must all be listed. 40 character minimum. 2048 character maximum.


MessageSamplestype: string[]Not PII
Required

An array of sample message strings, min two and max five. Min length for each sample: 20 chars. Max length for each sample: 1024 chars.


UsAppToPersonUsecasetype: stringNot PII
Required

A2P Campaign Use Case. Examples: [ 2FA, EMERGENCY, MARKETING..]


HasEmbeddedLinkstype: booleanNot PII
Required

Indicates that this SMS campaign will send messages that contain links.


HasEmbeddedPhonetype: booleanNot PII
Required

Indicates that this SMS campaign will send messages that contain phone numbers.


OptInMessagetype: stringNot PII

If end users can text in a keyword to start receiving messages from this campaign, the auto-reply messages sent to the end users must be provided. The opt-in response should include the Brand name, confirmation of opt-in enrollment to a recurring message campaign, how to get help, and clear description of how to opt-out. This field is required if end users can text in a keyword to start receiving messages from this campaign. 20 character minimum. 320 character maximum.


OptOutMessagetype: stringNot PII

Upon receiving the opt-out keywords from the end users, Twilio customers are expected to send back an auto-generated response, which must provide acknowledgment of the opt-out request and confirmation that no further messages will be sent. It is also recommended that these opt-out messages include the brand name. This field is required if managing opt out keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). 20 character minimum. 320 character maximum.


HelpMessagetype: stringNot PII

When customers receive the help keywords from their end users, Twilio customers are expected to send back an auto-generated response; this may include the brand name and additional support contact information. This field is required if managing help keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). 20 character minimum. 320 character maximum.


OptInKeywordstype: string[]Not PII

If end users can text in a keyword to start receiving messages from this campaign, those keywords must be provided. This field is required if end users can text in a keyword to start receiving messages from this campaign. Values must be alphanumeric. 255 character maximum.


OptOutKeywordstype: string[]Not PII

End users should be able to text in a keyword to stop receiving messages from this campaign. Those keywords must be provided. This field is required if managing opt out keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum.


HelpKeywordstype: string[]Not PII

End users should be able to text in a keyword to receive help. Those keywords must be provided as part of the campaign registration request. This field is required if managing help keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum.


SubscriberOptIntype: booleanNot PII

A boolean that specifies whether campaign has Subscriber Optin or not.


AgeGatedtype: booleanNot PII

A boolean that specifies whether campaign is age gated or not.


DirectLendingtype: booleanNot PII

A boolean that specifies whether campaign allows direct lending or not.

(information)

Info

If you use Twilio's default opt-out or advanced opt-out(link takes you to an external page), you do not need to submit opt-out and help keywords and messages when creating a Campaign. Twilio will automatically complete those fields for you with the default or your advanced opt-out and help messaging.

If you manage opt-out and help yourself, you must pass the opt-out and help parameters when creating a Campaign.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_19
// Download the helper library from https://www.twilio.com/docs/node/install
_19
// Find your Account SID and Auth Token at twilio.com/console
_19
// and set the environment variables. See http://twil.io/secure
_19
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_19
const authToken = process.env.TWILIO_AUTH_TOKEN;
_19
const client = require('twilio')(accountSid, authToken);
_19
_19
client.messaging.v1.services('MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_19
.usAppToPerson
_19
.create({
_19
messageFlow: 'End users opt-in by visiting www.example.com and adding their phone number. They then check a box agreeing to receive text messages from Example Brand. Additionally, end users can also opt-in by texting START to (111) 222-3333 to opt in. Term and Conditions at www.example.com/tc. Privacy Policy at www.example.com/privacy',
_19
messageSamples: ['EXPRESS: Denim Days Event is ON. Reply STOP to unsubscribe.', 'LAST CHANCE: Book your next flight for just 1 (ONE) EUR'],
_19
brandRegistrationSid: 'BNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
_19
description: 'description',
_19
usAppToPersonUsecase: 'us_app_to_person_usecase',
_19
hasEmbeddedLinks: true,
_19
hasEmbeddedPhone: true
_19
})
_19
.then(us_app_to_person => console.log(us_app_to_person.sid));

Output

_47
{
_47
"sid": "QE2c6890da8086d771620e9b13fadeba0b",
_47
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_47
"brand_registration_sid": "BNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_47
"messaging_service_sid": "MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_47
"description": "Send marketing messages about sales to opted in customers.",
_47
"message_samples": [
_47
"EXPRESS: Denim Days Event is ON. Reply STOP to unsubscribe.",
_47
"LAST CHANCE: Book your next flight for just 1 (ONE) EUR"
_47
],
_47
"us_app_to_person_usecase": "MARKETING",
_47
"has_embedded_links": true,
_47
"has_embedded_phone": false,
_47
"subscriber_opt_in": false,
_47
"age_gated": false,
_47
"direct_lending": false,
_47
"campaign_status": "PENDING",
_47
"campaign_id": "CFOOBAR",
_47
"is_externally_registered": false,
_47
"rate_limits": {
_47
"att": {
_47
"mps": 600,
_47
"msg_class": "A"
_47
},
_47
"tmobile": {
_47
"brand_tier": "TOP"
_47
}
_47
},
_47
"message_flow": "End users opt-in by visiting www.example.com and adding their phone number. They then check a box agreeing to receive text messages from Example Brand. Additionally, end users can also opt-in by texting START to (111) 222-3333 to opt in. Term and Conditions at www.example.com/tc. Privacy Policy at www.example.com/privacy",
_47
"opt_in_message": "Acme Corporation: You are now opted-in. For help, reply HELP. To opt-out, reply STOP",
_47
"opt_out_message": "You have successfully been unsubscribed from Acme Corporation. You will not receive any more messages from this number.",
_47
"help_message": "Acme Corporation: Please visit www.example.com to get support. To opt-out, reply STOP.",
_47
"opt_in_keywords": [
_47
"START"
_47
],
_47
"opt_out_keywords": [
_47
"STOP"
_47
],
_47
"help_keywords": [
_47
"HELP"
_47
],
_47
"date_created": "2021-02-18T14:48:52Z",
_47
"date_updated": "2021-02-18T14:48:52Z",
_47
"url": "https://messaging.twilio.com/v1/Services/MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Compliance/Usa2p/QE2c6890da8086d771620e9b13fadeba0b",
_47
"mock": false,
_47
"errors": []
_47
}


GET https://messaging.twilio.com/v1/Services/{MessagingServiceSid}/Compliance/Usa2p/{Sid}

Example 1: The value of Sid will always be the US A2P Compliance resource identifier: QE2c6890da8086d771620e9b13fadeba0b.

URI parameters
MessagingServiceSidtype: SID<MG>Not PII
Path Parameter

The SID of the Messaging Service(link takes you to an external page) to fetch the resource from.


Sidtype: SID<QE>Not PII
Path Parameter

The SID of the US A2P Compliance resource to fetch QE2c6890da8086d771620e9b13fadeba0b.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_11
// Download the helper library from https://www.twilio.com/docs/node/install
_11
// Find your Account SID and Auth Token at twilio.com/console
_11
// and set the environment variables. See http://twil.io/secure
_11
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11
const authToken = process.env.TWILIO_AUTH_TOKEN;
_11
const client = require('twilio')(accountSid, authToken);
_11
_11
client.messaging.v1.services('MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11
.usAppToPerson('QEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11
.fetch()
_11
.then(us_app_to_person => console.log(us_app_to_person.sid));

Output

_47
{
_47
"sid": "QEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_47
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_47
"brand_registration_sid": "BNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_47
"messaging_service_sid": "MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_47
"description": "Send marketing messages about sales to opted in customers.",
_47
"message_samples": [
_47
"EXPRESS: Denim Days Event is ON",
_47
"LAST CHANCE: Book your next flight for just 1 (ONE) EUR"
_47
],
_47
"us_app_to_person_usecase": "MARKETING",
_47
"has_embedded_links": true,
_47
"has_embedded_phone": false,
_47
"subscriber_opt_in": true,
_47
"age_gated": false,
_47
"direct_lending": false,
_47
"campaign_status": "PENDING",
_47
"campaign_id": "CFOOBAR",
_47
"is_externally_registered": false,
_47
"rate_limits": {
_47
"att": {
_47
"mps": 600,
_47
"msg_class": "A"
_47
},
_47
"tmobile": {
_47
"brand_tier": "TOP"
_47
}
_47
},
_47
"message_flow": "End users opt-in by visiting www.example.com and adding their phone number. They then check a box agreeing to receive text messages from Example Brand. Additionally, end users can also opt-in by texting START to (111) 222-3333 to opt in.",
_47
"opt_in_message": "Acme Corporation: You are now opted-in. For help, reply HELP. To opt-out, reply STOP",
_47
"opt_out_message": "You have successfully been unsubscribed from Acme Corporation. You will not receive any more messages from this number.",
_47
"help_message": "Acme Corporation: Please visit www.example.com to get support. To opt-out, reply STOP.",
_47
"opt_in_keywords": [
_47
"START"
_47
],
_47
"opt_out_keywords": [
_47
"STOP"
_47
],
_47
"help_keywords": [
_47
"HELP"
_47
],
_47
"date_created": "2021-02-18T14:48:52Z",
_47
"date_updated": "2021-02-18T14:48:52Z",
_47
"url": "https://messaging.twilio.com/v1/Services/MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Compliance/Usa2p/QE2c6890da8086d771620e9b13fadeba0b",
_47
"mock": false,
_47
"errors": []
_47
}

(information)

Info

In the json response to this fetch call, you would be looking in particular at the campaign_status attribute. The possible statuses for campaigns will vary depending on what stage the Campaign is at in the review process. A newly-created Campaign that has yet to be considered by TCR will be PENDING, assuming that the Twilio API itself has accepted it (i.e., all the data is basically conforming); otherwise it will be FAILED. Once TCR has begun its own review process on a successfully-submitted Campaign, the Campaign will be IN_PROGRESS until that review has finished. At that point the campaign_status will be either VERIFIED (approved) or FAILED (rejected).

If campaign_status is FAILED, the response will contain an "errors" attribute with the information on why the registration failed (this errors[] attribute is present in the return for other statuses as well, but will be empty) . The populated errors[] attribute is particularly helpful if the campaign registration failed during Twilio's internal review or External campaign review by our partners.

If your Campaign is marked as FAILED, please see this Guide to Troubleshooting A2P Brands and Campaignsto understand Campaign error messages and how to rectify these

Fetch a list of possible US A2P Campaign Use Cases

fetch-a-list-of-possible-us-a2p-campaign-use-cases page anchor

To fetch a list of possible US A2P campaign use cases for a Messaging Service, provide the BrandRegistrationSID (BNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX) as shown in Example 2.

If you haven not yet created a brand, please see one of the following US A2P ISV API guides on how to do so:

For more information on possible campaign use cases for Messaging Services, head over to the US App to Person Messaging Service Use Case Resource.

Fetch a list of possible US A2P Campaign Use Cases

fetch-a-list-of-possible-us-a2p-campaign-use-cases-1 page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

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

Output

_126
{
_126
"us_app_to_person_usecases": [
_126
{
_126
"code": "2FA",
_126
"name": "Two-Factor authentication (2FA)",
_126
"description": "Two-Factor authentication, one-time use password, password reset",
_126
"post_approval_required": false
_126
},
_126
{
_126
"code": "ACCOUNT_NOTIFICATION",
_126
"name": "Account Notification",
_126
"description": "All reminders, alerts, and notifications. (Examples include: flight delayed, hotel booked, appointment reminders.)",
_126
"post_approval_required": false
_126
},
_126
{
_126
"code": "AGENTS_FRANCHISES",
_126
"name": "Agents and Franchises",
_126
"description": "For brands that have multiple agents, franchises or offices in the same brand vertical, but require individual localised numbers per agent/location/office.",
_126
"post_approval_required": true
_126
},
_126
{
_126
"code": "CHARITY",
_126
"name": "Charity",
_126
"description": "Includes: 5013C Charity
_126
Does not include: Religious organizations",
_126
"post_approval_required": false
_126
},
_126
{
_126
"code": "PROXY",
_126
"name": "Proxy",
_126
"description": "Peer-to-peer app-based group messaging with proxy/pooled numbers (For example: GroupMe)
_126
Supporting personalized services and non-exposure of personal numbers for enterprise or A2P communications. (Examples include: Uber and AirBnb.)",
_126
"post_approval_required": true
_126
},
_126
{
_126
"code": "CUSTOMER_CARE",
_126
"name": "Customer Care",
_126
"description": "All customer care messaging, including account management and support",
_126
"post_approval_required": false
_126
},
_126
{
_126
"code": "DELIVERY_NOTIFICATION",
_126
"name": "Delivery Notification",
_126
"description": "Information about the status of the delivery of a product or service",
_126
"post_approval_required": false
_126
},
_126
{
_126
"code": "EMERGENCY",
_126
"name": "Emergency",
_126
"description": "Notification services designed to support public safety / health during natural disasters, armed conflicts, pandemics and other national or regional emergencies",
_126
"post_approval_required": true
_126
},
_126
{
_126
"code": "FRAUD_ALERT",
_126
"name": "Fraud Alert Messaging",
_126
"description": "Fraud alert notification",
_126
"post_approval_required": false
_126
},
_126
{
_126
"code": "HIGHER_EDUCATION",
_126
"name": "Higher Education",
_126
"description": "For campaigns created on behalf of Colleges or Universities and will also include School Districts etc that fall outside of any \"free to the consumer\" messaging model",
_126
"post_approval_required": false
_126
},
_126
{
_126
"code": "K12_EDUCATION",
_126
"name": "K-12 Education",
_126
"description": "Campaigns created for messaging platforms that support schools from grades K-12 and distance learning centers. This is not for Post-Secondary schools.",
_126
"post_approval_required": true
_126
},
_126
{
_126
"code": "LOW_VOLUME",
_126
"name": "Low Volume Mixed",
_126
"description": "Low throughput, any combination of use-cases. Examples include: test, demo accounts",
_126
"post_approval_required": false
_126
},
_126
{
_126
"code": "MARKETING",
_126
"name": "Marketing",
_126
"description": "Any communication with marketing and/or promotional content",
_126
"post_approval_required": false
_126
},
_126
{
_126
"code": "MIXED",
_126
"name": "Mixed",
_126
"description": "Mixed messaging reserved for specific consumer service industry",
_126
"post_approval_required": false
_126
},
_126
{
_126
"code": "POLITICAL",
_126
"name": "Political",
_126
"description": "Part of organized effort to influence decision making of specific group. All campaigns to be verified",
_126
"post_approval_required": false
_126
},
_126
{
_126
"code": "POLLING_VOTING",
_126
"name": "Polling and voting",
_126
"description": "Polling and voting",
_126
"post_approval_required": false
_126
},
_126
{
_126
"code": "PUBLIC_SERVICE_ANNOUNCEMENT",
_126
"name": "Public Service Announcement",
_126
"description": "An informational message that is meant to raise the audience awareness about an important issue",
_126
"post_approval_required": false
_126
},
_126
{
_126
"code": "SECURITY_ALERT",
_126
"name": "Security Alert",
_126
"description": "A notification that the security of a system, either software or hardware, has been compromised in some way and there is an action you need to take",
_126
"post_approval_required": false
_126
},
_126
{
_126
"code": "SOCIAL",
_126
"name": "Social",
_126
"description": "Communication within or between closed communities (For example: influencers alerts)",
_126
"post_approval_required": true
_126
},
_126
{
_126
"code": "SWEEPSTAKE",
_126
"name": "Sweepstake",
_126
"description": "Sweepstake",
_126
"post_approval_required": true
_126
}
_126
]
_126
}


Read a List of US A2P Campaigns associated with a Messaging Service

read-a-list-of-us-a2p-campaigns-associated-with-a-messaging-service page anchor
GET https://messaging.twilio.com/v1/Services/{MessagingServiceSid}/Compliance/Usa2p

URI parameters
MessagingServiceSidtype: SID<MG>Not PII
Path Parameter

The SID of the Messaging Service(link takes you to an external page) to fetch the resource from.


PageSizetype: integerNot PII
Query Parameter

How many resources to return in each list page. The default is 50, and the maximum is 1000.


Pagetype: integerNot PII
Query Parameter

The page index. This value is simply for client state.


PageTokentype: stringNot PII
Query Parameter

The page token. This is provided by the API.

Read a List of US A2P Campaigns associated with a Messaging Service

read-a-list-of-us-a2p-campaigns-associated-with-a-messaging-service-1 page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

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

Output

_60
{
_60
"compliance": [
_60
{
_60
"sid": "QE2c6890da8086d771620e9b13fadeba0b",
_60
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_60
"brand_registration_sid": "BNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_60
"messaging_service_sid": "MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_60
"description": "Send marketing messages about sales to opted in customers.",
_60
"message_samples": [
_60
"EXPRESS: Denim Days Event is ON",
_60
"LAST CHANCE: Book your next flight for just 1 (ONE) EUR"
_60
],
_60
"us_app_to_person_usecase": "MARKETING",
_60
"has_embedded_links": true,
_60
"has_embedded_phone": false,
_60
"subscriber_opt_in": true,
_60
"age_gated": false,
_60
"direct_lending": false,
_60
"campaign_status": "PENDING",
_60
"campaign_id": "CFOOBAR",
_60
"is_externally_registered": false,
_60
"rate_limits": {
_60
"att": {
_60
"mps": 600,
_60
"msg_class": "A"
_60
},
_60
"tmobile": {
_60
"brand_tier": "TOP"
_60
}
_60
},
_60
"message_flow": "End users opt-in by visiting www.example.com and adding their phone number. They then check a box agreeing to receive text messages from Example Brand. Additionally, end users can also opt-in by texting START to (111) 222-3333 to opt in.",
_60
"opt_in_message": "Acme Corporation: You are now opted-in. For help, reply HELP. To opt-out, reply STOP",
_60
"opt_out_message": "You have successfully been unsubscribed from Acme Corporation. You will not receive any more messages from this number.",
_60
"help_message": "Acme Corporation: Please visit www.example.com to get support. To opt-out, reply STOP.",
_60
"opt_in_keywords": [
_60
"START"
_60
],
_60
"opt_out_keywords": [
_60
"STOP"
_60
],
_60
"help_keywords": [
_60
"HELP"
_60
],
_60
"date_created": "2021-02-18T14:48:52Z",
_60
"date_updated": "2021-02-18T14:48:52Z",
_60
"url": "https://messaging.twilio.com/v1/Services/MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Compliance/Usa2p/QE2c6890da8086d771620e9b13fadeba0b",
_60
"mock": false,
_60
"errors": []
_60
}
_60
],
_60
"meta": {
_60
"page": 0,
_60
"page_size": 20,
_60
"first_page_url": "https://messaging.twilio.com/v1/Services/MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Compliance/Usa2p?PageSize=20&Page=0",
_60
"previous_page_url": "https://messaging.twilio.com/v1/Services/MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Compliance/Usa2p?PageSize=20&Page=0",
_60
"next_page_url": "https://messaging.twilio.com/v1/Services/MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Compliance/Usa2p?PageSize=20&Page=1",
_60
"url": "https://messaging.twilio.com/v1/Services/MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Compliance/Usa2p?PageSize=20&Page=0",
_60
"key": "compliance"
_60
}
_60
}


Delete a US A2P Campaign

delete-a-us-a2p-campaign page anchor
DELETE https://messaging.twilio.com/v1/Services/{MessagingServiceSid}/Compliance/Usa2p/{Sid}

Note: The value of Sid will always be the US A2P Compliance resource identifier: QE2c6890da8086d771620e9b13fadeba0b.

URI parameters
MessagingServiceSidtype: SID<MG>Not PII
Path Parameter

The SID of the Messaging Service(link takes you to an external page) to delete the resource from.


Sidtype: SID<QE>Not PII
Path Parameter

The SID of the US A2P Compliance resource to delete QE2c6890da8086d771620e9b13fadeba0b.

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
.usAppToPerson('QEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_10
.remove();


Rate this page: