import sys
sys.path.append("../plivo-python")
import plivo

client = plivo.RestClient("<auth_id>", "<auth_token>")
sub_usecase = ["CUSTOMER_CARE", "2FA"]
response = client.campaign.create(
    brand_id="<brand_id>",
    campaign_alias="campaign_sample message",
    vertical="INSURANCE",
    usecase="MIXED",
    sub_usecases=sub_usecase,
    description="Campaign description is a mandatory parameter, minimum 40 characters",
    embedded_link=False,
    embedded_phone=False,
    age_gated=False,
    subscriber_optin=True,
    subscriber_optout=True,
    subscriber_help=True,
    affiliate_marketing=False,
    sample1="Sample message 1 should have a minimum of 20 characters",
    sample2="Sample message 2 should have a minimum of 20 characters",
    url="https://<yoursite>.com/test",
    method="POST",
    message_flow="Message flow is a mandatory parameter, minimum 40 characters",
    help_keywords="HELP,INFO,MORE",
    help_message="Help message is a mandatory parameter, minimum 20 characters",
    optin_keywords="YES,SUBSCRIBE",
    optin_message="Opt-in message should have a minimum of 20 characters",
    optout_keywords="NO,STOP",
    optout_message="Opt-out message should have a minimum of 20 characters",
)
print(response)
{
    "apiId": "a640fba2-3b14-11ed-95d8-0242ac110004",
    "campaignId": "CVWMV6V",
    "message": "Request to create campaign was received and is being processed."
}

This API lets you register a campaign using a preexisting brand.

API Endpoint

POST
https://api.plivo.com/v1/Account/{auth_id}/10dlc/Campaign/

Arguments

campaign_alias
string
required
A friendly name for your campaign. This name appears on the Plivo console.
brand_id
string
required
ID of the for which campaign creation request is being submitted.
vertical
string
required
Indicates the industry specific to the message use case.

Allowed values: PROFESSIONAL, REAL_ESTATE, HEALTHCARE,HUMAN_RESOURCES, ENERGY, ENTERTAINMENT, RETAIL, TRANSPORTATION, AGRICULTURE, INSURANCE, POSTAL, EDUCATION, HOSPITALITY, FINANCIAL, POLITICAL, GAMBLING, LEGAL, CONSTRUCTION, NGO,MANUFACTURING, GOVERNMENT, TECHNOLOGY,COMMUNICATION

description
string
required
A brief description of the campaign and how it’s relevant to your business — minimum of 40 characters.
usecase
string
required
Indicates your messaging use case.

Allowed values: 2FA, ACCOUNT_NOTIFICATION, CUSTOMER_CARE, DELIVERY_NOTIFICATION, FRAUD_ALERT, HIGHER_EDUCATION, LOW_VOLUME, MARKETING, MIXED, POLLING_VOTING, PUBLIC_SERVICE_ANNOUNCEMENT, SECURITY_ALERT, STARTER.

STARTER brands can only use STARTER as their use case.

 

sample1
string
required
The content of a sample message that you will send through this campaign. You must provide at least two samples, each with a minimum of 20 characters.
sample2
string
required
The content of the second sample message.
subscriber_optin
boolean
required
A confirmation that you are collecting and processing customer opt-ins.

Allowed value: true

subscriber_optout
boolean
required
A confirmation that you are collecting and processing customer opt-outs.

Allowed value: true

subscriber_help
boolean
required
A confirmation that you have implemented a message reply that tells customers how they can contact the message sender when they reply with the “HELP” keyword.

Allowed value: true

direct_lending
boolean
required
Indicates whether this campaign includes content related to direct lending or other loan arrangements.

Allowed values: true, false

embedded_link
boolean
required
Indicates whether embedded links are being used. Operators do not accept public URL shorteners.

Allowed values: true, false

embedded_phone
boolean
required
Indicates whether the campaign is using an embedded phone number other than the required HELP contact number.

Allowed values: true, false

age_gated
boolean
required
Indicates whether the campaign includes any age-gated content as defined by operator and CTIA guidelines.

Allowed values: true, false

affiliate_marketing
boolean
required
Indicates whether affiliate marketing was used in the construction of this campaign.

Allowed values: true, false

sub_usecases
list
Only applicable when use case is STARTER, MIXED, or LOW_VOLUME. Indicates two to five comma-separated use cases.

Allowed values: 2FA, ACCOUNT_NOTIFICATION,CUSTOMER_CARE, DELIVERY_NOTIFICATION, FRAUD_ALERT, HIGHER_EDUCATION, MARKETING, POLLING_VOTING, PUBLIC_SERVICE_ANNOUNCEMENT, SECURITY_ALERT

message_flow
string
required
Describes how a customer opts in to a campaign, thereby giving consent to the sender to send messages. The message flow must be clear and inform customers about the nature of the campaign. If a campaign supports multiple opt-in mechanisms, you must mention all of them here.

Check documentation for samples.

help_message
string
required
Indicates the response to the HELP keyword. It may include the brand name and support contact information.

Check documentation for samples.

optout_message
string
required
Indicates the response to the STOP keyword. It must include acknowledgement of the opt-out request and confirmation that no further messages will be sent, and may include the brand name.

Check documentation for samples.

optin_message
string
Message sent to subscribers to confirm their opt-in to the campaign.
optin_keywords
string
Opt-in keywords associated with the campaign. If more than one, provide a comma-separated list with no special characters or embedded spaces.
help_keywords
string
Help keywords associated with the campaign, in all capital letters. If more than one, provide a comma-separated list with no special characters or embedded spaces.
url
string
The fully qualified URL to which status update callbacks for the message should be sent.
method
string
The HTTP method to be used when calling the URL defined above.

Allowed values: GET, POST
Defaults to POST

Returns

api_id for the request, unique campaign_id, and success message

import sys
sys.path.append("../plivo-python")
import plivo

client = plivo.RestClient("<auth_id>", "<auth_token>")
sub_usecase = ["CUSTOMER_CARE", "2FA"]
response = client.campaign.create(
    brand_id="<brand_id>",
    campaign_alias="campaign_sample message",
    vertical="INSURANCE",
    usecase="MIXED",
    sub_usecases=sub_usecase,
    description="Campaign description is a mandatory parameter, minimum 40 characters",
    embedded_link=False,
    embedded_phone=False,
    age_gated=False,
    subscriber_optin=True,
    subscriber_optout=True,
    subscriber_help=True,
    affiliate_marketing=False,
    sample1="Sample message 1 should have a minimum of 20 characters",
    sample2="Sample message 2 should have a minimum of 20 characters",
    url="https://<yoursite>.com/test",
    method="POST",
    message_flow="Message flow is a mandatory parameter, minimum 40 characters",
    help_keywords="HELP,INFO,MORE",
    help_message="Help message is a mandatory parameter, minimum 20 characters",
    optin_keywords="YES,SUBSCRIBE",
    optin_message="Opt-in message should have a minimum of 20 characters",
    optout_keywords="NO,STOP",
    optout_message="Opt-out message should have a minimum of 20 characters",
)
print(response)
{
    "apiId": "a640fba2-3b14-11ed-95d8-0242ac110004",
    "campaignId": "CVWMV6V",
    "message": "Request to create campaign was received and is being processed."
}