telnyx-10dlc-javascript

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
<!-- Auto-generated from Telnyx OpenAPI specs. Do not edit. -->
<!-- 自动生成自Telnyx OpenAPI规范,请勿编辑 -->

Telnyx 10DLC - JavaScript

Telnyx 10DLC - JavaScript

Installation

安装

bash
npm install telnyx
bash
npm install telnyx

Setup

初始化配置

javascript
import Telnyx from 'telnyx';

const client = new Telnyx({
  apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
All examples below assume
client
is already initialized as shown above.
javascript
import Telnyx from 'telnyx';

const client = new Telnyx({
  apiKey: process.env['TELNYX_API_KEY'], // 这是默认配置,可省略
});
以下所有示例均假设
client
已按上文方式完成初始化。

Error Handling

错误处理

All API calls can fail with network errors, rate limits (429), validation errors (422), or authentication errors (401). Always handle errors in production code:
javascript
try {
  const telnyxBrand = await client.messaging10dlc.brand.create({
    country: 'US',
    displayName: 'ABC Mobile',
    email: 'support@example.com',
    entityType: 'PRIVATE_PROFIT',
    vertical: 'TECHNOLOGY',
  });
} catch (err) {
  if (err instanceof Telnyx.APIConnectionError) {
    console.error('Network error — check connectivity and retry');
  } else if (err instanceof Telnyx.RateLimitError) {
    const retryAfter = err.headers?.['retry-after'] || 1;
    await new Promise(r => setTimeout(r, retryAfter * 1000));
  } else if (err instanceof Telnyx.APIError) {
    console.error(`API error ${err.status}: ${err.message}`);
    if (err.status === 422) {
      console.error('Validation error — check required fields and formats');
    }
  }
}
Common error codes:
401
invalid API key,
403
insufficient permissions,
404
resource not found,
422
validation error (check field formats),
429
rate limited (retry with exponential backoff).
所有API调用都可能因网络错误、速率限制(429)、验证错误(422)或鉴权错误(401)失败,生产环境代码中请始终做好错误处理:
javascript
try {
  const telnyxBrand = await client.messaging10dlc.brand.create({
    country: 'US',
    displayName: 'ABC Mobile',
    email: 'support@example.com',
    entityType: 'PRIVATE_PROFIT',
    vertical: 'TECHNOLOGY',
  });
} catch (err) {
  if (err instanceof Telnyx.APIConnectionError) {
    console.error('网络错误 — 检查连接后重试');
  } else if (err instanceof Telnyx.RateLimitError) {
    const retryAfter = err.headers?.['retry-after'] || 1;
    await new Promise(r => setTimeout(r, retryAfter * 1000));
  } else if (err instanceof Telnyx.APIError) {
    console.error(`API错误 ${err.status}: ${err.message}`);
    if (err.status === 422) {
      console.error('验证错误 — 检查必填字段和格式');
    }
  }
}
常见错误码:
401
API密钥无效,
403
权限不足,
404
资源不存在,
422
验证错误(请检查字段格式),
429
触发速率限制(请使用指数退避策略重试)。

Important Notes

重要说明

  • Pagination: List methods return an auto-paginating iterator. Use
    for await (const item of result) { ... }
    to iterate through all pages automatically.
  • 分页: 列表方法返回支持自动分页的迭代器,可使用
    for await (const item of result) { ... }
    自动遍历所有分页结果。

Operational Caveats

操作注意事项

  • 10DLC is sequential: create the brand first, then submit the campaign, then attach messaging infrastructure such as the messaging profile.
  • Registration calls are not enough by themselves. Messaging cannot use the campaign until the assignment step completes successfully.
  • Treat registration status fields as part of the control flow. Do not assume the campaign is send-ready until the returned status fields confirm it.
  • 10DLC操作有严格顺序:首先创建品牌,然后提交活动,最后绑定短信配置文件等消息基础设施。
  • 仅完成注册调用是不够的,必须等分配步骤成功完成后,短信服务才能使用该活动。
  • 请将注册状态字段作为控制流程的判断依据,在返回的状态字段确认活动就绪前,不要假设活动已可用于发送消息。

Reference Use Rules

参考使用规则

Do not invent Telnyx parameters, enums, response fields, or webhook fields.
  • If the parameter, enum, or response field you need is not shown inline in this skill, read references/api-details.md before writing code.
  • Before using any operation in
    ## Additional Operations
    , read the optional-parameters section and the response-schemas section.
  • Before reading or matching webhook fields beyond the inline examples, read the webhook payload reference.
请勿自行编造Telnyx的参数、枚举值、响应字段或webhook字段。
  • 如果本技能中没有你需要的参数、枚举值或响应字段,编写代码前请先阅读references/api-details.md
  • 在使用
    ## 附加操作
    中的任意接口前,请先阅读可选参数章节响应结构章节
  • 如果需要读取或匹配超出内联示例的webhook字段,请先阅读webhook负载参考

Core Tasks

核心任务

Create a brand

创建品牌

Brand registration is the entrypoint for any US A2P 10DLC campaign flow.
client.messaging10dlc.brand.create()
POST /10dlc/brand
ParameterTypeRequiredDescription
entityType
objectYesEntity type behind the brand.
displayName
stringYesDisplay name, marketing name, or DBA name of the brand.
country
stringYesISO2 2 characters country code.
email
stringYesValid email address of brand support contact.
vertical
objectYesVertical or industry segment of the brand.
companyName
stringNo(Required for Non-profit/private/public) Legal company name.
firstName
stringNoFirst name of business contact.
lastName
stringNoLast name of business contact.
...+16 optional params in references/api-details.md
javascript
const telnyxBrand = await client.messaging10dlc.brand.create({
  country: 'US',
  displayName: 'ABC Mobile',
  email: 'support@example.com',
  entityType: 'PRIVATE_PROFIT',
  vertical: 'TECHNOLOGY',
});

console.log(telnyxBrand.identityStatus);
Primary response fields:
  • telnyxBrand.brandId
  • telnyxBrand.identityStatus
  • telnyxBrand.status
  • telnyxBrand.displayName
  • telnyxBrand.state
  • telnyxBrand.altBusinessId
品牌注册是所有美国A2P 10DLC活动流程的入口。
client.messaging10dlc.brand.create()
POST /10dlc/brand
参数类型必填说明
entityType
object品牌所属的实体类型
displayName
string品牌的展示名、营销名称或经营用名(DBA)
country
stringISO2标准的两位国家代码
email
string品牌支持联系人的有效邮箱地址
vertical
object品牌所属的垂直领域或行业细分
companyName
string(非营利/私营/公立实体必填)合法公司名称
firstName
string业务联系人的名字
lastName
string业务联系人的姓氏
...另有16个可选参数见references/api-details.md
javascript
const telnyxBrand = await client.messaging10dlc.brand.create({
  country: 'US',
  displayName: 'ABC Mobile',
  email: 'support@example.com',
  entityType: 'PRIVATE_PROFIT',
  vertical: 'TECHNOLOGY',
});

console.log(telnyxBrand.identityStatus);
主要响应字段:
  • telnyxBrand.brandId
  • telnyxBrand.identityStatus
  • telnyxBrand.status
  • telnyxBrand.displayName
  • telnyxBrand.state
  • telnyxBrand.altBusinessId

Submit a campaign

提交活动

Campaign submission is the compliance-critical step that determines whether traffic can be provisioned.
client.messaging10dlc.campaignBuilder.submit()
POST /10dlc/campaignBuilder
ParameterTypeRequiredDescription
brandId
string (UUID)YesAlphanumeric identifier of the brand associated with this ca...
description
stringYesSummary description of this campaign.
usecase
stringYesCampaign usecase.
ageGated
booleanNoAge gated message content in campaign.
autoRenewal
booleanNoCampaign subscription auto-renewal option.
directLending
booleanNoDirect lending or loan arrangement
...+29 optional params in references/api-details.md
javascript
const telnyxCampaignCsp = await client.messaging10dlc.campaignBuilder.submit({
  brandId: 'BXXXXXX',
  description: 'Two-factor authentication messages',
  usecase: '2FA',
    sampleMessages: ["Your verification code is {{code}}"],
});

console.log(telnyxCampaignCsp.brandId);
Primary response fields:
  • telnyxCampaignCsp.campaignId
  • telnyxCampaignCsp.brandId
  • telnyxCampaignCsp.campaignStatus
  • telnyxCampaignCsp.submissionStatus
  • telnyxCampaignCsp.failureReasons
  • telnyxCampaignCsp.status
活动提交是合规核心步骤,决定了流量是否可被下发。
client.messaging10dlc.campaignBuilder.submit()
POST /10dlc/campaignBuilder
参数类型必填说明
brandId
string (UUID)关联该活动的品牌的字母数字标识符
description
string该活动的摘要说明
usecase
string活动使用场景
ageGated
boolean活动是否包含年龄限制的消息内容
autoRenewal
boolean活动订阅是否自动续费
directLending
boolean是否涉及直接放贷或贷款安排
...另有29个可选参数见references/api-details.md
javascript
const telnyxCampaignCsp = await client.messaging10dlc.campaignBuilder.submit({
  brandId: 'BXXXXXX',
  description: '双因素认证消息',
  usecase: '2FA',
    sampleMessages: ["Your verification code is {{code}}"],
});

console.log(telnyxCampaignCsp.brandId);
主要响应字段:
  • telnyxCampaignCsp.campaignId
  • telnyxCampaignCsp.brandId
  • telnyxCampaignCsp.campaignStatus
  • telnyxCampaignCsp.submissionStatus
  • telnyxCampaignCsp.failureReasons
  • telnyxCampaignCsp.status

Assign a messaging profile to a campaign

为活动分配短信配置文件

Messaging profile assignment is the practical handoff from registration to send-ready messaging infrastructure.
client.messaging10dlc.phoneNumberAssignmentByProfile.assign()
POST /10dlc/phoneNumberAssignmentByProfile
ParameterTypeRequiredDescription
messagingProfileId
string (UUID)YesThe ID of the messaging profile that you want to link to the...
campaignId
string (UUID)YesThe ID of the campaign you want to link to the specified mes...
tcrCampaignId
string (UUID)NoThe TCR ID of the shared campaign you want to link to the sp...
javascript
const response = await client.messaging10dlc.phoneNumberAssignmentByProfile.assign({
  messagingProfileId: '4001767e-ce0f-4cae-9d5f-0d5e636e7809',
    campaignId: 'CXXX001',
});

console.log(response.messagingProfileId);
Primary response fields:
  • response.messagingProfileId
  • response.campaignId
  • response.taskId
  • response.tcrCampaignId

短信配置文件分配是从注册到消息发送就绪的实际交接步骤。
client.messaging10dlc.phoneNumberAssignmentByProfile.assign()
POST /10dlc/phoneNumberAssignmentByProfile
参数类型必填说明
messagingProfileId
string (UUID)你想要关联到活动的短信配置文件ID
campaignId
string (UUID)你想要关联到指定短信配置文件的活动ID
tcrCampaignId
string (UUID)你想要关联到指定配置文件的共享活动的TCR ID
javascript
const response = await client.messaging10dlc.phoneNumberAssignmentByProfile.assign({
  messagingProfileId: '4001767e-ce0f-4cae-9d5f-0d5e636e7809',
    campaignId: 'CXXX001',
});

console.log(response.messagingProfileId);
主要响应字段:
  • response.messagingProfileId
  • response.campaignId
  • response.taskId
  • response.tcrCampaignId

Webhook Verification

Webhook验证

Telnyx signs webhooks with Ed25519. Each request includes
telnyx-signature-ed25519
and
telnyx-timestamp
headers. Always verify signatures in production:
javascript
// In your webhook handler (e.g., Express — use raw body, not parsed JSON):
app.post('/webhooks', express.raw({ type: 'application/json' }), async (req, res) => {
  try {
    const event = await client.webhooks.unwrap(req.body.toString(), {
      headers: req.headers,
    });
    // Signature valid — event is the parsed webhook payload
    console.log('Received event:', event.data.event_type);
    res.status(200).send('OK');
  } catch (err) {
    console.error('Webhook verification failed:', err.message);
    res.status(400).send('Invalid signature');
  }
});
Telnyx使用Ed25519对webhook进行签名,每个请求都会携带
telnyx-signature-ed25519
telnyx-timestamp
请求头,生产环境请务必验证签名:
javascript
// 在你的webhook处理程序中(例如Express — 使用原始body,不要用解析后的JSON):
app.post('/webhooks', express.raw({ type: 'application/json' }), async (req, res) => {
  try {
    const event = await client.webhooks.unwrap(req.body.toString(), {
      headers: req.headers,
    });
    // 签名有效 — event为解析后的webhook负载
    console.log('Received event:', event.data.event_type);
    res.status(200).send('OK');
  } catch (err) {
    console.error('Webhook验证失败:', err.message);
    res.status(400).send('Invalid signature');
  }
});

Webhooks

Webhooks

These webhook payload fields are inline because they are part of the primary integration path.
以下webhook负载字段为核心集成路径的一部分,因此在此处列出。

Campaign Status Update

活动状态更新

FieldTypeDescription
brandId
stringBrand ID associated with the campaign.
campaignId
stringThe ID of the campaign.
createDate
stringUnix timestamp when campaign was created.
cspId
stringAlphanumeric identifier of the CSP associated with this campaign.
isTMobileRegistered
booleanIndicates whether the campaign is registered with T-Mobile.
type
enum: TELNYX_EVENT, REGISTRATION, MNO_REVIEW, TELNYX_REVIEW, NUMBER_POOL_PROVISIONED, NUMBER_POOL_DEPROVISIONED, TCR_EVENT, VERIFIED
description
stringDescription of the event.
status
enum: ACCEPTED, REJECTED, DORMANT, success, failedThe status of the campaign.
If you need webhook fields that are not listed inline here, read the webhook payload reference before writing the handler.

字段类型说明
brandId
string活动关联的品牌ID
campaignId
string活动ID
createDate
string活动创建的Unix时间戳
cspId
string关联该活动的CSP的字母数字标识符
isTMobileRegistered
boolean标识活动是否已在T-Mobile完成注册
type
枚举: TELNYX_EVENT, REGISTRATION, MNO_REVIEW, TELNYX_REVIEW, NUMBER_POOL_PROVISIONED, NUMBER_POOL_DEPROVISIONED, TCR_EVENT, VERIFIED
description
string事件说明
status
枚举: ACCEPTED, REJECTED, DORMANT, success, failed活动状态
如果你需要此处未列出的webhook字段,编写处理程序前请先阅读webhook负载参考

Important Supporting Operations

重要辅助操作

Use these when the core tasks above are close to your flow, but you need a common variation or follow-up step.
当上述核心任务与你的流程接近,但需要常见的变体或后续步骤时可使用这些操作。

Get Brand

查询品牌信息

Inspect the current state of an existing brand registration.
client.messaging10dlc.brand.retrieve()
GET /10dlc/brand/{brandId}
ParameterTypeRequiredDescription
brandId
string (UUID)Yes
javascript
const brand = await client.messaging10dlc.brand.retrieve('BXXX001');

console.log(brand);
Primary response fields:
  • brand.status
  • brand.state
  • brand.altBusinessId
  • brand.altBusinessIdType
  • brand.assignedCampaignsCount
  • brand.brandId
查看已存在的品牌注册的当前状态。
client.messaging10dlc.brand.retrieve()
GET /10dlc/brand/{brandId}
参数类型必填说明
brandId
string (UUID)
javascript
const brand = await client.messaging10dlc.brand.retrieve('BXXX001');

console.log(brand);
主要响应字段:
  • brand.status
  • brand.state
  • brand.altBusinessId
  • brand.altBusinessIdType
  • brand.assignedCampaignsCount
  • brand.brandId

Qualify By Usecase

按使用场景验证资格

Fetch the current state before updating, deleting, or making control-flow decisions.
client.messaging10dlc.campaignBuilder.brand.qualifyByUsecase()
GET /10dlc/campaignBuilder/brand/{brandId}/usecase/{usecase}
ParameterTypeRequiredDescription
usecase
stringYes
brandId
string (UUID)Yes
javascript
const response = await client.messaging10dlc.campaignBuilder.brand.qualifyByUsecase('usecase', {
  brandId: 'BXXX001',
});

console.log(response.annualFee);
Primary response fields:
  • response.annualFee
  • response.maxSubUsecases
  • response.minSubUsecases
  • response.mnoMetadata
  • response.monthlyFee
  • response.quarterlyFee
在更新、删除或进行控制流决策前获取当前状态。
client.messaging10dlc.campaignBuilder.brand.qualifyByUsecase()
GET /10dlc/campaignBuilder/brand/{brandId}/usecase/{usecase}
参数类型必填说明
usecase
string
brandId
string (UUID)
javascript
const response = await client.messaging10dlc.campaignBuilder.brand.qualifyByUsecase('usecase', {
  brandId: 'BXXX001',
});

console.log(response.annualFee);
主要响应字段:
  • response.annualFee
  • response.maxSubUsecases
  • response.minSubUsecases
  • response.mnoMetadata
  • response.monthlyFee
  • response.quarterlyFee

Create New Phone Number Campaign

创建新的电话号码活动关联

Create or provision an additional resource when the core tasks do not cover this flow.
client.messaging10dlc.phoneNumberCampaigns.create()
POST /10dlc/phone_number_campaigns
ParameterTypeRequiredDescription
phoneNumber
string (E.164)YesThe phone number you want to link to a specified campaign.
campaignId
string (UUID)YesThe ID of the campaign you want to link to the specified pho...
javascript
const phoneNumberCampaign = await client.messaging10dlc.phoneNumberCampaigns.create({
  campaignId: '4b300178-131c-d902-d54e-72d90ba1620j',
  phoneNumber: '+18005550199',
});

console.log(phoneNumberCampaign.campaignId);
Primary response fields:
  • phoneNumberCampaign.assignmentStatus
  • phoneNumberCampaign.brandId
  • phoneNumberCampaign.campaignId
  • phoneNumberCampaign.createdAt
  • phoneNumberCampaign.failureReasons
  • phoneNumberCampaign.phoneNumber
当核心任务未覆盖该流程时,创建或预配置额外资源。
client.messaging10dlc.phoneNumberCampaigns.create()
POST /10dlc/phone_number_campaigns
参数类型必填说明
phoneNumber
string (E.164)你想要关联到指定活动的电话号码
campaignId
string (UUID)你想要关联到指定电话号码的活动ID
javascript
const phoneNumberCampaign = await client.messaging10dlc.phoneNumberCampaigns.create({
  campaignId: '4b300178-131c-d902-d54e-72d90ba1620j',
  phoneNumber: '+18005550199',
});

console.log(phoneNumberCampaign.campaignId);
主要响应字段:
  • phoneNumberCampaign.assignmentStatus
  • phoneNumberCampaign.brandId
  • phoneNumberCampaign.campaignId
  • phoneNumberCampaign.createdAt
  • phoneNumberCampaign.failureReasons
  • phoneNumberCampaign.phoneNumber

Get campaign

查询活动信息

Inspect the current state of an existing campaign registration.
client.messaging10dlc.campaign.retrieve()
GET /10dlc/campaign/{campaignId}
ParameterTypeRequiredDescription
campaignId
string (UUID)Yes
javascript
const telnyxCampaignCsp = await client.messaging10dlc.campaign.retrieve('CXXX001');

console.log(telnyxCampaignCsp.brandId);
Primary response fields:
  • telnyxCampaignCsp.status
  • telnyxCampaignCsp.ageGated
  • telnyxCampaignCsp.autoRenewal
  • telnyxCampaignCsp.billedDate
  • telnyxCampaignCsp.brandDisplayName
  • telnyxCampaignCsp.brandId
查看已存在的活动注册的当前状态。
client.messaging10dlc.campaign.retrieve()
GET /10dlc/campaign/{campaignId}
参数类型必填说明
campaignId
string (UUID)
javascript
const telnyxCampaignCsp = await client.messaging10dlc.campaign.retrieve('CXXX001');

console.log(telnyxCampaignCsp.brandId);
主要响应字段:
  • telnyxCampaignCsp.status
  • telnyxCampaignCsp.ageGated
  • telnyxCampaignCsp.autoRenewal
  • telnyxCampaignCsp.billedDate
  • telnyxCampaignCsp.brandDisplayName
  • telnyxCampaignCsp.brandId

List Brands

列出品牌

Inspect available resources or choose an existing resource before mutating it.
client.messaging10dlc.brand.list()
GET /10dlc/brand
ParameterTypeRequiredDescription
sort
enum (assignedCampaignsCount, -assignedCampaignsCount, brandId, -brandId, createdAt, ...)NoSpecifies the sort order for results.
page
integerNo
recordsPerPage
integerNonumber of records per page.
...+6 optional params in references/api-details.md
javascript
// Automatically fetches more pages as needed.
for await (const brandListResponse of client.messaging10dlc.brand.list()) {
  console.log(brandListResponse.identityStatus);
}
Primary response fields:
  • brandListResponse.page
  • brandListResponse.records
  • brandListResponse.totalRecords
在修改资源前查看可用资源或选择已有资源。
client.messaging10dlc.brand.list()
GET /10dlc/brand
参数类型必填说明
sort
枚举 (assignedCampaignsCount, -assignedCampaignsCount, brandId, -brandId, createdAt, ...)指定结果的排序规则
page
integer
recordsPerPage
integer每页记录数
...另有6个可选参数见references/api-details.md
javascript
// 按需自动拉取更多分页
for await (const brandListResponse of client.messaging10dlc.brand.list()) {
  console.log(brandListResponse.identityStatus);
}
主要响应字段:
  • brandListResponse.page
  • brandListResponse.records
  • brandListResponse.totalRecords

Get Brand Feedback By Id

根据ID获取品牌反馈

Fetch the current state before updating, deleting, or making control-flow decisions.
client.messaging10dlc.brand.getFeedback()
GET /10dlc/brand/feedback/{brandId}
ParameterTypeRequiredDescription
brandId
string (UUID)Yes
javascript
const response = await client.messaging10dlc.brand.getFeedback('BXXX001');

console.log(response.brandId);
Primary response fields:
  • response.brandId
  • response.category

在更新、删除或进行控制流决策前获取当前状态。
client.messaging10dlc.brand.getFeedback()
GET /10dlc/brand/feedback/{brandId}
参数类型必填说明
brandId
string (UUID)
javascript
const response = await client.messaging10dlc.brand.getFeedback('BXXX001');

console.log(response.brandId);
主要响应字段:
  • response.brandId
  • response.category

Additional Operations

附加操作

Use the core tasks above first. The operations below are indexed here with exact SDK methods and required params; use references/api-details.md for full optional params, response schemas, and lower-frequency webhook payloads. Before using any operation below, read the optional-parameters section and the response-schemas section so you do not guess missing fields.
OperationSDK methodEndpointUse whenRequired params
Get Brand SMS OTP Status
client.messaging10dlc.brand.getSMSOtpByReference()
GET /10dlc/brand/smsOtp/{referenceId}
Fetch the current state before updating, deleting, or making control-flow decisions.
referenceId
Update Brand
client.messaging10dlc.brand.update()
PUT /10dlc/brand/{brandId}
Inspect the current state of an existing brand registration.
entityType
,
displayName
,
country
,
email
, +2 more
Delete Brand
client.messaging10dlc.brand.delete()
DELETE /10dlc/brand/{brandId}
Inspect the current state of an existing brand registration.
brandId
Resend brand 2FA email
client.messaging10dlc.brand.resend2faEmail()
POST /10dlc/brand/{brandId}/2faEmail
Create or provision an additional resource when the core tasks do not cover this flow.
brandId
List External Vettings
client.messaging10dlc.brand.externalVetting.list()
GET /10dlc/brand/{brandId}/externalVetting
Fetch the current state before updating, deleting, or making control-flow decisions.
brandId
Order Brand External Vetting
client.messaging10dlc.brand.externalVetting.order()
POST /10dlc/brand/{brandId}/externalVetting
Create or provision an additional resource when the core tasks do not cover this flow.
evpId
,
vettingClass
,
brandId
Import External Vetting Record
client.messaging10dlc.brand.externalVetting.imports()
PUT /10dlc/brand/{brandId}/externalVetting
Modify an existing resource without recreating it.
evpId
,
vettingId
,
brandId
Revet Brand
client.messaging10dlc.brand.revet()
PUT /10dlc/brand/{brandId}/revet
Modify an existing resource without recreating it.
brandId
Get Brand SMS OTP Status by Brand ID
client.messaging10dlc.brand.retrieveSMSOtpStatus()
GET /10dlc/brand/{brandId}/smsOtp
Fetch the current state before updating, deleting, or making control-flow decisions.
brandId
Trigger Brand SMS OTP
client.messaging10dlc.brand.triggerSMSOtp()
POST /10dlc/brand/{brandId}/smsOtp
Create or provision an additional resource when the core tasks do not cover this flow.
pinSms
,
successSms
,
brandId
Verify Brand SMS OTP
client.messaging10dlc.brand.verifySMSOtp()
PUT /10dlc/brand/{brandId}/smsOtp
Modify an existing resource without recreating it.
otpPin
,
brandId
List Campaigns
client.messaging10dlc.campaign.list()
GET /10dlc/campaign
Inspect available resources or choose an existing resource before mutating it.None
Accept Shared Campaign
client.messaging10dlc.campaign.acceptSharing()
POST /10dlc/campaign/acceptSharing/{campaignId}
Create or provision an additional resource when the core tasks do not cover this flow.
campaignId
Get Campaign Cost
client.messaging10dlc.campaign.usecase.getCost()
GET /10dlc/campaign/usecase/cost
Inspect available resources or choose an existing resource before mutating it.None
Update campaign
client.messaging10dlc.campaign.update()
PUT /10dlc/campaign/{campaignId}
Inspect the current state of an existing campaign registration.
campaignId
Deactivate campaign
client.messaging10dlc.campaign.deactivate()
DELETE /10dlc/campaign/{campaignId}
Inspect the current state of an existing campaign registration.
campaignId
Submit campaign appeal for manual review
client.messaging10dlc.campaign.submitAppeal()
POST /10dlc/campaign/{campaignId}/appeal
Create or provision an additional resource when the core tasks do not cover this flow.
appealReason
,
campaignId
Get Campaign Mno Metadata
client.messaging10dlc.campaign.getMnoMetadata()
GET /10dlc/campaign/{campaignId}/mnoMetadata
Fetch the current state before updating, deleting, or making control-flow decisions.
campaignId
Get campaign operation status
client.messaging10dlc.campaign.getOperationStatus()
GET /10dlc/campaign/{campaignId}/operationStatus
Fetch the current state before updating, deleting, or making control-flow decisions.
campaignId
Get OSR campaign attributes
client.messaging10dlc.campaign.osr.getAttributes()
GET /10dlc/campaign/{campaignId}/osr/attributes
Fetch the current state before updating, deleting, or making control-flow decisions.
campaignId
Get Sharing Status
client.messaging10dlc.campaign.getSharingStatus()
GET /10dlc/campaign/{campaignId}/sharing
Fetch the current state before updating, deleting, or making control-flow decisions.
campaignId
List shared partner campaigns
client.messaging10dlc.partnerCampaigns.listSharedByMe()
GET /10dlc/partnerCampaign/sharedByMe
Inspect available resources or choose an existing resource before mutating it.None
Get Sharing Status
client.messaging10dlc.partnerCampaigns.retrieveSharingStatus()
GET /10dlc/partnerCampaign/{campaignId}/sharing
Fetch the current state before updating, deleting, or making control-flow decisions.
campaignId
List Shared Campaigns
client.messaging10dlc.partnerCampaigns.list()
GET /10dlc/partner_campaigns
Inspect available resources or choose an existing resource before mutating it.None
Get Single Shared Campaign
client.messaging10dlc.partnerCampaigns.retrieve()
GET /10dlc/partner_campaigns/{campaignId}
Fetch the current state before updating, deleting, or making control-flow decisions.
campaignId
Update Single Shared Campaign
client.messaging10dlc.partnerCampaigns.update()
PATCH /10dlc/partner_campaigns/{campaignId}
Modify an existing resource without recreating it.
campaignId
Get Assignment Task Status
client.messaging10dlc.phoneNumberAssignmentByProfile.retrieveStatus()
GET /10dlc/phoneNumberAssignmentByProfile/{taskId}
Fetch the current state before updating, deleting, or making control-flow decisions.
taskId
Get Phone Number Status
client.messaging10dlc.phoneNumberAssignmentByProfile.listPhoneNumberStatus()
GET /10dlc/phoneNumberAssignmentByProfile/{taskId}/phoneNumbers
Fetch the current state before updating, deleting, or making control-flow decisions.
taskId
List phone number campaigns
client.messaging10dlc.phoneNumberCampaigns.list()
GET /10dlc/phone_number_campaigns
Inspect available resources or choose an existing resource before mutating it.None
Get Single Phone Number Campaign
client.messaging10dlc.phoneNumberCampaigns.retrieve()
GET /10dlc/phone_number_campaigns/{phoneNumber}
Fetch the current state before updating, deleting, or making control-flow decisions.
phoneNumber
Create New Phone Number Campaign
client.messaging10dlc.phoneNumberCampaigns.update()
PUT /10dlc/phone_number_campaigns/{phoneNumber}
Modify an existing resource without recreating it.
phoneNumber
,
campaignId
,
phoneNumber
Delete Phone Number Campaign
client.messaging10dlc.phoneNumberCampaigns.delete()
DELETE /10dlc/phone_number_campaigns/{phoneNumber}
Remove, detach, or clean up an existing resource.
phoneNumber

For exhaustive optional parameters, full response schemas, and complete webhook payloads, see references/api-details.md.
请优先使用上述核心任务。下方列出的操作已标注准确的SDK方法和必填参数;完整的可选参数、响应结构和低频webhook负载请参考references/api-details.md。 使用下方任意操作前,请先阅读可选参数章节响应结构章节,不要猜测缺失的字段。
操作SDK方法接口地址使用场景必填参数
获取品牌短信OTP状态
client.messaging10dlc.brand.getSMSOtpByReference()
GET /10dlc/brand/smsOtp/{referenceId}
在更新、删除或进行控制流决策前获取当前状态
referenceId
更新品牌
client.messaging10dlc.brand.update()
PUT /10dlc/brand/{brandId}
查看已存在的品牌注册的当前状态
entityType
,
displayName
,
country
,
email
, 另有2个必填参数
删除品牌
client.messaging10dlc.brand.delete()
DELETE /10dlc/brand/{brandId}
查看已存在的品牌注册的当前状态
brandId
重发品牌2FA邮件
client.messaging10dlc.brand.resend2faEmail()
POST /10dlc/brand/{brandId}/2faEmail
当核心任务未覆盖该流程时,创建或预配置额外资源
brandId
列出外部审核记录
client.messaging10dlc.brand.externalVetting.list()
GET /10dlc/brand/{brandId}/externalVetting
在更新、删除或进行控制流决策前获取当前状态
brandId
申请品牌外部审核
client.messaging10dlc.brand.externalVetting.order()
POST /10dlc/brand/{brandId}/externalVetting
当核心任务未覆盖该流程时,创建或预配置额外资源
evpId
,
vettingClass
,
brandId
导入外部审核记录
client.messaging10dlc.brand.externalVetting.imports()
PUT /10dlc/brand/{brandId}/externalVetting
修改现有资源无需重新创建
evpId
,
vettingId
,
brandId
重新审核品牌
client.messaging10dlc.brand.revet()
PUT /10dlc/brand/{brandId}/revet
修改现有资源无需重新创建
brandId
通过品牌ID获取品牌短信OTP状态
client.messaging10dlc.brand.retrieveSMSOtpStatus()
GET /10dlc/brand/{brandId}/smsOtp
在更新、删除或进行控制流决策前获取当前状态
brandId
触发品牌短信OTP
client.messaging10dlc.brand.triggerSMSOtp()
POST /10dlc/brand/{brandId}/smsOtp
当核心任务未覆盖该流程时,创建或预配置额外资源
pinSms
,
successSms
,
brandId
验证品牌短信OTP
client.messaging10dlc.brand.verifySMSOtp()
PUT /10dlc/brand/{brandId}/smsOtp
修改现有资源无需重新创建
otpPin
,
brandId
列出活动
client.messaging10dlc.campaign.list()
GET /10dlc/campaign
在修改资源前查看可用资源或选择已有资源
接受共享活动
client.messaging10dlc.campaign.acceptSharing()
POST /10dlc/campaign/acceptSharing/{campaignId}
当核心任务未覆盖该流程时,创建或预配置额外资源
campaignId
获取活动成本
client.messaging10dlc.campaign.usecase.getCost()
GET /10dlc/campaign/usecase/cost
在修改资源前查看可用资源或选择已有资源
更新活动
client.messaging10dlc.campaign.update()
PUT /10dlc/campaign/{campaignId}
查看已存在的活动注册的当前状态
campaignId
停用活动
client.messaging10dlc.campaign.deactivate()
DELETE /10dlc/campaign/{campaignId}
查看已存在的活动注册的当前状态
campaignId
提交活动申诉人工审核
client.messaging10dlc.campaign.submitAppeal()
POST /10dlc/campaign/{campaignId}/appeal
当核心任务未覆盖该流程时,创建或预配置额外资源
appealReason
,
campaignId
获取活动MNO元数据
client.messaging10dlc.campaign.getMnoMetadata()
GET /10dlc/campaign/{campaignId}/mnoMetadata
在更新、删除或进行控制流决策前获取当前状态
campaignId
获取活动操作状态
client.messaging10dlc.campaign.getOperationStatus()
GET /10dlc/campaign/{campaignId}/operationStatus
在更新、删除或进行控制流决策前获取当前状态
campaignId
获取OSR活动属性
client.messaging10dlc.campaign.osr.getAttributes()
GET /10dlc/campaign/{campaignId}/osr/attributes
在更新、删除或进行控制流决策前获取当前状态
campaignId
获取共享状态
client.messaging10dlc.campaign.getSharingStatus()
GET /10dlc/campaign/{campaignId}/sharing
在更新、删除或进行控制流决策前获取当前状态
campaignId
列出我共享的合作伙伴活动
client.messaging10dlc.partnerCampaigns.listSharedByMe()
GET /10dlc/partnerCampaign/sharedByMe
在修改资源前查看可用资源或选择已有资源
获取共享状态
client.messaging10dlc.partnerCampaigns.retrieveSharingStatus()
GET /10dlc/partnerCampaign/{campaignId}/sharing
在更新、删除或进行控制流决策前获取当前状态
campaignId
列出共享活动
client.messaging10dlc.partnerCampaigns.list()
GET /10dlc/partner_campaigns
在修改资源前查看可用资源或选择已有资源
获取单个共享活动
client.messaging10dlc.partnerCampaigns.retrieve()
GET /10dlc/partner_campaigns/{campaignId}
在更新、删除或进行控制流决策前获取当前状态
campaignId
更新单个共享活动
client.messaging10dlc.partnerCampaigns.update()
PATCH /10dlc/partner_campaigns/{campaignId}
修改现有资源无需重新创建
campaignId
获取分配任务状态
client.messaging10dlc.phoneNumberAssignmentByProfile.retrieveStatus()
GET /10dlc/phoneNumberAssignmentByProfile/{taskId}
在更新、删除或进行控制流决策前获取当前状态
taskId
获取电话号码状态
client.messaging10dlc.phoneNumberAssignmentByProfile.listPhoneNumberStatus()
GET /10dlc/phoneNumberAssignmentByProfile/{taskId}/phoneNumbers
在更新、删除或进行控制流决策前获取当前状态
taskId
列出电话号码活动关联
client.messaging10dlc.phoneNumberCampaigns.list()
GET /10dlc/phone_number_campaigns
在修改资源前查看可用资源或选择已有资源
获取单个电话号码活动关联
client.messaging10dlc.phoneNumberCampaigns.retrieve()
GET /10dlc/phone_number_campaigns/{phoneNumber}
在更新、删除或进行控制流决策前获取当前状态
phoneNumber
创建新的电话号码活动关联
client.messaging10dlc.phoneNumberCampaigns.update()
PUT /10dlc/phone_number_campaigns/{phoneNumber}
修改现有资源无需重新创建
phoneNumber
,
campaignId
,
phoneNumber
删除电话号码活动关联
client.messaging10dlc.phoneNumberCampaigns.delete()
DELETE /10dlc/phone_number_campaigns/{phoneNumber}
移除、解绑或清理现有资源
phoneNumber

如需完整的可选参数、全量响应结构和完整的webhook负载,请查看references/api-details.md