telnyx-porting-in-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 Porting In - Python
Telnyx号码迁入 - 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"), # This is the default and can be omitted
)以下所有示例均假设已按照上述方式完成初始化。
clientList all porting events
列出所有号码迁入事件
Returns a list of all porting events.
GET /porting/eventspython
page = client.porting.events.list()
page = page.data[0]
print(page)返回所有号码迁入事件的列表。
GET /porting/eventspython
page = client.porting.events.list()
page = page.data[0]
print(page)Show a porting event
查看单个号码迁入事件
Show a specific porting event.
GET /porting/events/{id}python
event = client.porting.events.retrieve(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(event.data)查看指定的号码迁入事件详情。
GET /porting/events/{id}python
event = client.porting.events.retrieve(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(event.data)Republish a porting event
重新发布号码迁入事件
Republish a specific porting event.
POST /porting/events/{id}/republishpython
client.porting.events.republish(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)重新发布指定的号码迁入事件。
POST /porting/events/{id}/republishpython
client.porting.events.republish(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)Preview the LOA configuration parameters
预览LOA配置参数
Preview the LOA template that would be generated without need to create LOA configuration.
POST /porting/loa_configuration_previewpython
response = client.porting.loa_configurations.preview_0(
address={
"city": "Austin",
"country_code": "US",
"state": "TX",
"street_address": "600 Congress Avenue",
"zip_code": "78701",
},
company_name="Telnyx",
contact={
"email": "testing@telnyx.com",
"phone_number": "+12003270001",
},
logo={
"document_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
},
name="My LOA Configuration",
)
print(response)
content = response.read()
print(content)无需创建LOA配置即可预览将生成的LOA模板。
POST /porting/loa_configuration_previewpython
response = client.porting.loa_configurations.preview_0(
address={
"city": "Austin",
"country_code": "US",
"state": "TX",
"street_address": "600 Congress Avenue",
"zip_code": "78701",
},
company_name="Telnyx",
contact={
"email": "testing@telnyx.com",
"phone_number": "+12003270001",
},
logo={
"document_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
},
name="My LOA Configuration",
)
print(response)
content = response.read()
print(content)List LOA configurations
列出LOA配置
List the LOA configurations.
GET /porting/loa_configurationspython
page = client.porting.loa_configurations.list()
page = page.data[0]
print(page.id)列出所有LOA配置。
GET /porting/loa_configurationspython
page = client.porting.loa_configurations.list()
page = page.data[0]
print(page.id)Create a LOA configuration
创建LOA配置
Create a LOA configuration.
POST /porting/loa_configurationspython
loa_configuration = client.porting.loa_configurations.create(
address={
"city": "Austin",
"country_code": "US",
"state": "TX",
"street_address": "600 Congress Avenue",
"zip_code": "78701",
},
company_name="Telnyx",
contact={
"email": "testing@telnyx.com",
"phone_number": "+12003270001",
},
logo={
"document_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
},
name="My LOA Configuration",
)
print(loa_configuration.data)创建一个LOA配置。
POST /porting/loa_configurationspython
loa_configuration = client.porting.loa_configurations.create(
address={
"city": "Austin",
"country_code": "US",
"state": "TX",
"street_address": "600 Congress Avenue",
"zip_code": "78701",
},
company_name="Telnyx",
contact={
"email": "testing@telnyx.com",
"phone_number": "+12003270001",
},
logo={
"document_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
},
name="My LOA Configuration",
)
print(loa_configuration.data)Retrieve a LOA configuration
获取单个LOA配置
Retrieve a specific LOA configuration.
GET /porting/loa_configurations/{id}python
loa_configuration = client.porting.loa_configurations.retrieve(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(loa_configuration.data)获取指定的LOA配置详情。
GET /porting/loa_configurations/{id}python
loa_configuration = client.porting.loa_configurations.retrieve(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(loa_configuration.data)Update a LOA configuration
更新LOA配置
Update a specific LOA configuration.
PATCH /porting/loa_configurations/{id}python
loa_configuration = client.porting.loa_configurations.update(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
address={
"city": "Austin",
"country_code": "US",
"state": "TX",
"street_address": "600 Congress Avenue",
"zip_code": "78701",
},
company_name="Telnyx",
contact={
"email": "testing@telnyx.com",
"phone_number": "+12003270001",
},
logo={
"document_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
},
name="My LOA Configuration",
)
print(loa_configuration.data)更新指定的LOA配置。
PATCH /porting/loa_configurations/{id}python
loa_configuration = client.porting.loa_configurations.update(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
address={
"city": "Austin",
"country_code": "US",
"state": "TX",
"street_address": "600 Congress Avenue",
"zip_code": "78701",
},
company_name="Telnyx",
contact={
"email": "testing@telnyx.com",
"phone_number": "+12003270001",
},
logo={
"document_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
},
name="My LOA Configuration",
)
print(loa_configuration.data)Delete a LOA configuration
删除LOA配置
Delete a specific LOA configuration.
DELETE /porting/loa_configurations/{id}python
client.porting.loa_configurations.delete(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)删除指定的LOA配置。
DELETE /porting/loa_configurations/{id}python
client.porting.loa_configurations.delete(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)Preview a LOA configuration
预览指定LOA配置
Preview a specific LOA configuration.
GET /porting/loa_configurations/{id}/previewpython
response = client.porting.loa_configurations.preview_1(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(response)
content = response.read()
print(content)预览指定的LOA配置。
GET /porting/loa_configurations/{id}/previewpython
response = client.porting.loa_configurations.preview_1(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(response)
content = response.read()
print(content)List all porting orders
列出所有迁入订单
Returns a list of your porting order.
GET /porting_orderspython
page = client.porting_orders.list()
page = page.data[0]
print(page.id)返回所有号码迁入订单的列表。
GET /porting_orderspython
page = client.porting_orders.list()
page = page.data[0]
print(page.id)Create a porting order
创建迁入订单
Creates a new porting order object.
POST /porting_ordersphone_numbersOptional: (string), (['string', 'null'])
customer_group_referencecustomer_referencepython
porting_order = client.porting_orders.create(
phone_numbers=["+13035550000", "+13035550001", "+13035550002"],
)
print(porting_order.data)创建一个新的号码迁入订单。
POST /porting_ordersphone_numbers可选项: (字符串), (['字符串', '空值'])
customer_group_referencecustomer_referencepython
porting_order = client.porting_orders.create(
phone_numbers=["+13035550000", "+13035550001", "+13035550002"],
)
print(porting_order.data)Retrieve a porting order
获取单个迁入订单
Retrieves the details of an existing porting order.
GET /porting_orders/{id}python
porting_order = client.porting_orders.retrieve(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(porting_order.data)获取已存在的号码迁入订单详情。
GET /porting_orders/{id}python
porting_order = client.porting_orders.retrieve(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(porting_order.data)Edit a porting order
编辑迁入订单
Edits the details of an existing porting order.
PATCH /porting_orders/{id}Optional: (object), (string), (string), (object), (object), (object), (object), (object), (uuid), (array[object]), (object), (uri)
activation_settingscustomer_group_referencecustomer_referencedocumentsend_usermessagingmiscphone_number_configurationrequirement_group_idrequirementsuser_feedbackwebhook_urlpython
porting_order = client.porting_orders.update(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(porting_order.data)编辑已存在的号码迁入订单详情。
PATCH /porting_orders/{id}可选项: (对象), (字符串), (字符串), (对象), (对象), (对象), (对象), (对象), (uuid), (对象数组), (对象), (uri)
activation_settingscustomer_group_referencecustomer_referencedocumentsend_usermessagingmiscphone_number_configurationrequirement_group_idrequirementsuser_feedbackwebhook_urlpython
porting_order = client.porting_orders.update(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(porting_order.data)Delete a porting order
删除迁入订单
Deletes an existing porting order.
DELETE /porting_orders/{id}python
client.porting_orders.delete(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)删除已存在的号码迁入订单。
DELETE /porting_orders/{id}python
client.porting_orders.delete(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)Activate every number in a porting order asynchronously.
异步激活迁入订单中的所有号码
Activate each number in a porting order asynchronously.
POST /porting_orders/{id}/actions/activatepython
response = client.porting_orders.actions.activate(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(response.data)异步激活迁入订单中的每个号码。
POST /porting_orders/{id}/actions/activatepython
response = client.porting_orders.actions.activate(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(response.data)Cancel a porting order
取消迁入订单
POST /porting_orders/{id}/actions/cancelpython
response = client.porting_orders.actions.cancel(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(response.data)POST /porting_orders/{id}/actions/cancelpython
response = client.porting_orders.actions.cancel(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(response.data)Submit a porting order.
提交迁入订单
Confirm and submit your porting order.
POST /porting_orders/{id}/actions/confirmpython
response = client.porting_orders.actions.confirm(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(response.data)确认并提交号码迁入订单。
POST /porting_orders/{id}/actions/confirmpython
response = client.porting_orders.actions.confirm(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(response.data)Share a porting order
共享迁入订单
Creates a sharing token for a porting order.
POST /porting_orders/{id}/actions/sharepython
response = client.porting_orders.actions.share(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(response.data)为号码迁入订单创建共享令牌。
POST /porting_orders/{id}/actions/sharepython
response = client.porting_orders.actions.share(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(response.data)List all porting activation jobs
列出所有迁入激活任务
Returns a list of your porting activation jobs.
GET /porting_orders/{id}/activation_jobspython
page = client.porting_orders.activation_jobs.list(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
page = page.data[0]
print(page.id)返回所有号码迁入激活任务的列表。
GET /porting_orders/{id}/activation_jobspython
page = client.porting_orders.activation_jobs.list(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
page = page.data[0]
print(page.id)Retrieve a porting activation job
获取单个迁入激活任务
Returns a porting activation job.
GET /porting_orders/{id}/activation_jobs/{activationJobId}python
activation_job = client.porting_orders.activation_jobs.retrieve(
activation_job_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(activation_job.data)返回单个号码迁入激活任务。
GET /porting_orders/{id}/activation_jobs/{activationJobId}python
activation_job = client.porting_orders.activation_jobs.retrieve(
activation_job_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(activation_job.data)Update a porting activation job
更新迁入激活任务
Updates the activation time of a porting activation job.
PATCH /porting_orders/{id}/activation_jobs/{activationJobId}python
activation_job = client.porting_orders.activation_jobs.update(
activation_job_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(activation_job.data)更新号码迁入激活任务的激活时间。
PATCH /porting_orders/{id}/activation_jobs/{activationJobId}python
activation_job = client.porting_orders.activation_jobs.update(
activation_job_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(activation_job.data)List additional documents
列出附加文档
Returns a list of additional documents for a porting order.
GET /porting_orders/{id}/additional_documentspython
page = client.porting_orders.additional_documents.list(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
page = page.data[0]
print(page.id)返回号码迁入订单的所有附加文档列表。
GET /porting_orders/{id}/additional_documentspython
page = client.porting_orders.additional_documents.list(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
page = page.data[0]
print(page.id)Create a list of additional documents
创建附加文档
Creates a list of additional documents for a porting order.
POST /porting_orders/{id}/additional_documentspython
additional_document = client.porting_orders.additional_documents.create(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(additional_document.data)为号码迁入订单创建附加文档列表。
POST /porting_orders/{id}/additional_documentspython
additional_document = client.porting_orders.additional_documents.create(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(additional_document.data)Delete an additional document
删除附加文档
Deletes an additional document for a porting order.
DELETE /porting_orders/{id}/additional_documents/{additional_document_id}python
client.porting_orders.additional_documents.delete(
additional_document_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)删除号码迁入订单的指定附加文档。
DELETE /porting_orders/{id}/additional_documents/{additional_document_id}python
client.porting_orders.additional_documents.delete(
additional_document_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)List allowed FOC dates
列出允许的FOC日期
Returns a list of allowed FOC dates for a porting order.
GET /porting_orders/{id}/allowed_foc_windowspython
response = client.porting_orders.retrieve_allowed_foc_windows(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(response.data)返回号码迁入订单允许的FOC日期列表。
GET /porting_orders/{id}/allowed_foc_windowspython
response = client.porting_orders.retrieve_allowed_foc_windows(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(response.data)List all comments of a porting order
列出迁入订单的所有评论
Returns a list of all comments of a porting order.
GET /porting_orders/{id}/commentspython
page = client.porting_orders.comments.list(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
page = page.data[0]
print(page.id)返回号码迁入订单的所有评论列表。
GET /porting_orders/{id}/commentspython
page = client.porting_orders.comments.list(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
page = page.data[0]
print(page.id)Create a comment for a porting order
为迁入订单添加评论
Creates a new comment for a porting order.
POST /porting_orders/{id}/commentsOptional: (string)
bodypython
comment = client.porting_orders.comments.create(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(comment.data)为号码迁入订单创建新评论。
POST /porting_orders/{id}/comments可选项: (字符串)
bodypython
comment = client.porting_orders.comments.create(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(comment.data)Download a porting order loa template
下载迁入订单的LOA模板
GET /porting_orders/{id}/loa_templatepython
response = client.porting_orders.retrieve_loa_template(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(response)
content = response.read()
print(content)GET /porting_orders/{id}/loa_templatepython
response = client.porting_orders.retrieve_loa_template(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(response)
content = response.read()
print(content)List porting order requirements
列出迁入订单的要求
Returns a list of all requirements based on country/number type for this porting order.
GET /porting_orders/{id}/requirementspython
page = client.porting_orders.retrieve_requirements(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
page = page.data[0]
print(page.field_type)返回基于迁入订单的国家/号码类型的所有要求列表。
GET /porting_orders/{id}/requirementspython
page = client.porting_orders.retrieve_requirements(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
page = page.data[0]
print(page.field_type)Retrieve the associated V1 sub_request_id and port_request_id
获取关联的V1 sub_request_id和port_request_id
GET /porting_orders/{id}/sub_requestpython
response = client.porting_orders.retrieve_sub_request(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(response.data)GET /porting_orders/{id}/sub_requestpython
response = client.porting_orders.retrieve_sub_request(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(response.data)List verification codes
列出验证码
Returns a list of verification codes for a porting order.
GET /porting_orders/{id}/verification_codespython
page = client.porting_orders.verification_codes.list(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
page = page.data[0]
print(page.id)返回号码迁入订单的验证码列表。
GET /porting_orders/{id}/verification_codespython
page = client.porting_orders.verification_codes.list(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
page = page.data[0]
print(page.id)Send the verification codes
发送验证码
Send the verification code for all porting phone numbers.
POST /porting_orders/{id}/verification_codes/sendpython
client.porting_orders.verification_codes.send(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)为所有迁入的电话号码发送验证码。
POST /porting_orders/{id}/verification_codes/sendpython
client.porting_orders.verification_codes.send(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)Verify the verification code for a list of phone numbers
验证电话号码列表的验证码
Verifies the verification code for a list of phone numbers.
POST /porting_orders/{id}/verification_codes/verifypython
response = client.porting_orders.verification_codes.verify(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(response.data)验证电话号码列表的验证码。
POST /porting_orders/{id}/verification_codes/verifypython
response = client.porting_orders.verification_codes.verify(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(response.data)List action requirements for a porting order
列出迁入订单的操作要求
Returns a list of action requirements for a specific porting order.
GET /porting_orders/{porting_order_id}/action_requirementspython
page = client.porting_orders.action_requirements.list(
porting_order_id="porting_order_id",
)
page = page.data[0]
print(page.id)返回指定号码迁入订单的操作要求列表。
GET /porting_orders/{porting_order_id}/action_requirementspython
page = client.porting_orders.action_requirements.list(
porting_order_id="porting_order_id",
)
page = page.data[0]
print(page.id)Initiate an action requirement
发起操作要求
Initiates a specific action requirement for a porting order.
POST /porting_orders/{porting_order_id}/action_requirements/{id}/initiatepython
response = client.porting_orders.action_requirements.initiate(
id="id",
porting_order_id="porting_order_id",
params={
"first_name": "John",
"last_name": "Doe",
},
)
print(response.data)为号码迁入订单发起指定的操作要求。
POST /porting_orders/{porting_order_id}/action_requirements/{id}/initiatepython
response = client.porting_orders.action_requirements.initiate(
id="id",
porting_order_id="porting_order_id",
params={
"first_name": "John",
"last_name": "Doe",
},
)
print(response.data)List all associated phone numbers
列出所有关联电话号码
Returns a list of all associated phone numbers for a porting order.
GET /porting_orders/{porting_order_id}/associated_phone_numberspython
page = client.porting_orders.associated_phone_numbers.list(
porting_order_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
page = page.data[0]
print(page.id)返回号码迁入订单的所有关联电话号码列表。
GET /porting_orders/{porting_order_id}/associated_phone_numberspython
page = client.porting_orders.associated_phone_numbers.list(
porting_order_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
page = page.data[0]
print(page.id)Create an associated phone number
创建关联电话号码
Creates a new associated phone number for a porting order.
POST /porting_orders/{porting_order_id}/associated_phone_numberspython
associated_phone_number = client.porting_orders.associated_phone_numbers.create(
porting_order_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
action="keep",
phone_number_range={},
)
print(associated_phone_number.data)为号码迁入订单创建新的关联电话号码。
POST /porting_orders/{porting_order_id}/associated_phone_numberspython
associated_phone_number = client.porting_orders.associated_phone_numbers.create(
porting_order_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
action="keep",
phone_number_range={},
)
print(associated_phone_number.data)Delete an associated phone number
删除关联电话号码
Deletes an associated phone number from a porting order.
DELETE /porting_orders/{porting_order_id}/associated_phone_numbers/{id}python
associated_phone_number = client.porting_orders.associated_phone_numbers.delete(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
porting_order_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(associated_phone_number.data)从号码迁入订单中删除指定的关联电话号码。
DELETE /porting_orders/{porting_order_id}/associated_phone_numbers/{id}python
associated_phone_number = client.porting_orders.associated_phone_numbers.delete(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
porting_order_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(associated_phone_number.data)List all phone number blocks
列出所有号码块
Returns a list of all phone number blocks of a porting order.
GET /porting_orders/{porting_order_id}/phone_number_blockspython
page = client.porting_orders.phone_number_blocks.list(
porting_order_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
page = page.data[0]
print(page.id)返回号码迁入订单的所有号码块列表。
GET /porting_orders/{porting_order_id}/phone_number_blockspython
page = client.porting_orders.phone_number_blocks.list(
porting_order_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
page = page.data[0]
print(page.id)Create a phone number block
创建号码块
Creates a new phone number block.
POST /porting_orders/{porting_order_id}/phone_number_blockspython
phone_number_block = client.porting_orders.phone_number_blocks.create(
porting_order_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
activation_ranges=[{
"end_at": "+4930244999910",
"start_at": "+4930244999901",
}],
phone_number_range={
"end_at": "+4930244999910",
"start_at": "+4930244999901",
},
)
print(phone_number_block.data)创建新的号码块。
POST /porting_orders/{porting_order_id}/phone_number_blockspython
phone_number_block = client.porting_orders.phone_number_blocks.create(
porting_order_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
activation_ranges=[{
"end_at": "+4930244999910",
"start_at": "+4930244999901",
}],
phone_number_range={
"end_at": "+4930244999910",
"start_at": "+4930244999901",
},
)
print(phone_number_block.data)Delete a phone number block
删除号码块
Deletes a phone number block.
DELETE /porting_orders/{porting_order_id}/phone_number_blocks/{id}python
phone_number_block = client.porting_orders.phone_number_blocks.delete(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
porting_order_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(phone_number_block.data)删除指定的号码块。
DELETE /porting_orders/{porting_order_id}/phone_number_blocks/{id}python
phone_number_block = client.porting_orders.phone_number_blocks.delete(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
porting_order_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(phone_number_block.data)List all phone number extensions
列出所有号码分机
Returns a list of all phone number extensions of a porting order.
GET /porting_orders/{porting_order_id}/phone_number_extensionspython
page = client.porting_orders.phone_number_extensions.list(
porting_order_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
page = page.data[0]
print(page.id)返回号码迁入订单的所有号码分机列表。
GET /porting_orders/{porting_order_id}/phone_number_extensionspython
page = client.porting_orders.phone_number_extensions.list(
porting_order_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
page = page.data[0]
print(page.id)Create a phone number extension
创建号码分机
Creates a new phone number extension.
POST /porting_orders/{porting_order_id}/phone_number_extensionspython
phone_number_extension = client.porting_orders.phone_number_extensions.create(
porting_order_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
activation_ranges=[{
"end_at": 10,
"start_at": 1,
}],
extension_range={
"end_at": 10,
"start_at": 1,
},
porting_phone_number_id="f24151b6-3389-41d3-8747-7dd8c681e5e2",
)
print(phone_number_extension.data)创建新的号码分机。
POST /porting_orders/{porting_order_id}/phone_number_extensionspython
phone_number_extension = client.porting_orders.phone_number_extensions.create(
porting_order_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
activation_ranges=[{
"end_at": 10,
"start_at": 1,
}],
extension_range={
"end_at": 10,
"start_at": 1,
},
porting_phone_number_id="f24151b6-3389-41d3-8747-7dd8c681e5e2",
)
print(phone_number_extension.data)Delete a phone number extension
删除号码分机
Deletes a phone number extension.
DELETE /porting_orders/{porting_order_id}/phone_number_extensions/{id}python
phone_number_extension = client.porting_orders.phone_number_extensions.delete(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
porting_order_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(phone_number_extension.data)删除指定的号码分机。
DELETE /porting_orders/{porting_order_id}/phone_number_extensions/{id}python
phone_number_extension = client.porting_orders.phone_number_extensions.delete(
id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
porting_order_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(phone_number_extension.data)List all exception types
列出所有异常类型
Returns a list of all possible exception types for a porting order.
GET /porting_orders/exception_typespython
response = client.porting_orders.retrieve_exception_types()
print(response.data)返回号码迁入订单所有可能的异常类型列表。
GET /porting_orders/exception_typespython
response = client.porting_orders.retrieve_exception_types()
print(response.data)List all phone number configurations
列出所有电话号码配置
Returns a list of phone number configurations paginated.
GET /porting_orders/phone_number_configurationspython
page = client.porting_orders.phone_number_configurations.list()
page = page.data[0]
print(page.id)分页返回电话号码配置列表。
GET /porting_orders/phone_number_configurationspython
page = client.porting_orders.phone_number_configurations.list()
page = page.data[0]
print(page.id)Create a list of phone number configurations
创建电话号码配置列表
Creates a list of phone number configurations.
POST /porting_orders/phone_number_configurationspython
phone_number_configuration = client.porting_orders.phone_number_configurations.create()
print(phone_number_configuration.data)创建电话号码配置列表。
POST /porting_orders/phone_number_configurationspython
phone_number_configuration = client.porting_orders.phone_number_configurations.create()
print(phone_number_configuration.data)List all porting phone numbers
列出所有迁入电话号码
Returns a list of your porting phone numbers.
GET /porting/phone_numberspython
page = client.porting_phone_numbers.list()
page = page.data[0]
print(page.porting_order_id)返回所有迁入的电话号码列表。
GET /porting/phone_numberspython
page = client.porting_phone_numbers.list()
page = page.data[0]
print(page.porting_order_id)List porting related reports
列出迁入相关报告
List the reports generated about porting operations.
GET /porting/reportspython
page = client.porting.reports.list()
page = page.data[0]
print(page.id)列出关于号码迁入操作生成的报告。
GET /porting/reportspython
page = client.porting.reports.list()
page = page.data[0]
print(page.id)Create a porting related report
创建迁入相关报告
Generate reports about porting operations.
POST /porting/reportspython
report = client.porting.reports.create(
params={
"filters": {}
},
report_type="export_porting_orders_csv",
)
print(report.data)生成关于号码迁入操作的报告。
POST /porting/reportspython
report = client.porting.reports.create(
params={
"filters": {}
},
report_type="export_porting_orders_csv",
)
print(report.data)Retrieve a report
获取报告
Retrieve a specific report generated.
GET /porting/reports/{id}python
report = client.porting.reports.retrieve(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(report.data)获取指定的生成报告。
GET /porting/reports/{id}python
report = client.porting.reports.retrieve(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
print(report.data)List available carriers in the UK
列出英国可用运营商
List available carriers in the UK.
GET /porting/uk_carrierspython
response = client.porting.list_uk_carriers()
print(response.data)列出英国的可用运营商。
GET /porting/uk_carrierspython
response = client.porting.list_uk_carriers()
print(response.data)Run a portability check
运行号码可携性检查
Runs a portability check, returning the results immediately.
POST /portability_checksOptional: (array[string])
phone_numberspython
response = client.portability_checks.run()
print(response.data)运行号码可携性检查,立即返回结果。
POST /portability_checks可选项: (字符串数组)
phone_numberspython
response = client.portability_checks.run()
print(response.data)
```",