Register a campaign
This API lets you register a campaign using a pre-existing brand.
API Endpoint
POST
https://api.plivo.com/v1/Account/{auth_id}/10dlc/Campaign/
Arguments
campaign_aliasstringRequired | A friendly name for your campaign. This will also appear on the Plivo console. |
brand_idstringRequired | Valid brand_id created using Plivo’s console or Brand endpoint. |
verticalstringRequired | Indicate the industry specific to your message use-case. Allowed values are 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 |
descriptionstringRequired | A brief description about you campaign and how is it relevant to your business. Note: Character limit — 100 characters. |
usecasestringRequired | Indicate your messaging use-case. Allowed values are: 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 usecase. |
sample1stringRequired | Indicate the content of your message that you will be sending through this campaign. You need to provide at least 2 samples. |
sample2stringRequired | Indicate the content of your message that you will be sending through this campaign. You need to provide at least 2 samples. |
subscriber_optinbooleanRequired | A confirmation that you are collecting and processing customer opt-ins. Allowed value = true |
subscriber_optoutbooleanRequired | A confirmation that you are collecting and processing customer opt-outs. Allowed value = true |
subscriber_helpbooleanRequired | A confirmation that you have implemented message reply providing customers on how they can contact the message sender after they reply with the “HELP” keyword. Allowed value = true |
direct_lendingbooleanRequired | A confirmation whether this campaign includes content related to direct lending or other loan arrangements. Allowed values = true/false |
embedded_linkbooleanRequired | A confirmation whether embedded links of any kind are being used? Public URL shorteners are not accepted by operators. Allowed values = true/false |
embedded_phonebooleanRequired | A confirmation whether the campaign is using an embedded phone number except the required HELP contact number. Allowed values = true/false |
age_gatedbooleanRequired | A confirmation whether the campaign includes any age-gated content as defined by operator & CTIA guidelines. Allowed values = true/false |
affiliate_marketingbooleanRequired | A confirmation whether affiliate marketing is/was being used in the construction of this campaign. Allowed values = true/false |
sub_usecaseslist | Only applicable when usecase is STARTER, MIXED or LOW_VOLUME. Indicate 2-5 comma-separates usecases. Allowed values are 2FA,ACCOUNT_NOTIFICATION,CUSTOMER_CARE,DELIVERY_NOTIFICATION,FRAUD_ALERT,HIGHER_EDUCATION,MARKETING,POLLING_VOTING,PUBLIC_SERVICE_ANNOUNCEMENT,SECURITY_ALERT |
urlstring | Set this parameter to the fully qualified URL to which status update callbacks for the message should be sent. |
methodstring | 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
Response
HTTP Status Code: 200
{
"api_id": "02de04b2-bafb-11ec-bb91-0242ac110003",
"campaign_id": "CFE3MUZ",
"message": "Request to create campaign was received and is being processed."
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Available in versions >= 4.30.0 (https://github.com/plivo/plivo-node/releases/tag/v4.30.0)
let plivo = require('plivo');
let client = new plivo.Client("<auth_id>", "<auth_token>");
var callback = {"url":"https://foo.com/tendlc_status/", "method":"POST"}
client.campaign.create(
"<brand_id>", //brand_id
"campaign name sssample", //campaign_alias
"INSURANCE", //vertical
"MIXED", //usecase
[
"CUSTOMER_CARE", //sub_usecases
"2FA" //sub_usecases
],
"sample description text", //description
false, //embedded_link
false, //embedded_phone
false, //age_gated
false, //direct_lending
true, //subscriber_optin
true, //subscriber_optout
true, //subscriber_help
"hey", //sample1
"test", //sample2
callback)
.then(function(response) {
console.log(JSON.stringify(response));
}).catch(function(error) {
console.log("err");
console.log(error);
});
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
# Available in versions >= 4.29.0 (https://github.com/plivo/plivo-php/releases/tag/v4.29.0)
require '/etc/plivo-php/vendor/autoload.php';
use Plivo\RestClient;
$client = new RestClient("<auth_id>", "<auth_token>");
$client
->client
->setTimeout(60);
try
{
$callback = array("url"=>"https://foo.com/tendlc_status/", "method"=>"POST");
$res = $client
->campaign
->create("<brand_id>", "campaign name sssample", "INSURANCE", "MIXED", ["CUSTOMER_CARE", "2FA"], "sample description text", False, False, False, False, True, True, True, "test 1", "test 2", $callback);
print_r($res);
}
catch(PlivoRestException $ex)
{
print_r($ex);
}
?>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Available in versions >= 5.9.0 (https://github.com/plivo/plivo-dotnet/releases/tag/v5.9.0)
using System;
using System.Collections.Generic;
using Plivo;
using Plivo.Exception;
namespace dotnet_project
{
class Ten_dlc
{
static void Main(string[] args)
{
var api = new PlivoApi("<auth_id>", "<auth_token>");
// Create Campaign
Console.WriteLine("Create Campaign");
try
{
var response = api.Campaign.Create(
brand_id: "BMIORKY",
vertical: "INSURANCE",
usecase: "2FA",
sub_usecases: new List<string>() {"2FA","MARKETING"},
description: "OTP Campaign",
embedded_link: false,
embedded_phone: false,
direct_lending: true,
age_gated: false,
subscriber_optin: true,
subscriber_optout: true,
subscriber_help: true,
sample1: "sample message 1",
sample2: "sample message 2",
url: "https://foo.com/tendlc_status/",
method: "POST"
);
Console.WriteLine(response);
}
catch (PlivoRestException e)
{
Console.WriteLine("Exception: " + e.Message);
}
}
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
curl -i --user auth_id:auth_token \
-H "Content-Type: application/json" \
-d '{
"brand_id": "{brand_id}",
"vertical": "INSURANCE",
"usecase": "MIXED",
"sub_usecases":["2FA","ACCOUNT_NOTIFICATION", "CUSTOMER_CARE", "DELIVERY_NOTIFICATION", "FRAUD_ALERT"],
"description": "OTP registration",
"direct_lending": true,
"affiliate_marketing": false,
"embedded_link": false,
"embedded_phone": false,
"age_gated": false,
"subscriber_optin": true,
"subscriber_optout": true,
"subscriber_help": true,
"sample1": "Hi User, Your OTP to login is 1234",
"sample2": "Your order {ID} is out for delivery.",
"url": "https://foo.com/tendlc_status/",
"method": "POST"
}' \
https://api.plivo.com/v1/Account/{auth_id}/10dlc/Campaign/
Rate this page
🥳 Thank you! It means a lot to us!
×
Help Us Improve
Thank you so much for rating the page, we would like to get your input for further improvements!
Subscribe to Updates
Thank you for your feedback!