telnyx-numbers-python

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
<!-- Auto-generated from Telnyx OpenAPI specs. Do not edit. -->
<!-- Auto-generated from Telnyx OpenAPI specs. Do not edit. -->

Telnyx Numbers - Python

Telnyx 号码管理 - Python

Installation

安装

bash
pip install telnyx
bash
pip install telnyx

Setup

初始化配置

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
client
is already initialized as shown above.
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
)
以下所有示例都假设
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:
python
import telnyx

try:
    available_phone_numbers = client.available_phone_numbers.list()
except telnyx.APIConnectionError:
    print("Network error — check connectivity and retry")
except telnyx.RateLimitError:
    import time
    time.sleep(1)  # Check Retry-After header for actual delay
except telnyx.APIStatusError as e:
    print(f"API error {e.status_code}: {e.message}")
    if e.status_code == 422:
        print("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),生产环境代码请务必做好错误处理:
python
import telnyx

try:
    available_phone_numbers = client.available_phone_numbers.list()
except telnyx.APIConnectionError:
    print("Network error — check connectivity and retry")
except telnyx.RateLimitError:
    import time
    time.sleep(1)  # Check Retry-After header for actual delay
except telnyx.APIStatusError as e:
    print(f"API error {e.status_code}: {e.message}")
    if e.status_code == 422:
        print("Validation error — check required fields and formats")
常见错误码:
401
API密钥无效,
403
权限不足,
404
资源不存在,
422
验证错误(请检查字段格式),
429
触发速率限制(请使用指数退避策略重试)。

Important Notes

重要说明

  • Phone numbers must be in E.164 format (e.g.,
    +13125550001
    ). Include the
    +
    prefix and country code. No spaces, dashes, or parentheses.
  • Pagination: List methods return an auto-paginating iterator. Use
    for item in page_result:
    to iterate through all pages automatically.
  • 电话号码必须采用E.164格式(例如
    +13125550001
    ),需要包含
    +
    前缀和国家码,不得包含空格、短横线或括号。
  • 分页: 列表方法返回支持自动分页的迭代器,可使用
    for item in page_result:
    自动遍历所有分页结果。

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.
请勿自行编造Telnyx的参数、枚举值、响应字段或Webhook字段。
  • 如果你需要的参数、枚举或响应字段未在本技能文档中展示,请在编写代码前阅读references/api-details.md
  • 使用
    ## 附加操作
    中的任意接口前,请先阅读可选参数章节响应结构章节

Core Tasks

核心任务

Search available phone numbers

搜索可用电话号码

Number search is the entrypoint for provisioning. Agents need the search method, key query filters, and the fields returned for candidate numbers.
client.available_phone_numbers.list()
GET /available_phone_numbers
ParameterTypeRequiredDescription
filter
objectNoConsolidated filter parameter (deepObject style).
python
available_phone_numbers = client.available_phone_numbers.list()
print(available_phone_numbers.data)
Response wrapper:
  • items:
    available_phone_numbers.data
  • pagination:
    available_phone_numbers.meta
Primary item fields:
  • phone_number
  • record_type
  • quickship
  • reservable
  • best_effort
  • cost_information
号码搜索是号码开通的入口,Agent需要掌握搜索方法、关键查询筛选条件以及候选号码的返回字段。
client.available_phone_numbers.list()
GET /available_phone_numbers
参数类型必填描述
filter
object统一筛选参数(deepObject风格)。
python
available_phone_numbers = client.available_phone_numbers.list()
print(available_phone_numbers.data)
响应封装:
  • 数据项:
    available_phone_numbers.data
  • 分页信息:
    available_phone_numbers.meta
主要数据字段:
  • phone_number
  • record_type
  • quickship
  • reservable
  • best_effort
  • cost_information

Create a number order

创建号码订单

Number ordering is the production provisioning step after number selection.
client.number_orders.create()
POST /number_orders
ParameterTypeRequiredDescription
phone_numbers
array[object]Yes
connection_id
string (UUID)NoIdentifies the connection associated with this phone number.
messaging_profile_id
string (UUID)NoIdentifies the messaging profile associated with the phone n...
billing_group_id
string (UUID)NoIdentifies the billing group associated with the phone numbe...
...+1 optional params in references/api-details.md
python
number_order = client.number_orders.create(
    phone_numbers=[{"phone_number": "+18005550101"}],
)
print(number_order.data)
Primary response fields:
  • number_order.data.id
  • number_order.data.status
  • number_order.data.phone_numbers_count
  • number_order.data.requirements_met
  • number_order.data.messaging_profile_id
  • number_order.data.connection_id
号码订购是选号完成后的生产环境开通步骤。
client.number_orders.create()
POST /number_orders
参数类型必填描述
phone_numbers
array[object]
connection_id
string (UUID)标识与该电话号码关联的连接。
messaging_profile_id
string (UUID)标识与该电话号码关联的短信配置文件。
billing_group_id
string (UUID)标识与该电话号码关联的账单组。
...更多可选参数见references/api-details.md
python
number_order = client.number_orders.create(
    phone_numbers=[{"phone_number": "+18005550101"}],
)
print(number_order.data)
主要响应字段:
  • number_order.data.id
  • number_order.data.status
  • number_order.data.phone_numbers_count
  • number_order.data.requirements_met
  • number_order.data.messaging_profile_id
  • number_order.data.connection_id

Check number order status

查询号码订单状态

Order status determines whether provisioning completed or additional requirements are still blocking fulfillment.
client.number_orders.retrieve()
GET /number_orders/{number_order_id}
ParameterTypeRequiredDescription
number_order_id
string (UUID)YesThe number order ID.
python
number_order = client.number_orders.retrieve(
    "number_order_id",
)
print(number_order.data)
Primary response fields:
  • number_order.data.id
  • number_order.data.status
  • number_order.data.requirements_met
  • number_order.data.phone_numbers_count
  • number_order.data.phone_numbers
  • number_order.data.connection_id

订单状态用于判断开通是否完成,或者是否有额外要求阻碍交付。
client.number_orders.retrieve()
GET /number_orders/{number_order_id}
参数类型必填描述
number_order_id
string (UUID)号码订单ID。
python
number_order = client.number_orders.retrieve(
    "number_order_id",
)
print(number_order.data)
主要响应字段:
  • number_order.data.id
  • number_order.data.status
  • number_order.data.requirements_met
  • number_order.data.phone_numbers_count
  • number_order.data.phone_numbers
  • number_order.data.connection_id

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.
当上述核心任务接近你的业务流程,但你需要常见的变体操作或后续步骤时,可以使用以下接口。

Create a number reservation

创建号码预留

Create or provision an additional resource when the core tasks do not cover this flow.
client.number_reservations.create()
POST /number_reservations
ParameterTypeRequiredDescription
phone_numbers
array[object]Yes
status
enum (pending, success, failure)NoThe status of the entire reservation.
id
string (UUID)No
record_type
stringNo
...+3 optional params in references/api-details.md
python
number_reservation = client.number_reservations.create(
    phone_numbers=[{"phone_number": "+18005550101"}],
)
print(number_reservation.data)
Primary response fields:
  • number_reservation.data.id
  • number_reservation.data.status
  • number_reservation.data.created_at
  • number_reservation.data.updated_at
  • number_reservation.data.customer_reference
  • number_reservation.data.errors
当核心任务未覆盖该流程时,用于创建或开通额外资源。
client.number_reservations.create()
POST /number_reservations
参数类型必填描述
phone_numbers
array[object]
status
enum (pending, success, failure)整个预留请求的状态。
id
string (UUID)
record_type
string
...更多3个可选参数见references/api-details.md
python
number_reservation = client.number_reservations.create(
    phone_numbers=[{"phone_number": "+18005550101"}],
)
print(number_reservation.data)
主要响应字段:
  • number_reservation.data.id
  • number_reservation.data.status
  • number_reservation.data.created_at
  • number_reservation.data.updated_at
  • number_reservation.data.customer_reference
  • number_reservation.data.errors

Retrieve a number reservation

查询号码预留信息

Fetch the current state before updating, deleting, or making control-flow decisions.
client.number_reservations.retrieve()
GET /number_reservations/{number_reservation_id}
ParameterTypeRequiredDescription
number_reservation_id
string (UUID)YesThe number reservation ID.
python
number_reservation = client.number_reservations.retrieve(
    "number_reservation_id",
)
print(number_reservation.data)
Primary response fields:
  • number_reservation.data.id
  • number_reservation.data.status
  • number_reservation.data.created_at
  • number_reservation.data.updated_at
  • number_reservation.data.customer_reference
  • number_reservation.data.errors
在更新、删除或做流程控制决策前获取当前状态。
client.number_reservations.retrieve()
GET /number_reservations/{number_reservation_id}
参数类型必填描述
number_reservation_id
string (UUID)号码预留ID。
python
number_reservation = client.number_reservations.retrieve(
    "number_reservation_id",
)
print(number_reservation.data)
主要响应字段:
  • number_reservation.data.id
  • number_reservation.data.status
  • number_reservation.data.created_at
  • number_reservation.data.updated_at
  • number_reservation.data.customer_reference
  • number_reservation.data.errors

List Advanced Orders

列出高级订单

Inspect available resources or choose an existing resource before mutating it.
client.advanced_orders.list()
GET /advanced_orders
python
advanced_orders = client.advanced_orders.list()
print(advanced_orders.data)
Response wrapper:
  • items:
    advanced_orders.data
Primary item fields:
  • id
  • status
  • area_code
  • comments
  • country_code
  • customer_reference
在修改资源前查看可用资源或选择已有资源。
client.advanced_orders.list()
GET /advanced_orders
python
advanced_orders = client.advanced_orders.list()
print(advanced_orders.data)
响应封装:
  • 数据项:
    advanced_orders.data
主要数据字段:
  • id
  • status
  • area_code
  • comments
  • country_code
  • customer_reference

Create Advanced Order

创建高级订单

Create or provision an additional resource when the core tasks do not cover this flow.
client.advanced_orders.create()
POST /advanced_orders
ParameterTypeRequiredDescription
phone_number_type
enum (local, mobile, toll_free, shared_cost, national, ...)No
requirement_group_id
string (UUID)NoThe ID of the requirement group to associate with this advan...
country_code
string (ISO 3166-1 alpha-2)No
...+5 optional params in references/api-details.md
python
advanced_order = client.advanced_orders.create()
print(advanced_order.id)
Primary response fields:
  • advanced_order.id
  • advanced_order.status
  • advanced_order.area_code
  • advanced_order.comments
  • advanced_order.country_code
  • advanced_order.customer_reference
当核心任务未覆盖该流程时,用于创建或开通额外资源。
client.advanced_orders.create()
POST /advanced_orders
参数类型必填描述
phone_number_type
enum (local, mobile, toll_free, shared_cost, national, ...)
requirement_group_id
string (UUID)与该高级订单关联的要求组ID。
country_code
string (ISO 3166-1 alpha-2)
...更多5个可选参数见references/api-details.md
python
advanced_order = client.advanced_orders.create()
print(advanced_order.id)
主要响应字段:
  • advanced_order.id
  • advanced_order.status
  • advanced_order.area_code
  • advanced_order.comments
  • advanced_order.country_code
  • advanced_order.customer_reference

Update Advanced Order

更新高级订单

Modify an existing resource without recreating it.
client.advanced_orders.update_requirement_group()
PATCH /advanced_orders/{advanced-order-id}/requirement_group
ParameterTypeRequiredDescription
advanced-order-id
string (UUID)Yes
phone_number_type
enum (local, mobile, toll_free, shared_cost, national, ...)No
requirement_group_id
string (UUID)NoThe ID of the requirement group to associate with this advan...
country_code
string (ISO 3166-1 alpha-2)No
...+5 optional params in references/api-details.md
python
response = client.advanced_orders.update_requirement_group(
    advanced_order_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(response.id)
Primary response fields:
  • response.id
  • response.status
  • response.area_code
  • response.comments
  • response.country_code
  • response.customer_reference
修改已有资源无需重新创建。
client.advanced_orders.update_requirement_group()
PATCH /advanced_orders/{advanced-order-id}/requirement_group
参数类型必填描述
advanced-order-id
string (UUID)
phone_number_type
enum (local, mobile, toll_free, shared_cost, national, ...)
requirement_group_id
string (UUID)与该高级订单关联的要求组ID。
country_code
string (ISO 3166-1 alpha-2)
...更多5个可选参数见references/api-details.md
python
response = client.advanced_orders.update_requirement_group(
    advanced_order_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(response.id)
主要响应字段:
  • response.id
  • response.status
  • response.area_code
  • response.comments
  • response.country_code
  • response.customer_reference

Get Advanced Order

获取高级订单详情

Fetch the current state before updating, deleting, or making control-flow decisions.
client.advanced_orders.retrieve()
GET /advanced_orders/{order_id}
ParameterTypeRequiredDescription
order_id
string (UUID)Yes
python
advanced_order = client.advanced_orders.retrieve(
    "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(advanced_order.id)
Primary response fields:
  • advanced_order.id
  • advanced_order.status
  • advanced_order.area_code
  • advanced_order.comments
  • advanced_order.country_code
  • advanced_order.customer_reference
在更新、删除或做流程控制决策前获取当前状态。
client.advanced_orders.retrieve()
GET /advanced_orders/{order_id}
参数类型必填描述
order_id
string (UUID)
python
advanced_order = client.advanced_orders.retrieve(
    "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(advanced_order.id)
主要响应字段:
  • advanced_order.id
  • advanced_order.status
  • advanced_order.area_code
  • advanced_order.comments
  • advanced_order.country_code
  • advanced_order.customer_reference

List available phone number blocks

列出可用号码段

Inspect available resources or choose an existing resource before mutating it.
client.available_phone_number_blocks.list()
GET /available_phone_number_blocks
ParameterTypeRequiredDescription
filter
objectNoConsolidated filter parameter (deepObject style).
python
available_phone_number_blocks = client.available_phone_number_blocks.list()
print(available_phone_number_blocks.data)
Response wrapper:
  • items:
    available_phone_number_blocks.data
  • pagination:
    available_phone_number_blocks.meta
Primary item fields:
  • phone_number
  • cost_information
  • features
  • range
  • record_type
  • region_information
在修改资源前查看可用资源或选择已有资源。
client.available_phone_number_blocks.list()
GET /available_phone_number_blocks
参数类型必填描述
filter
object统一筛选参数(deepObject风格)。
python
available_phone_number_blocks = client.available_phone_number_blocks.list()
print(available_phone_number_blocks.data)
响应封装:
  • 数据项:
    available_phone_number_blocks.data
  • 分页信息:
    available_phone_number_blocks.meta
主要数据字段:
  • phone_number
  • cost_information
  • features
  • range
  • record_type
  • region_information

Retrieve all comments

列出所有评论

Inspect available resources or choose an existing resource before mutating it.
client.comments.list()
GET /comments
ParameterTypeRequiredDescription
filter
objectNoConsolidated filter parameter (deepObject style).
python
comments = client.comments.list()
print(comments.data)
Response wrapper:
  • items:
    comments.data
  • pagination:
    comments.meta
Primary item fields:
  • id
  • body
  • created_at
  • updated_at
  • comment_record_id
  • comment_record_type

在修改资源前查看可用资源或选择已有资源。
client.comments.list()
GET /comments
参数类型必填描述
filter
object统一筛选参数(deepObject风格)。
python
comments = client.comments.list()
print(comments.data)
响应封装:
  • 数据项:
    comments.data
  • 分页信息:
    comments.meta
主要数据字段:
  • id
  • body
  • created_at
  • updated_at
  • comment_record_id
  • comment_record_type

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
Create a comment
client.comments.create()
POST /comments
Create or provision an additional resource when the core tasks do not cover this flow.None
Retrieve a comment
client.comments.retrieve()
GET /comments/{id}
Fetch the current state before updating, deleting, or making control-flow decisions.
id
Mark a comment as read
client.comments.mark_as_read()
PATCH /comments/{id}/read
Modify an existing resource without recreating it.
id
Get country coverage
client.country_coverage.retrieve()
GET /country_coverage
Inspect available resources or choose an existing resource before mutating it.None
Get coverage for a specific country
client.country_coverage.retrieve_country()
GET /country_coverage/countries/{country_code}
Fetch the current state before updating, deleting, or making control-flow decisions.
country_code
List customer service records
client.customer_service_records.list()
GET /customer_service_records
Inspect available resources or choose an existing resource before mutating it.None
Create a customer service record
client.customer_service_records.create()
POST /customer_service_records
Create or provision an additional resource when the core tasks do not cover this flow.None
Verify CSR phone number coverage
client.customer_service_records.verify_phone_number_coverage()
POST /customer_service_records/phone_number_coverages
Create or provision an additional resource when the core tasks do not cover this flow.None
Get a customer service record
client.customer_service_records.retrieve()
GET /customer_service_records/{customer_service_record_id}
Fetch the current state before updating, deleting, or making control-flow decisions.
customer_service_record_id
List inexplicit number orders
client.inexplicit_number_orders.list()
GET /inexplicit_number_orders
Inspect available resources or choose an existing resource before mutating it.None
Create an inexplicit number order
client.inexplicit_number_orders.create()
POST /inexplicit_number_orders
Create or provision an additional resource when the core tasks do not cover this flow.
ordering_groups
Retrieve an inexplicit number order
client.inexplicit_number_orders.retrieve()
GET /inexplicit_number_orders/{id}
Fetch the current state before updating, deleting, or making control-flow decisions.
id
Create an inventory coverage request
client.inventory_coverage.list()
GET /inventory_coverage
Inspect available resources or choose an existing resource before mutating it.None
List mobile network operators
client.mobile_network_operators.list()
GET /mobile_network_operators
Inspect available resources or choose an existing resource before mutating it.None
List network coverage locations
client.network_coverage.list()
GET /network_coverage
Inspect available resources or choose an existing resource before mutating it.None
List number block orders
client.number_block_orders.list()
GET /number_block_orders
Inspect available resources or choose an existing resource before mutating it.None
Create a number block order
client.number_block_orders.create()
POST /number_block_orders
Create or provision an additional resource when the core tasks do not cover this flow.
starting_number
,
range
Retrieve a number block order
client.number_block_orders.retrieve()
GET /number_block_orders/{number_block_order_id}
Fetch the current state before updating, deleting, or making control-flow decisions.
number_block_order_id
Retrieve a list of phone numbers associated to orders
client.number_order_phone_numbers.list()
GET /number_order_phone_numbers
Inspect available resources or choose an existing resource before mutating it.None
Retrieve a single phone number within a number order.
client.number_order_phone_numbers.retrieve()
GET /number_order_phone_numbers/{number_order_phone_number_id}
Fetch the current state before updating, deleting, or making control-flow decisions.
number_order_phone_number_id
Update requirements for a single phone number within a number order.
client.number_order_phone_numbers.update_requirements()
PATCH /number_order_phone_numbers/{number_order_phone_number_id}
Modify an existing resource without recreating it.
number_order_phone_number_id
List number orders
client.number_orders.list()
GET /number_orders
Create or inspect provisioning orders for number purchases.None
Update a number order
client.number_orders.update()
PATCH /number_orders/{number_order_id}
Modify an existing resource without recreating it.
number_order_id
List number reservations
client.number_reservations.list()
GET /number_reservations
Inspect available resources or choose an existing resource before mutating it.None
Extend a number reservation
client.number_reservations.actions.extend()
POST /number_reservations/{number_reservation_id}/actions/extend
Trigger a follow-up action in an existing workflow rather than creating a new top-level resource.
number_reservation_id
Retrieve the features for a list of numbers
client.numbers_features.create()
POST /numbers_features
Create or provision an additional resource when the core tasks do not cover this flow.
phone_numbers
Lists the phone number blocks jobs
client.phone_number_blocks.jobs.list()
GET /phone_number_blocks/jobs
Inspect available resources or choose an existing resource before mutating it.None
Deletes all numbers associated with a phone number block
client.phone_number_blocks.jobs.delete_phone_number_block()
POST /phone_number_blocks/jobs/delete_phone_number_block
Create or provision an additional resource when the core tasks do not cover this flow.
phone_number_block_id
Retrieves a phone number blocks job
client.phone_number_blocks.jobs.retrieve()
GET /phone_number_blocks/jobs/{id}
Fetch the current state before updating, deleting, or making control-flow decisions.
id
List sub number orders
client.sub_number_orders.list()
GET /sub_number_orders
Inspect available resources or choose an existing resource before mutating it.None
Retrieve a sub number order
client.sub_number_orders.retrieve()
GET /sub_number_orders/{sub_number_order_id}
Fetch the current state before updating, deleting, or making control-flow decisions.
sub_number_order_id
Update a sub number order's requirements
client.sub_number_orders.update()
PATCH /sub_number_orders/{sub_number_order_id}
Modify an existing resource without recreating it.
sub_number_order_id
Cancel a sub number order
client.sub_number_orders.cancel()
PATCH /sub_number_orders/{sub_number_order_id}/cancel
Modify an existing resource without recreating it.
sub_number_order_id
Create a sub number orders report
client.sub_number_orders_report.create()
POST /sub_number_orders_report
Create or provision an additional resource when the core tasks do not cover this flow.None
Retrieve a sub number orders report
client.sub_number_orders_report.retrieve()
GET /sub_number_orders_report/{report_id}
Fetch the current state before updating, deleting, or making control-flow decisions.
report_id
Download a sub number orders report
client.sub_number_orders_report.download()
GET /sub_number_orders_report/{report_id}/download
Fetch the current state before updating, deleting, or making control-flow decisions.
report_id
请优先使用上述核心任务,以下操作已收录精确的SDK方法和必填参数;如需完整的可选参数、响应结构和低频次Webhook payload,请参考references/api-details.md。 使用以下任意接口前,请先阅读可选参数章节响应结构章节,避免猜测缺失字段。
操作SDK方法端点适用场景必填参数
创建评论
client.comments.create()
POST /comments
当核心任务未覆盖该流程时,用于创建或开通额外资源。
查询评论
client.comments.retrieve()
GET /comments/{id}
在更新、删除或做流程控制决策前获取当前状态。
id
标记评论为已读
client.comments.mark_as_read()
PATCH /comments/{id}/read
修改已有资源无需重新创建。
id
获取国家覆盖范围
client.country_coverage.retrieve()
GET /country_coverage
在修改资源前查看可用资源或选择已有资源。
获取指定国家的覆盖范围
client.country_coverage.retrieve_country()
GET /country_coverage/countries/{country_code}
在更新、删除或做流程控制决策前获取当前状态。
country_code
列出客户服务记录
client.customer_service_records.list()
GET /customer_service_records
在修改资源前查看可用资源或选择已有资源。
创建客户服务记录
client.customer_service_records.create()
POST /customer_service_records
当核心任务未覆盖该流程时,用于创建或开通额外资源。
验证CSR电话号码覆盖
client.customer_service_records.verify_phone_number_coverage()
POST /customer_service_records/phone_number_coverages
当核心任务未覆盖该流程时,用于创建或开通额外资源。
获取客户服务记录详情
client.customer_service_records.retrieve()
GET /customer_service_records/{customer_service_record_id}
在更新、删除或做流程控制决策前获取当前状态。
customer_service_record_id
列出非显式号码订单
client.inexplicit_number_orders.list()
GET /inexplicit_number_orders
在修改资源前查看可用资源或选择已有资源。
创建非显式号码订单
client.inexplicit_number_orders.create()
POST /inexplicit_number_orders
当核心任务未覆盖该流程时,用于创建或开通额外资源。
ordering_groups
查询非显式号码订单
client.inexplicit_number_orders.retrieve()
GET /inexplicit_number_orders/{id}
在更新、删除或做流程控制决策前获取当前状态。
id
创建库存覆盖请求
client.inventory_coverage.list()
GET /inventory_coverage
在修改资源前查看可用资源或选择已有资源。
列出移动网络运营商
client.mobile_network_operators.list()
GET /mobile_network_operators
在修改资源前查看可用资源或选择已有资源。
列出网络覆盖位置
client.network_coverage.list()
GET /network_coverage
在修改资源前查看可用资源或选择已有资源。
列出号码段订单
client.number_block_orders.list()
GET /number_block_orders
在修改资源前查看可用资源或选择已有资源。
创建号码段订单
client.number_block_orders.create()
POST /number_block_orders
当核心任务未覆盖该流程时,用于创建或开通额外资源。
starting_number
,
range
查询号码段订单
client.number_block_orders.retrieve()
GET /number_block_orders/{number_block_order_id}
在更新、删除或做流程控制决策前获取当前状态。
number_block_order_id
列出订单关联的电话号码
client.number_order_phone_numbers.list()
GET /number_order_phone_numbers
在修改资源前查看可用资源或选择已有资源。
查询号码订单内的单个电话号码
client.number_order_phone_numbers.retrieve()
GET /number_order_phone_numbers/{number_order_phone_number_id}
在更新、删除或做流程控制决策前获取当前状态。
number_order_phone_number_id
更新号码订单内单个电话号码的要求
client.number_order_phone_numbers.update_requirements()
PATCH /number_order_phone_numbers/{number_order_phone_number_id}
修改已有资源无需重新创建。
number_order_phone_number_id
列出号码订单
client.number_orders.list()
GET /number_orders
创建或查看号码购买的开通订单。
更新号码订单
client.number_orders.update()
PATCH /number_orders/{number_order_id}
修改已有资源无需重新创建。
number_order_id
列出号码预留
client.number_reservations.list()
GET /number_reservations
在修改资源前查看可用资源或选择已有资源。
延长号码预留有效期
client.number_reservations.actions.extend()
POST /number_reservations/{number_reservation_id}/actions/extend
在现有工作流中触发后续操作,无需创建新的顶层资源。
number_reservation_id
批量查询号码功能
client.numbers_features.create()
POST /numbers_features
当核心任务未覆盖该流程时,用于创建或开通额外资源。
phone_numbers
列出号码段任务
client.phone_number_blocks.jobs.list()
GET /phone_number_blocks/jobs
在修改资源前查看可用资源或选择已有资源。
删除号码段关联的所有号码
client.phone_number_blocks.jobs.delete_phone_number_block()
POST /phone_number_blocks/jobs/delete_phone_number_block
当核心任务未覆盖该流程时,用于创建或开通额外资源。
phone_number_block_id
查询号码段任务详情
client.phone_number_blocks.jobs.retrieve()
GET /phone_number_blocks/jobs/{id}
在更新、删除或做流程控制决策前获取当前状态。
id
列出子号码订单
client.sub_number_orders.list()
GET /sub_number_orders
在修改资源前查看可用资源或选择已有资源。
查询子号码订单
client.sub_number_orders.retrieve()
GET /sub_number_orders/{sub_number_order_id}
在更新、删除或做流程控制决策前获取当前状态。
sub_number_order_id
更新子号码订单要求
client.sub_number_orders.update()
PATCH /sub_number_orders/{sub_number_order_id}
修改已有资源无需重新创建。
sub_number_order_id
取消子号码订单
client.sub_number_orders.cancel()
PATCH /sub_number_orders/{sub_number_order_id}/cancel
修改已有资源无需重新创建。
sub_number_order_id
创建子号码订单报告
client.sub_number_orders_report.create()
POST /sub_number_orders_report
当核心任务未覆盖该流程时,用于创建或开通额外资源。
查询子号码订单报告
client.sub_number_orders_report.retrieve()
GET /sub_number_orders_report/{report_id}
在更新、删除或做流程控制决策前获取当前状态。
report_id
下载子号码订单报告
client.sub_number_orders_report.download()
GET /sub_number_orders_report/{report_id}/download
在更新、删除或做流程控制决策前获取当前状态。
report_id

Other Webhook Events

其他Webhook事件

Event
data.event_type
Description
numberOrderStatusUpdate
number.order.status.update
Number Order Status Update

For exhaustive optional parameters, full response schemas, and complete webhook payloads, see references/api-details.md.
事件
data.event_type
描述
numberOrderStatusUpdate
number.order.status.update
号码订单状态更新

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