US App to Person Campaign Resource
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?
The US App to Person (A2P) Campaign Resource allows you to create a US A2P Campaign Use Case for a Messaging Service.
You can think of an A2P campaign use case as a use case for your brand that will show the intent of the messages you send with your Messaging Service. Some example A2P campaign use cases are:
- Marketing messages
- Notifications
- Verification messages
With this REST API you can:
- Create an A2P campaign use case for a Messaging Service
- Fetch an A2P campaign use case for a Messaging Service
- Read a list of A2P campaign use cases for a Messaging Service
- Delete an A2P Campaign use case for a Messaging Service
This resource is part of the A2P 10DLC registration process. For Independent Software Vendors (ISVs), please see the ISV A2P 10DLC API registration guide for a step-by-step walkthrough on registering your customers for A2P 10DLC.
US App to Person Campaign Resource Properties
Resource Properties in REST API format | |
---|---|
sid
|
The unique string that identifies a US A2P Compliance resource |
account_sid
|
The SID of the Account that the Campaign belongs to. |
brand_registration_sid
|
The unique string to identify the A2P brand. |
messaging_service_sid
|
The SID of the Messaging Service that the resource is associated with. |
description
|
A short description of what this SMS campaign does. Max length: 4096 characters. |
message_samples
|
Message samples, at least 2 and up to 5 sample messages, <=1024 chars each. |
us_app_to_person_usecase
|
A2P Campaign Use Case. Examples: [ 2FA, EMERGENCY, MARKETING, STARTER...]. STARTER campaign use cases can only be created by STARTER Brands, and there can only be one STARTER campaign created per STARTER Brand. |
has_embedded_links
|
Indicate that this SMS campaign will send messages that contain links. |
has_embedded_phone
|
Indicates that this SMS campaign will send messages that contain phone numbers. |
campaign_status
|
Campaign status. Examples: IN_PROGRESS, VERIFIED, FAILED. |
campaign_id
|
The Campaign Registry (TCR) Campaign ID. |
is_externally_registered
|
Indicates whether the campaign was registered externally or not. |
rate_limits
|
Rate limit and/or classification set by each carrier, Ex. AT&T or T-Mobile. |
date_created
|
The date and time in GMT when the resource was created specified in ISO 8601 format. |
date_updated
|
The date and time in GMT when the resource was last updated specified in ISO 8601 format. |
url
|
The absolute URL of the US App to Person resource. |
mock
|
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. |
Create a US A2P Campaign Use Case
https://messaging.twilio.com/v1/Services/{MessagingServiceSid}/Compliance/Usa2p
Parameters
Parameters in REST API format | |
---|---|
messaging_service_sid
Path
|
The SID of the Messaging Service to create the resources from. |
brand_registration_sid
Required
|
A2P Brand Registration SID |
description
Required
|
A short description of what this SMS campaign does. |
message_samples
Required
|
Message samples, at least 2 and up to 5 sample messages, <=1024 chars each. |
us_app_to_person_usecase
Required
|
A2P Campaign Use Case. Examples: [ 2FA, EMERGENCY, MARKETING..] |
has_embedded_links
Required
|
Indicates that this SMS campaign will send messages that contain links. |
has_embedded_phone
Required
|
Indicates that this SMS campaign will send messages that contain phone numbers. |
Example 1
Fetch a US A2P Campaign Use Case
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
.
Parameters
Parameters in REST API format | |
---|---|
messaging_service_sid
Path
|
The SID of the Messaging Service to fetch the resource from. |
sid
Path
|
The SID of the US A2P Compliance resource to fetch |
Example 1
Fetch a list of possible US A2P Campaign Use Cases
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:
- Step 3 Create a US A2P Brand in the the ISV Standard API Walkthrough
- Step 3 Create a US A2P Brand in the ISV Starter API Walkthrough
For more information on possible campaign use cases for Messaging Services, head over to the US App to Person Messaging Service Use Case Resource.
Example 2
Read a List of US A2P Campaign Use Cases
https://messaging.twilio.com/v1/Services/{MessagingServiceSid}/Compliance/Usa2p
Parameters
Parameters in REST API format | |
---|---|
messaging_service_sid
Path
|
The SID of the Messaging Service to fetch the resource from. |
Example 1
Delete a US A2P Campaign Use Case
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
.
Parameters
Parameters in REST API format | |
---|---|
messaging_service_sid
Path
|
The SID of the Messaging Service to delete the resource from. |
sid
Path
|
The SID of the US A2P Compliance resource to delete |
Example 1
Need some help?
We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.