Update campaign
Update a campaign’s properties by campaignId. Please note: only sample messages are editable.
PUT
/
10dlc
/
campaign
/
{campaignId}
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const telnyxCampaignCsp = await client.messaging10dlc.campaign.update('campaignId');
console.log(telnyxCampaignCsp.brandId);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
telnyx_campaign_csp = client.messaging_10dlc.campaign.update(
campaign_id="campaignId",
)
print(telnyx_campaign_csp.brand_id)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
telnyxCampaignCsp, err := client.Messaging10dlc.Campaign.Update(
context.TODO(),
"campaignId",
telnyx.Messaging10dlcCampaignUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", telnyxCampaignCsp.BrandID)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.messaging10dlc.campaign.CampaignUpdateParams;
import com.telnyx.sdk.models.messaging10dlc.campaign.TelnyxCampaignCsp;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
TelnyxCampaignCsp telnyxCampaignCsp = client.messaging10dlc().campaign().update("campaignId");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
telnyx_campaign_csp = telnyx.messaging_10dlc.campaign.update("campaignId")
puts(telnyx_campaign_csp)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$telnyxCampaignCsp = $client->messaging10dlc->campaign->update(
'campaignId',
autoRenewal: true,
helpMessage: 'helpMessage',
messageFlow: 'messageFlow',
resellerID: 'resellerId',
sample1: 'sample1',
sample2: 'sample2',
sample3: 'sample3',
sample4: 'sample4',
sample5: 'sample5',
webhookFailoverURL: 'webhookFailoverURL',
webhookURL: 'webhookURL',
);
var_dump($telnyxCampaignCsp);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx messaging-10dlc:campaign update \
--api-key 'My API Key' \
--campaign-id campaignIdcurl --request PUT \
--url https://api.telnyx.com/v2/10dlc/campaign/{campaignId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"resellerId": "RESELLER",
"sample1": "Sample1",
"sample2": "Sample2",
"sample3": "Sample3",
"sample4": "Sample4",
"sample5": "Sample5",
"messageFlow": "Messageflow",
"helpMessage": "Helpmessage",
"autoRenewal": true,
"webhookURL": "WebhookURL",
"webhookFailoverURL": "WebhookURL"
}
'{
"brandId": "d2ca9d69-641b-4131-83fa-5d0744f4c8a9",
"campaignId": "823d6b1a-6ed6-41a3-9c50-c8ff41b682ba",
"cspId": "<string>",
"description": "<string>",
"mock": true,
"subUsecases": [
"<string>"
],
"termsAndConditions": true,
"usecase": "<string>",
"ageGated": true,
"autoRenewal": true,
"billedDate": "<string>",
"brandDisplayName": "ABC Mobile",
"tcrBrandId": "BBRAND1",
"tcrCampaignId": "CCAMP1",
"createDate": "<string>",
"directLending": true,
"embeddedLink": true,
"embeddedPhone": true,
"helpKeywords": "<string>",
"helpMessage": "<string>",
"messageFlow": "<string>",
"nextRenewalOrExpirationDate": "<string>",
"numberPool": true,
"optinKeywords": "<string>",
"optinMessage": "<string>",
"optoutKeywords": "<string>",
"optoutMessage": "<string>",
"referenceId": "<string>",
"resellerId": "<string>",
"sample1": "<string>",
"sample2": "<string>",
"sample3": "<string>",
"sample4": "<string>",
"sample5": "<string>",
"status": "<string>",
"subscriberHelp": true,
"subscriberOptin": true,
"subscriberOptout": true,
"vertical": "<string>",
"webhookURL": "https://example.com/webhook",
"webhookFailoverURL": "https://example.com/failover-webhook",
"isTMobileRegistered": true,
"isTMobileSuspended": true,
"isTMobileNumberPoolingEnabled": true,
"failureReasons": "<string>",
"submissionStatus": "CREATED",
"campaignStatus": "TCR_ACCEPTED",
"privacyPolicyLink": "<string>",
"termsAndConditionsLink": "<string>",
"embeddedLinkSample": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"errors": [
{
"code": "string",
"title": "string",
"detail": "string",
"source": {
"pointer": "string",
"parameter": "string"
}
}
]
}Authorizations
Body
application/json
Response
Successful Response
Campaign is generated by the 10DLC registry once the corresponding campaign request is approved. Each campaign is assigned a unique identifier - campaignId. Once a campaign is activated, limited information is published to the NetNumber OSR service for consumption by members of the ecosystem. When a campaign is suspended(reversible) or expired(non-reversible), campaign data is deleted from the OSR service. Most attributes of campaignare immutable, including usecase, vertical, brandId and cspId.
Was this page helpful?
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const telnyxCampaignCsp = await client.messaging10dlc.campaign.update('campaignId');
console.log(telnyxCampaignCsp.brandId);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
telnyx_campaign_csp = client.messaging_10dlc.campaign.update(
campaign_id="campaignId",
)
print(telnyx_campaign_csp.brand_id)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
telnyxCampaignCsp, err := client.Messaging10dlc.Campaign.Update(
context.TODO(),
"campaignId",
telnyx.Messaging10dlcCampaignUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", telnyxCampaignCsp.BrandID)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.messaging10dlc.campaign.CampaignUpdateParams;
import com.telnyx.sdk.models.messaging10dlc.campaign.TelnyxCampaignCsp;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
TelnyxCampaignCsp telnyxCampaignCsp = client.messaging10dlc().campaign().update("campaignId");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
telnyx_campaign_csp = telnyx.messaging_10dlc.campaign.update("campaignId")
puts(telnyx_campaign_csp)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$telnyxCampaignCsp = $client->messaging10dlc->campaign->update(
'campaignId',
autoRenewal: true,
helpMessage: 'helpMessage',
messageFlow: 'messageFlow',
resellerID: 'resellerId',
sample1: 'sample1',
sample2: 'sample2',
sample3: 'sample3',
sample4: 'sample4',
sample5: 'sample5',
webhookFailoverURL: 'webhookFailoverURL',
webhookURL: 'webhookURL',
);
var_dump($telnyxCampaignCsp);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx messaging-10dlc:campaign update \
--api-key 'My API Key' \
--campaign-id campaignIdcurl --request PUT \
--url https://api.telnyx.com/v2/10dlc/campaign/{campaignId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"resellerId": "RESELLER",
"sample1": "Sample1",
"sample2": "Sample2",
"sample3": "Sample3",
"sample4": "Sample4",
"sample5": "Sample5",
"messageFlow": "Messageflow",
"helpMessage": "Helpmessage",
"autoRenewal": true,
"webhookURL": "WebhookURL",
"webhookFailoverURL": "WebhookURL"
}
'{
"brandId": "d2ca9d69-641b-4131-83fa-5d0744f4c8a9",
"campaignId": "823d6b1a-6ed6-41a3-9c50-c8ff41b682ba",
"cspId": "<string>",
"description": "<string>",
"mock": true,
"subUsecases": [
"<string>"
],
"termsAndConditions": true,
"usecase": "<string>",
"ageGated": true,
"autoRenewal": true,
"billedDate": "<string>",
"brandDisplayName": "ABC Mobile",
"tcrBrandId": "BBRAND1",
"tcrCampaignId": "CCAMP1",
"createDate": "<string>",
"directLending": true,
"embeddedLink": true,
"embeddedPhone": true,
"helpKeywords": "<string>",
"helpMessage": "<string>",
"messageFlow": "<string>",
"nextRenewalOrExpirationDate": "<string>",
"numberPool": true,
"optinKeywords": "<string>",
"optinMessage": "<string>",
"optoutKeywords": "<string>",
"optoutMessage": "<string>",
"referenceId": "<string>",
"resellerId": "<string>",
"sample1": "<string>",
"sample2": "<string>",
"sample3": "<string>",
"sample4": "<string>",
"sample5": "<string>",
"status": "<string>",
"subscriberHelp": true,
"subscriberOptin": true,
"subscriberOptout": true,
"vertical": "<string>",
"webhookURL": "https://example.com/webhook",
"webhookFailoverURL": "https://example.com/failover-webhook",
"isTMobileRegistered": true,
"isTMobileSuspended": true,
"isTMobileNumberPoolingEnabled": true,
"failureReasons": "<string>",
"submissionStatus": "CREATED",
"campaignStatus": "TCR_ACCEPTED",
"privacyPolicyLink": "<string>",
"termsAndConditionsLink": "<string>",
"embeddedLinkSample": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"errors": [
{
"code": "string",
"title": "string",
"detail": "string",
"source": {
"pointer": "string",
"parameter": "string"
}
}
]
}