Update a 10DLC campaign from your account. This action is only allowed for campaigns that failed to register previously — that is, current registration_status = failed.
Note that updating a campaign submits it for another vetting review with the carriers at a cost of $15. See our 10DLC support page for more details on vetting.
Please note that updates to campaigns will be allowed when the registration_status is set to processing. However, in some cases, when the registration_status is in the processing stage, updates to campaigns will not be allowed (via console) or may result in an error through the API, as the campaign may be undergoing carrier approval with the registry.
POST
https://api.plivo.com/v1/Account/{auth_id}/10dlc/Campaign/{campaign_id}/
You can update only these fields of a campaign. You can pass one or more of the fields during the update.
campaign_aliasstring | A friendly name for your campaign. This name appears on the Plivo console. |
description string | A brief description of the campaign and how it’s relevant to your business — minimum of 40 characters. |
sample1 string | 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 | The content of the second sample message. |
message_flow string | 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 | Indicates the response to the HELP keyword. It may include the brand name and support contact information. Check documentation for samples. |
optout_message string | 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. |
optout_keywords string | Opt-out keywords associated with the campaign. If more than one, provide a comma-separated list with no special characters or embedded spaces. |
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. |
api_id and the campaign object for the campaign in question.
HTTP Status Code: 200
{
"api_id": "6739b738-80ff-11ed-95f2-0242ac110003",
"campaign": {
"brand_id": "BSJXPJH",
"campaign_attributes": {
"affiliate_marketing": false,
"age_gated": false,
"direct_lending": false,
"embedded_link": false,
"embedded_phone": false,
"subscriber_help": true,
"subscriber_optin": true,
"subscriber_optout": true
},
"campaign_id": "CDB3KGW",
"description": "Campaign description is a mandatory parameter, minimum 40 characters",
"help_keywords": "HELP,INFO,MORE",
"help_message": "Help message is a mandatory parameter, minimum 20 characters",
"message_flow": "Message flow is a mandatory parameter, minimum 40 characters",
"mno_metadata": {
"AT&T": {
"tpm": 4500
},
"T-Mobile": {
"brand_tier": "TOP"
},
"US Cellular": {
"tpm": 4500
},
"Verizon Wireless": {
"tpm": 4500
}
},
"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",
"registration_status": "FAILED",
"reseller_id": "",
"sample1": "Sample message 1 should have a minimum of 20 characters",
"sample2": "Sample message 2 should have a minimum of 20 characters",
"usecase": "2FA"
}
}
1
2
3
4
5
6
7
import sys
sys.path.append("../plivo-python")
import plivo
client = plivo.RestClient("<auth_id>", "<auth_token>")
response = client.campaign.update('<Campaign_id>, sample1='update sample1 on plivo and tcr', message_flow='message flow is mandatory param and minimum 40 characters', help_message='help message is mandatory param and minimum 20 character')
print(response)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
require "rubygems"
require "/etc/plivo-ruby/lib/plivo.rb"
include Plivo
api = RestClient.new(""<auth_id>", "<auth_token>")
begin
puts("Update Campaign")
response = api.campaign.update("<Campaign_ID>", params={sample1: "Sample message 1 text", message_flow:"Message flow is a mandatory parameter, minimum 40 characters", help_message:"Help message is a mandatory parameter, minimum 20 characters"})
puts response
rescue PlivoRESTError => e
puts 'Exception: ' + e.message
end
1
2
3
4
5
6
7
8
9
let plivo = require('plivo');
let fs = require('fs');
let client = new plivo.Client("<auth_id>", "<auth_token>");
client.campaign.update("<Campaign_id>","","Campaign description should have a minimum of 40 characters","Sample message 1 should have a minimum of 20 characters","Sample message 2 should have a minimum of 20 characters","Message flow is a mandatory parameter, minimum 40 characters","Help messgae is mandatory parameter, minimum 20 characters","YES,SUBSCRIBE","Opt-in message should have a minimum of 20 characters","NO,STOP","Opt-out message should have a minimum of 20 characters","HELP,INFO,MORE").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
<?php
require '/etc/plivo-php/vendor/autoload.php';
use Plivo\RestClient;
$client = new RestClient("<auth_id>", "<auth_token>");
$client->client->setTimeout(60);
try {
$res = $client->campaign->update("<Campaign_ID>", "Campaign description should have a minimum of 40 characters","","Sample message 1 should have a minimum of 20 characters","Sample message 2 should have a minimum 2of 0 characters","Message flow is a mandatory parameter, minimum 40 characters","Help messgae is a mandatory parameter, minimum 20 characters","YES,SUBSCRIBE","Opt-in message should have a minimum of 20 characters","NO,STOP","Opt-out message should have a minimum of 20 characters","HELP,INFO,MORE");
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
import java.io.IOException;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.FileWriter;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Random;
import java.net.URL;
import com.plivo.api.Plivo;
import com.plivo.api.exceptions.*;
import com.plivo.api.models.campaign.Campaign;
import com.plivo.api.models.campaign.CampaignUpdateResponse;
public class GetCampaignTest {
public static void main(String[] args) {
Plivo.init("<auth_id>", "<auth_token>");
// Update Campaign
try
{
CampaignUpdateResponse response = Campaign.updater("<Campaign_ID>","","Campaign description should have a minimum of 40 characters","Sample message 1 should have a minimun of 20 characters","Sample message 2 should have a minimum of 20 characters","Message flow is a mandatory parameter, minimum 40 characters","Help message is a mandatory parameter, minimum 20 characters","YES,SUBSCRIBE","Opt-in message should have a minimum of 20 characters","NO,STOP","Opt-out message should have a minimum of 20 characters","HELP,INFO,MORE").update();
System.out.println(response);
}
catch (PlivoRestException | IOException| PlivoValidationException e)
{
e.printStackTrace();
}
}
}
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
using System;
using Plivo;
using Plivo.Exception;
using Plivo.Utilities;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace test
{
class Program
{
static void Main(string[] args)
{
var api = new PlivoApi("<auth_id>", "<auth_token>");
try
{
Console.WriteLine("-------------------------------------campaign_update-------------------------------------");
var campaign_update_response = api.Campaign.Update("<Campaign_ID>", description:"Campaign description should have a minimum of 40 characters", sample1: "Sample message 1 should have a minimum of 20 characters", sample2: "Sample message 2 should have a minimum of 20 characters", message_flow:"Message flow is a mandatory parameter, minimum 40 characters", 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", help_keywords:"HELP,INFO,MORE");
Console.WriteLine(campaign_update_response);
}
catch (PlivoRestException e)
{
Console.WriteLine("Exception: " + e.Message);
}
}
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
curl --location --request POST 'https://api.plivo.com/v1/Account/<Auth_id>/10dlc/Campaign/<Campaign_id>/' \
--header 'Authorization: Basic XXXX==' \
--header 'Content-Type: application/json' \
--data-raw '{
"description":"Description should have minimum of 40 characters",
"sample1": "Sample message 1 should have minimum of 20 characters",
"sample2": "Sample message 2 should have minimum of 20 characters",
"message_flow":"Message flow is a mandatory parameter, minimum 40 characters",
"help_message":"Help message is a mandatory parameter, minimum 20 characters",
"optout_message":"Opt-out message should have a minimum of 20 characters",
"optout_keywords":"NO,STOP",
"optin_message":"Opt-in message should have a minimum of 20 characters",
"optin_keywords":"YES,SUBSCRIBE",
"help_keywords":"HELP,INFO,MORE"
}'
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
package main
import (
"fmt"
"os"
plivo "github.com/plivo/plivo-go/v7"
)
func main() {
client, err := plivo.NewClient("<auth_id>", "<auth_token>", &plivo.ClientOptions{})
if err != nil {
panic(err)
}
// Update Campaign
description:= "Campaign description should have minimum of 40 characters"
sample1:= "Sample message 1 should have a minimum of 20 characters"
sample2:= "Sample message 2 should have a minimum of 20 characters"
message_flow:= "Message flow is a mandatory parameter, minimum 40 characters"
help_message:= "Help messgae 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"
help_keywords:= "HELP,INFO,MORE"
response, err := client.Campaign.Update("<Campaign_id>", plivo.CampaignUpdateParams{
Description:description,
Sample1: sample1,
Sample2: sample2,
MessageFlow: message_flow,
HelpMessage: help_message,
OptinKeywords: optin_keywords,
OptinMessage: optin_message,
OptoutKeywords: optout_keywords,
OptoutMessage: optout_message,
HelpKeywords: help_keywords,
})
if err != nil {
fmt.Printf("Error occurred while updating camapign — error:%+v\n", err)
os.Exit(1)
} else {
fmt.Printf("%+v\n", response)
}
}