telnyx-10dlc-python
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese<!-- Auto-generated from Telnyx OpenAPI specs. Do not edit. -->
<!-- 由Telnyx OpenAPI规范自动生成,请勿编辑。 -->
Telnyx 10Dlc - Python
Telnyx 10Dlc - Python
Installation
安装
bash
pip install telnyxbash
pip install telnyxSetup
初始化
python
import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)All examples below assume is already initialized as shown above.
clientpython
import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # 这是默认值,可省略
)以下所有示例均假设已按上述方式初始化完成。
clientList Brands
列出品牌
This endpoint is used to list all brands associated with your organization.
GET /10dlc/brandpython
page = client.messaging_10dlc.brand.list()
page = page.records[0]
print(page.identity_status)该接口用于列出与您的组织关联的所有品牌。
GET /10dlc/brandpython
page = client.messaging_10dlc.brand.list()
page = page.records[0]
print(page.identity_status)Create Brand
创建品牌
This endpoint is used to create a new brand.
POST /10dlc/brandentityTypedisplayNamecountryemailverticalOptional: (string), (string), (string), (string), (string), (string), (boolean), (string), (string), (boolean), (string), (string), (string), (object), (string), (string), (string), (string), (string)
businessContactEmailcitycompanyNameeinfirstNameipAddressisResellerlastNamemobilePhonemockphonepostalCodestatestockExchangestockSymbolstreetwebhookFailoverURLwebhookURLwebsitepython
telnyx_brand = client.messaging_10dlc.brand.create(
country="US",
display_name="ABC Mobile",
email="email",
entity_type="PRIVATE_PROFIT",
vertical="TECHNOLOGY",
)
print(telnyx_brand.identity_status)该接口用于创建新品牌。
POST /10dlc/brandentityTypedisplayNamecountryemailvertical可选:(字符串), (字符串), (字符串), (字符串), (字符串), (字符串), (布尔值), (字符串), (字符串), (布尔值), (字符串), (字符串), (字符串), (对象), (字符串), (字符串), (字符串), (字符串), (字符串)
businessContactEmailcitycompanyNameeinfirstNameipAddressisResellerlastNamemobilePhonemockphonepostalCodestatestockExchangestockSymbolstreetwebhookFailoverURLwebhookURLwebsitepython
telnyx_brand = client.messaging_10dlc.brand.create(
country="US",
display_name="ABC Mobile",
email="email",
entity_type="PRIVATE_PROFIT",
vertical="TECHNOLOGY",
)
print(telnyx_brand.identity_status)Get Brand
获取品牌
Retrieve a brand by .
brandIdGET /10dlc/brand/{brandId}python
brand = client.messaging_10dlc.brand.retrieve(
"brandId",
)
print(brand)通过检索品牌信息。
brandIdGET /10dlc/brand/{brandId}python
brand = client.messaging_10dlc.brand.retrieve(
"brandId",
)
print(brand)Update Brand
更新品牌
Update a brand's attributes by .
brandIdPUT /10dlc/brand/{brandId}entityTypedisplayNamecountryemailverticalOptional: (string), (enum), (string), (string), (string), (string), (string), (enum), (string), (boolean), (string), (string), (string), (string), (object), (string), (string), (string), (string), (string)
altBusinessIdaltBusinessIdTypebusinessContactEmailcitycompanyNameeinfirstNameidentityStatusipAddressisResellerlastNamephonepostalCodestatestockExchangestockSymbolstreetwebhookFailoverURLwebhookURLwebsitepython
telnyx_brand = client.messaging_10dlc.brand.update(
brand_id="brandId",
country="US",
display_name="ABC Mobile",
email="email",
entity_type="PRIVATE_PROFIT",
vertical="TECHNOLOGY",
)
print(telnyx_brand.identity_status)通过更新品牌属性。
brandIdPUT /10dlc/brand/{brandId}entityTypedisplayNamecountryemailvertical可选:(字符串), (枚举), (字符串), (字符串), (字符串), (字符串), (字符串), (枚举), (字符串), (布尔值), (字符串), (字符串), (字符串), (字符串), (对象), (字符串), (字符串), (字符串), (字符串), (字符串)
altBusinessIdaltBusinessIdTypebusinessContactEmailcitycompanyNameeinfirstNameidentityStatusipAddressisResellerlastNamephonepostalCodestatestockExchangestockSymbolstreetwebhookFailoverURLwebhookURLwebsitepython
telnyx_brand = client.messaging_10dlc.brand.update(
brand_id="brandId",
country="US",
display_name="ABC Mobile",
email="email",
entity_type="PRIVATE_PROFIT",
vertical="TECHNOLOGY",
)
print(telnyx_brand.identity_status)Delete Brand
删除品牌
Delete Brand.
DELETE /10dlc/brand/{brandId}python
client.messaging_10dlc.brand.delete(
"brandId",
)删除品牌。
DELETE /10dlc/brand/{brandId}python
client.messaging_10dlc.brand.delete(
"brandId",
)Resend brand 2FA email
重新发送品牌2FA邮件
POST /10dlc/brand/{brandId}/2faEmailpython
client.messaging_10dlc.brand.resend_2fa_email(
"brandId",
)POST /10dlc/brand/{brandId}/2faEmailpython
client.messaging_10dlc.brand.resend_2fa_email(
"brandId",
)List External Vettings
列出外部审核记录
Get list of valid external vetting record for a given brand
GET /10dlc/brand/{brandId}/externalVettingpython
external_vettings = client.messaging_10dlc.brand.external_vetting.list(
"brandId",
)
print(external_vettings)获取指定品牌的有效外部审核记录列表
GET /10dlc/brand/{brandId}/externalVettingpython
external_vettings = client.messaging_10dlc.brand.external_vetting.list(
"brandId",
)
print(external_vettings)Order Brand External Vetting
订购品牌外部审核
Order new external vetting for a brand
POST /10dlc/brand/{brandId}/externalVettingevpIdvettingClasspython
response = client.messaging_10dlc.brand.external_vetting.order(
brand_id="brandId",
evp_id="evpId",
vetting_class="vettingClass",
)
print(response.create_date)为品牌订购新的外部审核
POST /10dlc/brand/{brandId}/externalVettingevpIdvettingClasspython
response = client.messaging_10dlc.brand.external_vetting.order(
brand_id="brandId",
evp_id="evpId",
vetting_class="vettingClass",
)
print(response.create_date)Import External Vetting Record
导入外部审核记录
This operation can be used to import an external vetting record from a TCR-approved
vetting provider.
PUT /10dlc/brand/{brandId}/externalVettingevpIdvettingIdOptional: (string)
vettingTokenpython
response = client.messaging_10dlc.brand.external_vetting.imports(
brand_id="brandId",
evp_id="evpId",
vetting_id="vettingId",
)
print(response.create_date)该操作可用于从TCR认证的审核提供商导入外部审核记录。
PUT /10dlc/brand/{brandId}/externalVettingevpIdvettingId可选:(字符串)
vettingTokenpython
response = client.messaging_10dlc.brand.external_vetting.imports(
brand_id="brandId",
evp_id="evpId",
vetting_id="vettingId",
)
print(response.create_date)Revet Brand
重新审核品牌
This operation allows you to revet the brand.
PUT /10dlc/brand/{brandId}/revetpython
telnyx_brand = client.messaging_10dlc.brand.revet(
"brandId",
)
print(telnyx_brand.identity_status)该操作允许您重新审核品牌。
PUT /10dlc/brand/{brandId}/revetpython
telnyx_brand = client.messaging_10dlc.brand.revet(
"brandId",
)
print(telnyx_brand.identity_status)Get Brand SMS OTP Status by Brand ID
通过品牌ID获取品牌短信OTP状态
Query the status of an SMS OTP (One-Time Password) for Sole Proprietor brand verification using the Brand ID.
GET /10dlc/brand/{brandId}/smsOtppython
response = client.messaging_10dlc.brand.retrieve_sms_otp_status(
"4b20019b-043a-78f8-0657-b3be3f4b4002",
)
print(response.brand_id)使用品牌ID查询个体经营者品牌验证的短信OTP(一次性密码)状态。
GET /10dlc/brand/{brandId}/smsOtppython
response = client.messaging_10dlc.brand.retrieve_sms_otp_status(
"4b20019b-043a-78f8-0657-b3be3f4b4002",
)
print(response.brand_id)Trigger Brand SMS OTP
触发品牌短信OTP
Trigger or re-trigger an SMS OTP (One-Time Password) for Sole Proprietor brand verification.
POST /10dlc/brand/{brandId}/smsOtppinSmssuccessSmspython
response = client.messaging_10dlc.brand.trigger_sms_otp(
brand_id="4b20019b-043a-78f8-0657-b3be3f4b4002",
pin_sms="Your PIN is @OTP_PIN@",
success_sms="Verification successful!",
)
print(response.brand_id)触发或重新触发个体经营者品牌验证的短信OTP(一次性密码)。
POST /10dlc/brand/{brandId}/smsOtppinSmssuccessSmspython
response = client.messaging_10dlc.brand.trigger_sms_otp(
brand_id="4b20019b-043a-78f8-0657-b3be3f4b4002",
pin_sms="Your PIN is @OTP_PIN@",
success_sms="Verification successful!",
)
print(response.brand_id)Verify Brand SMS OTP
验证品牌短信OTP
Verify the SMS OTP (One-Time Password) for Sole Proprietor brand verification.
PUT /10dlc/brand/{brandId}/smsOtpotpPinpython
client.messaging_10dlc.brand.verify_sms_otp(
brand_id="4b20019b-043a-78f8-0657-b3be3f4b4002",
otp_pin="123456",
)验证个体经营者品牌验证的短信OTP(一次性密码)。
PUT /10dlc/brand/{brandId}/smsOtpotpPinpython
client.messaging_10dlc.brand.verify_sms_otp(
brand_id="4b20019b-043a-78f8-0657-b3be3f4b4002",
otp_pin="123456",
)Get Brand SMS OTP Status
获取品牌短信OTP状态
Query the status of an SMS OTP (One-Time Password) for Sole Proprietor brand verification.
GET /10dlc/brand/smsOtp/{referenceId}python
response = client.messaging_10dlc.brand.get_sms_otp_by_reference(
reference_id="OTP4B2001",
)
print(response.brand_id)查询个体经营者品牌验证的短信OTP(一次性密码)状态。
GET /10dlc/brand/smsOtp/{referenceId}python
response = client.messaging_10dlc.brand.get_sms_otp_by_reference(
reference_id="OTP4B2001",
)
print(response.brand_id)Get Brand Feedback By Id
通过ID获取品牌反馈
Get feedback about a brand by ID.
GET /10dlc/brand_feedback/{brandId}python
response = client.messaging_10dlc.brand.get_feedback(
"brandId",
)
print(response.brand_id)通过ID获取品牌相关反馈。
GET /10dlc/brand_feedback/{brandId}python
response = client.messaging_10dlc.brand.get_feedback(
"brandId",
)
print(response.brand_id)Submit Campaign
提交活动
Before creating a campaign, use the Qualify By Usecase endpoint to ensure that the brand you want to assign a new campaign...
POST /10dlc/campaignBuilderbrandIddescriptionusecaseOptional: (boolean), (boolean), (boolean), (boolean), (string), (boolean), (string), (string), (string), (array[integer]), (boolean), (string), (string), (string), (string), (string), (string), (string), (string), (string), (string), (string), (string), (array[string]), (boolean), (boolean), (boolean), (array[string]), (boolean), (string), (string), (string)
ageGatedautoRenewaldirectLendingembeddedLinkembeddedLinkSampleembeddedPhonehelpKeywordshelpMessagemessageFlowmnoIdsnumberPooloptinKeywordsoptinMessageoptoutKeywordsoptoutMessageprivacyPolicyLinkreferenceIdresellerIdsample1sample2sample3sample4sample5subUsecasessubscriberHelpsubscriberOptinsubscriberOptouttagtermsAndConditionstermsAndConditionsLinkwebhookFailoverURLwebhookURLpython
telnyx_campaign_csp = client.messaging_10dlc.campaign_builder.submit(
brand_id="brandId",
description="description",
usecase="usecase",
)
print(telnyx_campaign_csp.brand_id)创建活动前,请使用按用例资格验证接口确保您要分配新活动的品牌...
POST /10dlc/campaignBuilderbrandIddescriptionusecase可选:(布尔值), (布尔值), (布尔值), (布尔值), (字符串), (布尔值), (字符串), (字符串), (字符串), (整数数组), (布尔值), (字符串), (字符串), (字符串), (字符串), (字符串), (字符串), (字符串), (字符串), (字符串), (字符串), (字符串), (字符串), (字符串数组), (布尔值), (布尔值), (布尔值), (字符串数组), (布尔值), (字符串), (字符串), (字符串)
ageGatedautoRenewaldirectLendingembeddedLinkembeddedLinkSampleembeddedPhonehelpKeywordshelpMessagemessageFlowmnoIdsnumberPooloptinKeywordsoptinMessageoptoutKeywordsoptoutMessageprivacyPolicyLinkreferenceIdresellerIdsample1sample2sample3sample4sample5subUsecasessubscriberHelpsubscriberOptinsubscriberOptouttagtermsAndConditionstermsAndConditionsLinkwebhookFailoverURLwebhookURLpython
telnyx_campaign_csp = client.messaging_10dlc.campaign_builder.submit(
brand_id="brandId",
description="description",
usecase="usecase",
)
print(telnyx_campaign_csp.brand_id)Qualify By Usecase
按用例资格验证
This endpoint allows you to see whether or not the supplied brand is suitable for your desired campaign use case.
GET /10dlc/campaignBuilder/brand/{brandId}/usecase/{usecase}python
response = client.messaging_10dlc.campaign_builder.brand.qualify_by_usecase(
usecase="usecase",
brand_id="brandId",
)
print(response.annual_fee)该接口可让您查看提供的品牌是否适合您所需的活动用例。
GET /10dlc/campaignBuilder/brand/{brandId}/usecase/{usecase}python
response = client.messaging_10dlc.campaign_builder.brand.qualify_by_usecase(
usecase="usecase",
brand_id="brandId",
)
print(response.annual_fee)List Campaigns
列出活动
Retrieve a list of campaigns associated with a supplied .
brandIdGET /10dlc/campaignpython
page = client.messaging_10dlc.campaign.list(
brand_id="brandId",
)
page = page.records[0]
print(page.age_gated)检索与指定关联的活动列表。
brandIdGET /10dlc/campaignpython
page = client.messaging_10dlc.campaign.list(
brand_id="brandId",
)
page = page.records[0]
print(page.age_gated)Get campaign
获取活动详情
Retrieve campaign details by .
campaignIdGET /10dlc/campaign/{campaignId}python
telnyx_campaign_csp = client.messaging_10dlc.campaign.retrieve(
"campaignId",
)
print(telnyx_campaign_csp.brand_id)通过检索活动详情。
campaignIdGET /10dlc/campaign/{campaignId}python
telnyx_campaign_csp = client.messaging_10dlc.campaign.retrieve(
"campaignId",
)
print(telnyx_campaign_csp.brand_id)Update campaign
更新活动
Update a campaign's properties by .
campaignIdPUT /10dlc/campaign/{campaignId}Optional: (boolean), (string), (string), (string), (string), (string), (string), (string), (string), (string), (string)
autoRenewalhelpMessagemessageFlowresellerIdsample1sample2sample3sample4sample5webhookFailoverURLwebhookURLpython
telnyx_campaign_csp = client.messaging_10dlc.campaign.update(
campaign_id="campaignId",
)
print(telnyx_campaign_csp.brand_id)通过更新活动属性。
campaignIdPUT /10dlc/campaign/{campaignId}可选:(布尔值), (字符串), (字符串), (字符串), (字符串), (字符串), (字符串), (字符串), (字符串), (字符串), (字符串)
autoRenewalhelpMessagemessageFlowresellerIdsample1sample2sample3sample4sample5webhookFailoverURLwebhookURLpython
telnyx_campaign_csp = client.messaging_10dlc.campaign.update(
campaign_id="campaignId",
)
print(telnyx_campaign_csp.brand_id)Deactivate campaign
停用活动
Terminate a campaign.
DELETE /10dlc/campaign/{campaignId}python
response = client.messaging_10dlc.campaign.deactivate(
"campaignId",
)
print(response.time)终止活动。
DELETE /10dlc/campaign/{campaignId}python
response = client.messaging_10dlc.campaign.deactivate(
"campaignId",
)
print(response.time)Submit campaign appeal for manual review
提交活动申诉以进行人工审核
Submits an appeal for rejected native campaigns in TELNYX_FAILED or MNO_REJECTED status.
POST /10dlc/campaign/{campaignId}/appealappeal_reasonpython
response = client.messaging_10dlc.campaign.submit_appeal(
campaign_id="5eb13888-32b7-4cab-95e6-d834dde21d64",
appeal_reason="The website has been updated to include the required privacy policy and terms of service.",
)
print(response.appealed_at)针对状态为TELNYX_FAILED或MNO_REJECTED的未通过本地活动提交申诉。
POST /10dlc/campaign/{campaignId}/appealappeal_reasonpython
response = client.messaging_10dlc.campaign.submit_appeal(
campaign_id="5eb13888-32b7-4cab-95e6-d834dde21d64",
appeal_reason="The website has been updated to include the required privacy policy and terms of service.",
)
print(response.appealed_at)Get Campaign Mno Metadata
获取活动MNO元数据
Get the campaign metadata for each MNO it was submitted to.
GET /10dlc/campaign/{campaignId}/mnoMetadatapython
response = client.messaging_10dlc.campaign.get_mno_metadata(
"campaignId",
)
print(response._10999)获取活动提交给各MNO的元数据。
GET /10dlc/campaign/{campaignId}/mnoMetadatapython
response = client.messaging_10dlc.campaign.get_mno_metadata(
"campaignId",
)
print(response._10999)Get campaign operation status
获取活动操作状态
Retrieve campaign's operation status at MNO level.
GET /10dlc/campaign/{campaignId}/operationStatuspython
response = client.messaging_10dlc.campaign.get_operation_status(
"campaignId",
)
print(response)检索活动在MNO层面的操作状态。
GET /10dlc/campaign/{campaignId}/operationStatuspython
response = client.messaging_10dlc.campaign.get_operation_status(
"campaignId",
)
print(response)Get OSR campaign attributes
获取OSR活动属性
GET /10dlc/campaign/{campaignId}/osr_attributespython
response = client.messaging_10dlc.campaign.osr.get_attributes(
"campaignId",
)
print(response)GET /10dlc/campaign/{campaignId}/osr_attributespython
response = client.messaging_10dlc.campaign.osr.get_attributes(
"campaignId",
)
print(response)Get Sharing Status
获取共享状态
GET /10dlc/campaign/{campaignId}/sharingpython
response = client.messaging_10dlc.campaign.get_sharing_status(
"campaignId",
)
print(response.shared_by_me)GET /10dlc/campaign/{campaignId}/sharingpython
response = client.messaging_10dlc.campaign.get_sharing_status(
"campaignId",
)
print(response.shared_by_me)Accept Shared Campaign
接受共享活动
Manually accept a campaign shared with Telnyx
POST /10dlc/campaign/acceptSharing/{campaignId}python
response = client.messaging_10dlc.campaign.accept_sharing(
"C26F1KLZN",
)
print(response)手动接受与Telnyx共享的活动
POST /10dlc/campaign/acceptSharing/{campaignId}python
response = client.messaging_10dlc.campaign.accept_sharing(
"C26F1KLZN",
)
print(response)Get Campaign Cost
获取活动成本
GET /10dlc/campaign/usecase_costpython
response = client.messaging_10dlc.campaign.usecase.get_cost(
usecase="usecase",
)
print(response.campaign_usecase)GET /10dlc/campaign/usecase_costpython
response = client.messaging_10dlc.campaign.usecase.get_cost(
usecase="usecase",
)
print(response.campaign_usecase)List Shared Campaigns
列出共享活动
Retrieve all partner campaigns you have shared to Telnyx in a paginated fashion.
GET /10dlc/partner_campaignspython
page = client.messaging_10dlc.partner_campaigns.list()
page = page.records[0]
print(page.tcr_brand_id)以分页方式检索您共享给Telnyx的所有合作伙伴活动。
GET /10dlc/partner_campaignspython
page = client.messaging_10dlc.partner_campaigns.list()
page = page.records[0]
print(page.tcr_brand_id)Get Single Shared Campaign
获取单个共享活动
Retrieve campaign details by .
campaignIdGET /10dlc/partner_campaigns/{campaignId}python
telnyx_downstream_campaign = client.messaging_10dlc.partner_campaigns.retrieve(
"campaignId",
)
print(telnyx_downstream_campaign.tcr_brand_id)通过检索活动详情。
campaignIdGET /10dlc/partner_campaigns/{campaignId}python
telnyx_downstream_campaign = client.messaging_10dlc.partner_campaigns.retrieve(
"campaignId",
)
print(telnyx_downstream_campaign.tcr_brand_id)Update Single Shared Campaign
更新单个共享活动
Update campaign details by .
campaignIdPATCH /10dlc/partner_campaigns/{campaignId}Optional: (string), (string)
webhookFailoverURLwebhookURLpython
telnyx_downstream_campaign = client.messaging_10dlc.partner_campaigns.update(
campaign_id="campaignId",
)
print(telnyx_downstream_campaign.tcr_brand_id)通过更新活动详情。
campaignIdPATCH /10dlc/partner_campaigns/{campaignId}可选:(字符串), (字符串)
webhookFailoverURLwebhookURLpython
telnyx_downstream_campaign = client.messaging_10dlc.partner_campaigns.update(
campaign_id="campaignId",
)
print(telnyx_downstream_campaign.tcr_brand_id)Get Sharing Status
获取共享状态
GET /10dlc/partnerCampaign/{campaignId}/sharingpython
response = client.messaging_10dlc.partner_campaigns.retrieve_sharing_status(
"campaignId",
)
print(response)GET /10dlc/partnerCampaign/{campaignId}/sharingpython
response = client.messaging_10dlc.partner_campaigns.retrieve_sharing_status(
"campaignId",
)
print(response)List shared partner campaigns
列出共享的合作伙伴活动
Get all partner campaigns you have shared to Telnyx in a paginated fashion
This endpoint is currently limited to only returning shared campaigns that Telnyx
has accepted.
GET /10dlc/partnerCampaign/sharedByMepython
page = client.messaging_10dlc.partner_campaigns.list_shared_by_me()
page = page.records[0]
print(page.brand_id)以分页方式获取您共享给Telnyx的所有合作伙伴活动
目前该接口仅返回Telnyx已接受的共享活动。
GET /10dlc/partnerCampaign/sharedByMepython
page = client.messaging_10dlc.partner_campaigns.list_shared_by_me()
page = page.records[0]
print(page.brand_id)List phone number campaigns
列出电话号码活动关联
GET /10dlc/phone_number_campaignspython
page = client.messaging_10dlc.phone_number_campaigns.list()
page = page.records[0]
print(page.campaign_id)GET /10dlc/phone_number_campaignspython
page = client.messaging_10dlc.phone_number_campaigns.list()
page = page.records[0]
print(page.campaign_id)Create New Phone Number Campaign
创建新的电话号码活动关联
POST /10dlc/phone_number_campaignsphoneNumbercampaignIdpython
phone_number_campaign = client.messaging_10dlc.phone_number_campaigns.create(
campaign_id="4b300178-131c-d902-d54e-72d90ba1620j",
phone_number="+18005550199",
)
print(phone_number_campaign.campaign_id)POST /10dlc/phone_number_campaignsphoneNumbercampaignIdpython
phone_number_campaign = client.messaging_10dlc.phone_number_campaigns.create(
campaign_id="4b300178-131c-d902-d54e-72d90ba1620j",
phone_number="+18005550199",
)
print(phone_number_campaign.campaign_id)Get Single Phone Number Campaign
获取单个电话号码活动关联
Retrieve an individual phone number/campaign assignment by .
phoneNumberGET /10dlc/phone_number_campaigns/{phoneNumber}python
phone_number_campaign = client.messaging_10dlc.phone_number_campaigns.retrieve(
"phoneNumber",
)
print(phone_number_campaign.campaign_id)通过检索单个电话号码/活动关联信息。
phoneNumberGET /10dlc/phone_number_campaigns/{phoneNumber}python
phone_number_campaign = client.messaging_10dlc.phone_number_campaigns.retrieve(
"phoneNumber",
)
print(phone_number_campaign.campaign_id)Create New Phone Number Campaign
更新电话号码活动关联
PUT /10dlc/phone_number_campaigns/{phoneNumber}phoneNumbercampaignIdpython
phone_number_campaign = client.messaging_10dlc.phone_number_campaigns.update(
campaign_phone_number="phoneNumber",
campaign_id="4b300178-131c-d902-d54e-72d90ba1620j",
phone_number="+18005550199",
)
print(phone_number_campaign.campaign_id)PUT /10dlc/phone_number_campaigns/{phoneNumber}phoneNumbercampaignIdpython
phone_number_campaign = client.messaging_10dlc.phone_number_campaigns.update(
campaign_phone_number="phoneNumber",
campaign_id="4b300178-131c-d902-d54e-72d90ba1620j",
phone_number="+18005550199",
)
print(phone_number_campaign.campaign_id)Delete Phone Number Campaign
删除电话号码活动关联
This endpoint allows you to remove a campaign assignment from the supplied .
phoneNumberDELETE /10dlc/phone_number_campaigns/{phoneNumber}python
phone_number_campaign = client.messaging_10dlc.phone_number_campaigns.delete(
"phoneNumber",
)
print(phone_number_campaign.campaign_id)该接口允许您移除指定的活动关联。
phoneNumberDELETE /10dlc/phone_number_campaigns/{phoneNumber}python
phone_number_campaign = client.messaging_10dlc.phone_number_campaigns.delete(
"phoneNumber",
)
print(phone_number_campaign.campaign_id)Assign Messaging Profile To Campaign
将消息配置文件关联到活动
This endpoint allows you to link all phone numbers associated with a Messaging Profile to a campaign.
POST /10dlc/phoneNumberAssignmentByProfilemessagingProfileIdOptional: (string), (string)
campaignIdtcrCampaignIdpython
response = client.messaging_10dlc.phone_number_assignment_by_profile.assign(
messaging_profile_id="4001767e-ce0f-4cae-9d5f-0d5e636e7809",
)
print(response.messaging_profile_id)该接口允许您将消息配置文件关联的所有电话号码链接到某个活动。
POST /10dlc/phoneNumberAssignmentByProfilemessagingProfileId可选:(字符串), (字符串)
campaignIdtcrCampaignIdpython
response = client.messaging_10dlc.phone_number_assignment_by_profile.assign(
messaging_profile_id="4001767e-ce0f-4cae-9d5f-0d5e636e7809",
)
print(response.messaging_profile_id)Get Assignment Task Status
获取关联任务状态
Check the status of the task associated with assigning all phone numbers on a messaging profile to a campaign by .
taskIdGET /10dlc/phoneNumberAssignmentByProfile/{taskId}python
response = client.messaging_10dlc.phone_number_assignment_by_profile.retrieve_status(
"taskId",
)
print(response.status)通过检查将消息配置文件下所有电话号码分配到活动的任务状态。
taskIdGET /10dlc/phoneNumberAssignmentByProfile/{taskId}python
response = client.messaging_10dlc.phone_number_assignment_by_profile.retrieve_status(
"taskId",
)
print(response.status)Get Phone Number Status
获取电话号码状态
Check the status of the individual phone number/campaign assignments associated with the supplied .
taskIdGET /10dlc/phoneNumberAssignmentByProfile/{taskId}/phoneNumberspython
response = client.messaging_10dlc.phone_number_assignment_by_profile.list_phone_number_status(
task_id="taskId",
)
print(response.records)检查与指定关联的单个电话号码/活动分配的状态。
taskIdGET /10dlc/phoneNumberAssignmentByProfile/{taskId}/phoneNumberspython
response = client.messaging_10dlc.phone_number_assignment_by_profile.list_phone_number_status(
task_id="taskId",
)
print(response.records)Webhooks
Webhooks
The following webhook events are sent to your configured webhook URL.
All webhooks include and headers for verification (Standard Webhooks compatible).
telnyx-timestamptelnyx-signature-ed25519| Event | Description |
|---|---|
| Campaign Status Update |
以下Webhook事件将发送到您配置的Webhook URL。
所有Webhook均包含和头信息用于验证(兼容标准Webhooks)。
telnyx-timestamptelnyx-signature-ed25519| 事件 | 描述 |
|---|---|
| 活动状态更新 |
Webhook payload fields
Webhook 负载字段
campaignStatusUpdate| Field | Type | Description |
|---|---|---|
| string | Brand ID associated with the campaign. |
| string | The ID of the campaign. |
| string | Unix timestamp when campaign was created. |
| string | Alphanumeric identifier of the CSP associated with this campaign. |
| boolean | Indicates whether the campaign is registered with T-Mobile. |
| enum | |
| string | Description of the event. |
| enum | The status of the campaign. |
campaignStatusUpdate| 字段 | 类型 | 描述 |
|---|---|---|
| 字符串 | 与活动关联的品牌ID。 |
| 字符串 | 活动的ID。 |
| 字符串 | 活动创建时的Unix时间戳。 |
| 字符串 | 与该活动关联的CSP的字母数字标识符。 |
| 布尔值 | 表示活动是否已在T-Mobile注册。 |
| 枚举 | |
| 字符串 | 事件的描述。 |
| 枚举 | 活动的状态。 |