telnyx-porting-in-javascript
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 - JavaScript
Telnyx 号码转入 - JavaScript
Installation
安装
bash
npm install telnyxbash
npm install telnyxSetup
初始化
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 is already initialized as shown above.
clientjavascript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});所有以下示例均假设已按上述方式初始化。
clientError 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 result = await client.messages.send({ to: '+13125550001', from: '+13125550002', text: 'Hello' });
} catch (err) {
if (err instanceof Telnyx.APIConnectionError) {
console.error('Network error — check connectivity and retry');
} else if (err instanceof Telnyx.RateLimitError) {
// 429: rate limited — wait and retry with exponential backoff
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: invalid API key, insufficient permissions,
resource not found, validation error (check field formats),
rate limited (retry with exponential backoff).
401403404422429所有API调用都可能因网络错误、速率限制(429)、验证错误(422)或身份验证错误(401)而失败。在生产代码中务必处理错误:
javascript
try {
const result = await client.messages.send({ to: '+13125550001', from: '+13125550002', text: 'Hello' });
} catch (err) {
if (err instanceof Telnyx.APIConnectionError) {
console.error('Network error — check connectivity and retry');
} else if (err instanceof Telnyx.RateLimitError) {
// 429: rate limited — wait and retry with exponential backoff
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');
}
}
}常见错误代码: 无效API密钥, 权限不足, 资源未找到, 验证错误(检查字段格式), 速率限制(使用指数退避重试)。
401403404422429Important Notes
重要说明
- Phone numbers must be in E.164 format (e.g., ). Include the
+13125550001prefix and country code. No spaces, dashes, or parentheses.+ - Pagination: List methods return an auto-paginating iterator. Use to iterate through all pages automatically.
for await (const item of result) { ... }
- 电话号码必须采用E.164格式(例如:)。包含
+13125550001前缀和国家代码。不允许有空格、短横线或括号。+ - 分页:列表方法返回自动分页的迭代器。使用自动遍历所有页面。
for await (const item of result) { ... }
Run a portability check
执行号码可携性核查
Runs a portability check, returning the results immediately.
POST /portability_checksOptional: (array[string])
phone_numbersjavascript
const response = await client.portabilityChecks.run({
phoneNumbers: ["+18005550101"],
});
console.log(response.data);Returns: (boolean), (string), (string), (boolean), (string)
fast_portablenot_portable_reasonphone_numberportablerecord_type执行号码可携性核查,立即返回结果。
POST /portability_checks可选参数:(array[string])
phone_numbersjavascript
const response = await client.portabilityChecks.run({
phoneNumbers: ["+18005550101"],
});
console.log(response.data);返回:(布尔值),(字符串),(字符串),(布尔值),(字符串)
fast_portablenot_portable_reasonphone_numberportablerecord_typeList all porting events
列出所有转网事件
Returns a list of all porting events.
GET /porting/eventsjavascript
// Automatically fetches more pages as needed.
for await (const eventListResponse of client.porting.events.list()) {
console.log(eventListResponse);
}Returns: (array[string]), (enum: porting_order.deleted), (uuid), (object), (enum: created, completed), (uuid)
available_notification_methodsevent_typeidpayloadpayload_statusporting_order_id返回所有转网事件的列表。
GET /porting/eventsjavascript
// Automatically fetches more pages as needed.
for await (const eventListResponse of client.porting.events.list()) {
console.log(eventListResponse);
}返回:(array[string]),(枚举:porting_order.deleted),(uuid),(对象),(枚举:created, completed),(uuid)
available_notification_methodsevent_typeidpayloadpayload_statusporting_order_idShow a porting event
查询单个转网事件
Show a specific porting event.
GET /porting/events/{id}javascript
const event = await client.porting.events.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
console.log(event.data);Returns: (array[string]), (enum: porting_order.deleted), (uuid), (object), (enum: created, completed), (uuid)
available_notification_methodsevent_typeidpayloadpayload_statusporting_order_id查询特定的转网事件详情。
GET /porting/events/{id}javascript
const event = await client.porting.events.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
console.log(event.data);返回:(array[string]),(枚举:porting_order.deleted),(uuid),(对象),(枚举:created, completed),(uuid)
available_notification_methodsevent_typeidpayloadpayload_statusporting_order_idRepublish a porting event
重新发布转网事件
Republish a specific porting event.
POST /porting/events/{id}/republishjavascript
await client.porting.events.republish('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');重新发布特定的转网事件。
POST /porting/events/{id}/republishjavascript
await client.porting.events.republish('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');List LOA configurations
列出LOA配置
List the LOA configurations.
GET /porting/loa_configurationsjavascript
// Automatically fetches more pages as needed.
for await (const portingLoaConfiguration of client.porting.loaConfigurations.list()) {
console.log(portingLoaConfiguration.id);
}Returns: (object), (string), (object), (date-time), (uuid), (object), (string), (string), (string), (date-time)
addresscompany_namecontactcreated_atidlogonameorganization_idrecord_typeupdated_at列出LOA配置列表。
GET /porting/loa_configurationsjavascript
// Automatically fetches more pages as needed.
for await (const portingLoaConfiguration of client.porting.loaConfigurations.list()) {
console.log(portingLoaConfiguration.id);
}返回:(对象),(字符串),(对象),(日期时间),(uuid),(对象),(字符串),(字符串),(字符串),(日期时间)
addresscompany_namecontactcreated_atidlogonameorganization_idrecord_typeupdated_atCreate a LOA configuration
创建LOA配置
Create a LOA configuration.
POST /porting/loa_configurationsjavascript
const loaConfiguration = await client.porting.loaConfigurations.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',
});
console.log(loaConfiguration.data);Returns: (object), (string), (object), (date-time), (uuid), (object), (string), (string), (string), (date-time)
addresscompany_namecontactcreated_atidlogonameorganization_idrecord_typeupdated_at创建新的LOA配置。
POST /porting/loa_configurationsjavascript
const loaConfiguration = await client.porting.loaConfigurations.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',
});
console.log(loaConfiguration.data);返回:(对象),(字符串),(对象),(日期时间),(uuid),(对象),(字符串),(字符串),(字符串),(日期时间)
addresscompany_namecontactcreated_atidlogonameorganization_idrecord_typeupdated_atPreview the LOA configuration parameters
预览LOA配置参数
Preview the LOA template that would be generated without need to create LOA configuration.
POST /porting/loa_configurations/previewjavascript
const response = await client.porting.loaConfigurations.preview({
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',
});
console.log(response);
const content = await response.blob();
console.log(content);无需创建LOA配置,即可预览将生成的LOA模板。
POST /porting/loa_configurations/previewjavascript
const response = await client.porting.loaConfigurations.preview({
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',
});
console.log(response);
const content = await response.blob();
console.log(content);Retrieve a LOA configuration
查询LOA配置
Retrieve a specific LOA configuration.
GET /porting/loa_configurations/{id}javascript
const loaConfiguration = await client.porting.loaConfigurations.retrieve(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);
console.log(loaConfiguration.data);Returns: (object), (string), (object), (date-time), (uuid), (object), (string), (string), (string), (date-time)
addresscompany_namecontactcreated_atidlogonameorganization_idrecord_typeupdated_at查询特定的LOA配置详情。
GET /porting/loa_configurations/{id}javascript
const loaConfiguration = await client.porting.loaConfigurations.retrieve(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);
console.log(loaConfiguration.data);返回:(对象),(字符串),(对象),(日期时间),(uuid),(对象),(字符串),(字符串),(字符串),(日期时间)
addresscompany_namecontactcreated_atidlogonameorganization_idrecord_typeupdated_atUpdate a LOA configuration
更新LOA配置
Update a specific LOA configuration.
PATCH /porting/loa_configurations/{id}javascript
const loaConfiguration = await client.porting.loaConfigurations.update(
'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',
},
);
console.log(loaConfiguration.data);Returns: (object), (string), (object), (date-time), (uuid), (object), (string), (string), (string), (date-time)
addresscompany_namecontactcreated_atidlogonameorganization_idrecord_typeupdated_at更新特定的LOA配置。
PATCH /porting/loa_configurations/{id}javascript
const loaConfiguration = await client.porting.loaConfigurations.update(
'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',
},
);
console.log(loaConfiguration.data);返回:(对象),(字符串),(对象),(日期时间),(uuid),(对象),(字符串),(字符串),(字符串),(日期时间)
addresscompany_namecontactcreated_atidlogonameorganization_idrecord_typeupdated_atDelete a LOA configuration
删除LOA配置
Delete a specific LOA configuration.
DELETE /porting/loa_configurations/{id}javascript
await client.porting.loaConfigurations.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');删除特定的LOA配置。
DELETE /porting/loa_configurations/{id}javascript
await client.porting.loaConfigurations.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');Preview a LOA configuration
预览LOA配置
Preview a specific LOA configuration.
GET /porting/loa_configurations/{id}/previewjavascript
const response = await client.porting.loaConfigurations.preview1(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);
console.log(response);
const content = await response.blob();
console.log(content);预览特定的LOA配置。
GET /porting/loa_configurations/{id}/previewjavascript
const response = await client.porting.loaConfigurations.preview1(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);
console.log(response);
const content = await response.blob();
console.log(content);List porting related reports
列出转网相关报告
List the reports generated about porting operations.
GET /porting/reportsjavascript
// Automatically fetches more pages as needed.
for await (const portingReport of client.porting.reports.list()) {
console.log(portingReport.id);
}Returns: (date-time), (uuid), (uuid), (object), (string), (enum: export_porting_orders_csv), (enum: pending, completed), (date-time)
created_atdocument_ididparamsrecord_typereport_typestatusupdated_at列出转网操作生成的报告。
GET /porting/reportsjavascript
// Automatically fetches more pages as needed.
for await (const portingReport of client.porting.reports.list()) {
console.log(portingReport.id);
}返回:(日期时间),(uuid),(uuid),(对象),(字符串),(枚举:export_porting_orders_csv),(枚举:pending, completed),(日期时间)
created_atdocument_ididparamsrecord_typereport_typestatusupdated_atCreate a porting related report
创建转网相关报告
Generate reports about porting operations.
POST /porting/reportsjavascript
const report = await client.porting.reports.create({
params: { filters: {} },
report_type: 'export_porting_orders_csv',
});
console.log(report.data);Returns: (date-time), (uuid), (uuid), (object), (string), (enum: export_porting_orders_csv), (enum: pending, completed), (date-time)
created_atdocument_ididparamsrecord_typereport_typestatusupdated_at生成转网操作相关的报告。
POST /porting/reportsjavascript
const report = await client.porting.reports.create({
params: { filters: {} },
report_type: 'export_porting_orders_csv',
});
console.log(report.data);返回:(日期时间),(uuid),(uuid),(对象),(字符串),(枚举:export_porting_orders_csv),(枚举:pending, completed),(日期时间)
created_atdocument_ididparamsrecord_typereport_typestatusupdated_atRetrieve a report
查询报告
Retrieve a specific report generated.
GET /porting/reports/{id}javascript
const report = await client.porting.reports.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
console.log(report.data);Returns: (date-time), (uuid), (uuid), (object), (string), (enum: export_porting_orders_csv), (enum: pending, completed), (date-time)
created_atdocument_ididparamsrecord_typereport_typestatusupdated_at查询特定的已生成报告详情。
GET /porting/reports/{id}javascript
const report = await client.porting.reports.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
console.log(report.data);返回:(日期时间),(uuid),(uuid),(对象),(字符串),(枚举:export_porting_orders_csv),(枚举:pending, completed),(日期时间)
created_atdocument_ididparamsrecord_typereport_typestatusupdated_atList available carriers in the UK
列出英国可用运营商
List available carriers in the UK.
GET /porting/uk_carriersjavascript
const response = await client.porting.listUkCarriers();
console.log(response.data);Returns: (array[string]), (date-time), (string), (uuid), (string), (string), (date-time)
alternative_cupidscreated_atcupididnamerecord_typeupdated_at列出英国地区的可用运营商。
GET /porting/uk_carriersjavascript
const response = await client.porting.listUkCarriers();
console.log(response.data);返回:(array[string]),(日期时间),(字符串),(uuid),(字符串),(字符串),(日期时间)
alternative_cupidscreated_atcupididnamerecord_typeupdated_atList all porting orders
列出所有转网订单
Returns a list of your porting order.
GET /porting_ordersjavascript
// Automatically fetches more pages as needed.
for await (const portingOrder of client.portingOrders.list()) {
console.log(portingOrder.id);
}Returns: (object), (array[string]), (date-time), (string | null), (string | null), (string), (object), (object), (uuid), (object), (object), (string), (string | null), (object), (enum: landline, local, mobile, national, shared_cost, toll_free), (array[object]), (integer), (string), (array[object]), (boolean), (object), (string | null), (date-time), (object), (uuid), (uri)
activation_settingsadditional_stepscreated_atcustomer_group_referencecustomer_referencedescriptiondocumentsend_useridmessagingmiscold_service_provider_ocnparent_support_keyphone_number_configurationphone_number_typephone_numbersporting_phone_numbers_countrecord_typerequirementsrequirements_metstatussupport_keyupdated_atuser_feedbackuser_idwebhook_url返回您的转网订单列表。
GET /porting_ordersjavascript
// Automatically fetches more pages as needed.
for await (const portingOrder of client.portingOrders.list()) {
console.log(portingOrder.id);
}返回:(对象),(array[string]),(日期时间),(字符串 | null),(字符串 | null),(字符串),(对象),(对象),(uuid),(对象),(对象),(字符串),(字符串 | null),(对象),(枚举:landline, local, mobile, national, shared_cost, toll_free),(array[object]),(整数),(字符串),(array[object]),(布尔值),(对象),(字符串 | null),(日期时间),(对象),(uuid),(uri)
activation_settingsadditional_stepscreated_atcustomer_group_referencecustomer_referencedescriptiondocumentsend_useridmessagingmiscold_service_provider_ocnparent_support_keyphone_number_configurationphone_number_typephone_numbersporting_phone_numbers_countrecord_typerequirementsrequirements_metstatussupport_keyupdated_atuser_feedbackuser_idwebhook_urlCreate a porting order
创建转网订单
Creates a new porting order object.
POST /porting_ordersphone_numbersOptional: (string), (string | null)
customer_group_referencecustomer_referencejavascript
const portingOrder = await client.portingOrders.create({
phone_numbers: ['+13035550000', '+13035550001', '+13035550002'],
});
console.log(portingOrder.data);Returns: (object), (array[string]), (date-time), (string | null), (string | null), (string), (object), (object), (uuid), (object), (object), (string), (string | null), (object), (enum: landline, local, mobile, national, shared_cost, toll_free), (array[object]), (integer), (string), (array[object]), (boolean), (object), (string | null), (date-time), (object), (uuid), (uri)
activation_settingsadditional_stepscreated_atcustomer_group_referencecustomer_referencedescriptiondocumentsend_useridmessagingmiscold_service_provider_ocnparent_support_keyphone_number_configurationphone_number_typephone_numbersporting_phone_numbers_countrecord_typerequirementsrequirements_metstatussupport_keyupdated_atuser_feedbackuser_idwebhook_url创建新的转网订单对象。
POST /porting_ordersphone_numbers可选参数:(字符串),(字符串 | null)
customer_group_referencecustomer_referencejavascript
const portingOrder = await client.portingOrders.create({
phone_numbers: ['+13035550000', '+13035550001', '+13035550002'],
});
console.log(portingOrder.data);返回:(对象),(array[string]),(日期时间),(字符串 | null),(字符串 | null),(字符串),(对象),(对象),(uuid),(对象),(对象),(字符串),(字符串 | null),(对象),(枚举:landline, local, mobile, national, shared_cost, toll_free),(array[object]),(整数),(字符串),(array[object]),(布尔值),(对象),(字符串 | null),(日期时间),(对象),(uuid),(uri)
activation_settingsadditional_stepscreated_atcustomer_group_referencecustomer_referencedescriptiondocumentsend_useridmessagingmiscold_service_provider_ocnparent_support_keyphone_number_configurationphone_number_typephone_numbersporting_phone_numbers_countrecord_typerequirementsrequirements_metstatussupport_keyupdated_atuser_feedbackuser_idwebhook_urlList all exception types
列出所有异常类型
Returns a list of all possible exception types for a porting order.
GET /porting_orders/exception_typesjavascript
const response = await client.portingOrders.retrieveExceptionTypes();
console.log(response.data);Returns: (enum: ACCOUNT_NUMBER_MISMATCH, AUTH_PERSON_MISMATCH, BTN_ATN_MISMATCH, ENTITY_NAME_MISMATCH, FOC_EXPIRED, FOC_REJECTED, LOCATION_MISMATCH, LSR_PENDING, MAIN_BTN_PORTING, OSP_IRRESPONSIVE, OTHER, PASSCODE_PIN_INVALID, PHONE_NUMBER_HAS_SPECIAL_FEATURE, PHONE_NUMBER_MISMATCH, PHONE_NUMBER_NOT_PORTABLE, PORT_TYPE_INCORRECT, PORTING_ORDER_SPLIT_REQUIRED, POSTAL_CODE_MISMATCH, RATE_CENTER_NOT_PORTABLE, SV_CONFLICT, SV_UNKNOWN_FAILURE), (string)
codedescription返回转网订单所有可能的异常类型列表。
GET /porting_orders/exception_typesjavascript
const response = await client.portingOrders.retrieveExceptionTypes();
console.log(response.data);返回:(枚举:ACCOUNT_NUMBER_MISMATCH, AUTH_PERSON_MISMATCH, BTN_ATN_MISMATCH, ENTITY_NAME_MISMATCH, FOC_EXPIRED, FOC_REJECTED, LOCATION_MISMATCH, LSR_PENDING, MAIN_BTN_PORTING, OSP_IRRESPONSIVE, OTHER, PASSCODE_PIN_INVALID, PHONE_NUMBER_HAS_SPECIAL_FEATURE, PHONE_NUMBER_MISMATCH, PHONE_NUMBER_NOT_PORTABLE, PORT_TYPE_INCORRECT, PORTING_ORDER_SPLIT_REQUIRED, POSTAL_CODE_MISMATCH, RATE_CENTER_NOT_PORTABLE, SV_CONFLICT, SV_UNKNOWN_FAILURE),(字符串)
codedescriptionList all phone number configurations
列出所有电话号码配置
Returns a list of phone number configurations paginated.
GET /porting_orders/phone_number_configurationsjavascript
// Automatically fetches more pages as needed.
for await (const phoneNumberConfigurationListResponse of client.portingOrders.phoneNumberConfigurations.list()) {
console.log(phoneNumberConfigurationListResponse.id);
}Returns: (date-time), (uuid), (uuid), (string), (date-time), (uuid)
created_atidporting_phone_number_idrecord_typeupdated_atuser_bundle_id返回分页的电话号码配置列表。
GET /porting_orders/phone_number_configurationsjavascript
// Automatically fetches more pages as needed.
for await (const phoneNumberConfigurationListResponse of client.portingOrders.phoneNumberConfigurations.list()) {
console.log(phoneNumberConfigurationListResponse.id);
}返回:(日期时间),(uuid),(uuid),(字符串),(日期时间),(uuid)
created_atidporting_phone_number_idrecord_typeupdated_atuser_bundle_idCreate a list of phone number configurations
创建电话号码配置列表
Creates a list of phone number configurations.
POST /porting_orders/phone_number_configurationsjavascript
const phoneNumberConfiguration = await client.portingOrders.phoneNumberConfigurations.create();
console.log(phoneNumberConfiguration.data);Returns: (date-time), (uuid), (uuid), (string), (date-time), (uuid)
created_atidporting_phone_number_idrecord_typeupdated_atuser_bundle_id创建电话号码配置列表。
POST /porting_orders/phone_number_configurationsjavascript
const phoneNumberConfiguration = await client.portingOrders.phoneNumberConfigurations.create();
console.log(phoneNumberConfiguration.data);返回:(日期时间),(uuid),(uuid),(字符串),(日期时间),(uuid)
created_atidporting_phone_number_idrecord_typeupdated_atuser_bundle_idRetrieve a porting order
查询转网订单
Retrieves the details of an existing porting order.
GET /porting_orders/{id}javascript
const portingOrder = await client.portingOrders.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
console.log(portingOrder.data);Returns: (object), (array[string]), (date-time), (string | null), (string | null), (string), (object), (object), (uuid), (object), (object), (string), (string | null), (object), (enum: landline, local, mobile, national, shared_cost, toll_free), (array[object]), (integer), (string), (array[object]), (boolean), (object), (string | null), (date-time), (object), (uuid), (uri)
activation_settingsadditional_stepscreated_atcustomer_group_referencecustomer_referencedescriptiondocumentsend_useridmessagingmiscold_service_provider_ocnparent_support_keyphone_number_configurationphone_number_typephone_numbersporting_phone_numbers_countrecord_typerequirementsrequirements_metstatussupport_keyupdated_atuser_feedbackuser_idwebhook_url查询现有转网订单的详情。
GET /porting_orders/{id}javascript
const portingOrder = await client.portingOrders.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
console.log(portingOrder.data);返回:(对象),(array[string]),(日期时间),(字符串 | null),(字符串 | null),(字符串),(对象),(对象),(uuid),(对象),(对象),(字符串),(字符串 | null),(对象),(枚举:landline, local, mobile, national, shared_cost, toll_free),(array[object]),(整数),(字符串),(array[object]),(布尔值),(对象),(字符串 | null),(日期时间),(对象),(uuid),(uri)
activation_settingsadditional_stepscreated_atcustomer_group_referencecustomer_referencedescriptiondocumentsend_useridmessagingmiscold_service_provider_ocnparent_support_keyphone_number_configurationphone_number_typephone_numbersporting_phone_numbers_countrecord_typerequirementsrequirements_metstatussupport_keyupdated_atuser_feedbackuser_idwebhook_urlEdit a porting order
编辑转网订单
Edits the details of an existing porting order. Any or all of a porting orders attributes may be included in the resource object included in a PATCH request. If a request does not include all of the attributes for a resource, the system will interpret the missing attributes as if they were included with their current values.
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_urljavascript
const portingOrder = await client.portingOrders.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
console.log(portingOrder.data);Returns: (object), (array[string]), (date-time), (string | null), (string | null), (string), (object), (object), (uuid), (object), (object), (string), (string | null), (object), (enum: landline, local, mobile, national, shared_cost, toll_free), (array[object]), (integer), (string), (array[object]), (boolean), (object), (string | null), (date-time), (object), (uuid), (uri)
activation_settingsadditional_stepscreated_atcustomer_group_referencecustomer_referencedescriptiondocumentsend_useridmessagingmiscold_service_provider_ocnparent_support_keyphone_number_configurationphone_number_typephone_numbersporting_phone_numbers_countrecord_typerequirementsrequirements_metstatussupport_keyupdated_atuser_feedbackuser_idwebhook_url编辑现有转网订单的详情。PATCH请求中可包含转网订单的任意或全部属性。如果请求未包含资源的所有属性,系统会将缺失的属性视为使用当前值。
PATCH /porting_orders/{id}可选参数:(对象),(字符串),(字符串),(对象),(对象),(对象),(对象),(对象),(uuid),(array[object]),(对象),(uri)
activation_settingscustomer_group_referencecustomer_referencedocumentsend_usermessagingmiscphone_number_configurationrequirement_group_idrequirementsuser_feedbackwebhook_urljavascript
const portingOrder = await client.portingOrders.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
console.log(portingOrder.data);返回:(对象),(array[string]),(日期时间),(字符串 | null),(字符串 | null),(字符串),(对象),(对象),(uuid),(对象),(对象),(字符串),(字符串 | null),(对象),(枚举:landline, local, mobile, national, shared_cost, toll_free),(array[object]),(整数),(字符串),(array[object]),(布尔值),(对象),(字符串 | null),(日期时间),(对象),(uuid),(uri)
activation_settingsadditional_stepscreated_atcustomer_group_referencecustomer_referencedescriptiondocumentsend_useridmessagingmiscold_service_provider_ocnparent_support_keyphone_number_configurationphone_number_typephone_numbersporting_phone_numbers_countrecord_typerequirementsrequirements_metstatussupport_keyupdated_atuser_feedbackuser_idwebhook_urlDelete a porting order
删除转网订单
Deletes an existing porting order. This operation is restrict to porting orders in draft state.
DELETE /porting_orders/{id}javascript
await client.portingOrders.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');删除现有转网订单。此操作仅适用于草稿状态的转网订单。
DELETE /porting_orders/{id}javascript
await client.portingOrders.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');Activate every number in a porting order asynchronously.
异步激活转网订单中的所有号码
Activate each number in a porting order asynchronously. This operation is limited to US FastPort orders only.
POST /porting_orders/{id}/actions/activatejavascript
const response = await client.portingOrders.actions.activate(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);
console.log(response.data);Returns: (date-time), (enum: scheduled, on-demand), (array[object]), (date-time), (uuid), (string), (enum: created, in-process, completed, failed), (date-time)
activate_atactivation_typeactivation_windowscreated_atidrecord_typestatusupdated_at异步激活转网订单中的每个号码。此操作仅适用于美国地区的FastPort订单。
POST /porting_orders/{id}/actions/activatejavascript
const response = await client.portingOrders.actions.activate(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);
console.log(response.data);返回:(日期时间),(枚举:scheduled, on-demand),(array[object]),(日期时间),(uuid),(字符串),(枚举:created, in-process, completed, failed),(日期时间)
activate_atactivation_typeactivation_windowscreated_atidrecord_typestatusupdated_atCancel a porting order
取消转网订单
POST /porting_orders/{id}/actions/canceljavascript
const response = await client.portingOrders.actions.cancel('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
console.log(response.data);Returns: (object), (array[string]), (date-time), (string | null), (string | null), (string), (object), (object), (uuid), (object), (object), (string), (string | null), (object), (enum: landline, local, mobile, national, shared_cost, toll_free), (array[object]), (integer), (string), (array[object]), (boolean), (object), (string | null), (date-time), (object), (uuid), (uri)
activation_settingsadditional_stepscreated_atcustomer_group_referencecustomer_referencedescriptiondocumentsend_useridmessagingmiscold_service_provider_ocnparent_support_keyphone_number_configurationphone_number_typephone_numbersporting_phone_numbers_countrecord_typerequirementsrequirements_metstatussupport_keyupdated_atuser_feedbackuser_idwebhook_urlPOST /porting_orders/{id}/actions/canceljavascript
const response = await client.portingOrders.actions.cancel('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
console.log(response.data);返回:(对象),(array[string]),(日期时间),(字符串 | null),(字符串 | null),(字符串),(对象),(对象),(uuid),(对象),(对象),(字符串),(字符串 | null),(对象),(枚举:landline, local, mobile, national, shared_cost, toll_free),(array[object]),(整数),(字符串),(array[object]),(布尔值),(对象),(字符串 | null),(日期时间),(对象),(uuid),(uri)
activation_settingsadditional_stepscreated_atcustomer_group_referencecustomer_referencedescriptiondocumentsend_useridmessagingmiscold_service_provider_ocnparent_support_keyphone_number_configurationphone_number_typephone_numbersporting_phone_numbers_countrecord_typerequirementsrequirements_metstatussupport_keyupdated_atuser_feedbackuser_idwebhook_urlSubmit a porting order.
提交转网订单
Confirm and submit your porting order.
POST /porting_orders/{id}/actions/confirmjavascript
const response = await client.portingOrders.actions.confirm('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
console.log(response.data);Returns: (object), (array[string]), (date-time), (string | null), (string | null), (string), (object), (object), (uuid), (object), (object), (string), (string | null), (object), (enum: landline, local, mobile, national, shared_cost, toll_free), (array[object]), (integer), (string), (array[object]), (boolean), (object), (string | null), (date-time), (object), (uuid), (uri)
activation_settingsadditional_stepscreated_atcustomer_group_referencecustomer_referencedescriptiondocumentsend_useridmessagingmiscold_service_provider_ocnparent_support_keyphone_number_configurationphone_number_typephone_numbersporting_phone_numbers_countrecord_typerequirementsrequirements_metstatussupport_keyupdated_atuser_feedbackuser_idwebhook_url确认并提交您的转网订单。
POST /porting_orders/{id}/actions/confirmjavascript
const response = await client.portingOrders.actions.confirm('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
console.log(response.data);返回:(对象),(array[string]),(日期时间),(字符串 | null),(字符串 | null),(字符串),(对象),(对象),(uuid),(对象),(对象),(字符串),(字符串 | null),(对象),(枚举:landline, local, mobile, national, shared_cost, toll_free),(array[object]),(整数),(字符串),(array[object]),(布尔值),(对象),(字符串 | null),(日期时间),(对象),(uuid),(uri)
activation_settingsadditional_stepscreated_atcustomer_group_referencecustomer_referencedescriptiondocumentsend_useridmessagingmiscold_service_provider_ocnparent_support_keyphone_number_configurationphone_number_typephone_numbersporting_phone_numbers_countrecord_typerequirementsrequirements_metstatussupport_keyupdated_atuser_feedbackuser_idwebhook_urlShare a porting order
分享转网订单
Creates a sharing token for a porting order. The token can be used to share the porting order with non-Telnyx users.
POST /porting_orders/{id}/actions/sharejavascript
const response = await client.portingOrders.actions.share('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
console.log(response.data);Returns: (date-time), (date-time), (integer), (uuid), (array[string]), (uuid), (string), (string)
created_atexpires_atexpires_in_secondsidpermissionsporting_order_idrecord_typetoken为转网订单创建分享令牌。该令牌可用于与非Telnyx用户分享转网订单。
POST /porting_orders/{id}/actions/sharejavascript
const response = await client.portingOrders.actions.share('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
console.log(response.data);返回:(日期时间),(日期时间),(整数),(uuid),(array[string]),(uuid),(字符串),(字符串)
created_atexpires_atexpires_in_secondsidpermissionsporting_order_idrecord_typetokenList all porting activation jobs
列出所有转网激活任务
Returns a list of your porting activation jobs.
GET /porting_orders/{id}/activation_jobsjavascript
// Automatically fetches more pages as needed.
for await (const portingOrdersActivationJob of client.portingOrders.activationJobs.list(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
)) {
console.log(portingOrdersActivationJob.id);
}Returns: (date-time), (enum: scheduled, on-demand), (array[object]), (date-time), (uuid), (string), (enum: created, in-process, completed, failed), (date-time)
activate_atactivation_typeactivation_windowscreated_atidrecord_typestatusupdated_at返回您的转网激活任务列表。
GET /porting_orders/{id}/activation_jobsjavascript
// Automatically fetches more pages as needed.
for await (const portingOrdersActivationJob of client.portingOrders.activationJobs.list(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
)) {
console.log(portingOrdersActivationJob.id);
}返回:(日期时间),(枚举:scheduled, on-demand),(array[object]),(日期时间),(uuid),(字符串),(枚举:created, in-process, completed, failed),(日期时间)
activate_atactivation_typeactivation_windowscreated_atidrecord_typestatusupdated_atRetrieve a porting activation job
查询转网激活任务
Returns a porting activation job.
GET /porting_orders/{id}/activation_jobs/{activationJobId}javascript
const activationJob = await client.portingOrders.activationJobs.retrieve(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
{ id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },
);
console.log(activationJob.data);Returns: (date-time), (enum: scheduled, on-demand), (array[object]), (date-time), (uuid), (string), (enum: created, in-process, completed, failed), (date-time)
activate_atactivation_typeactivation_windowscreated_atidrecord_typestatusupdated_at查询转网激活任务详情。
GET /porting_orders/{id}/activation_jobs/{activationJobId}javascript
const activationJob = await client.portingOrders.activationJobs.retrieve(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
{ id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },
);
console.log(activationJob.data);返回:(日期时间),(枚举:scheduled, on-demand),(array[object]),(日期时间),(uuid),(字符串),(枚举:created, in-process, completed, failed),(日期时间)
activate_atactivation_typeactivation_windowscreated_atidrecord_typestatusupdated_atUpdate a porting activation job
更新转网激活任务
Updates the activation time of a porting activation job.
PATCH /porting_orders/{id}/activation_jobs/{activationJobId}javascript
const activationJob = await client.portingOrders.activationJobs.update(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
{ id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },
);
console.log(activationJob.data);Returns: (date-time), (enum: scheduled, on-demand), (array[object]), (date-time), (uuid), (string), (enum: created, in-process, completed, failed), (date-time)
activate_atactivation_typeactivation_windowscreated_atidrecord_typestatusupdated_at更新转网激活任务的激活时间。
PATCH /porting_orders/{id}/activation_jobs/{activationJobId}javascript
const activationJob = await client.portingOrders.activationJobs.update(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
{ id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },
);
console.log(activationJob.data);返回:(日期时间),(枚举:scheduled, on-demand),(array[object]),(日期时间),(uuid),(字符串),(枚举:created, in-process, completed, failed),(日期时间)
activate_atactivation_typeactivation_windowscreated_atidrecord_typestatusupdated_atList additional documents
列出附加文档
Returns a list of additional documents for a porting order.
GET /porting_orders/{id}/additional_documentsjavascript
// Automatically fetches more pages as needed.
for await (const additionalDocumentListResponse of client.portingOrders.additionalDocuments.list(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
)) {
console.log(additionalDocumentListResponse.id);
}Returns: (string), (date-time), (uuid), (enum: loa, invoice, csr, other), (string), (uuid), (uuid), (string), (date-time)
content_typecreated_atdocument_iddocument_typefilenameidporting_order_idrecord_typeupdated_at返回转网订单的附加文档列表。
GET /porting_orders/{id}/additional_documentsjavascript
// Automatically fetches more pages as needed.
for await (const additionalDocumentListResponse of client.portingOrders.additionalDocuments.list(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
)) {
console.log(additionalDocumentListResponse.id);
}返回:(字符串),(日期时间),(uuid),(枚举:loa, invoice, csr, other),(字符串),(uuid),(uuid),(字符串),(日期时间)
content_typecreated_atdocument_iddocument_typefilenameidporting_order_idrecord_typeupdated_atCreate a list of additional documents
创建附加文档列表
Creates a list of additional documents for a porting order.
POST /porting_orders/{id}/additional_documentsjavascript
const additionalDocument = await client.portingOrders.additionalDocuments.create(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);
console.log(additionalDocument.data);Returns: (string), (date-time), (uuid), (enum: loa, invoice, csr, other), (string), (uuid), (uuid), (string), (date-time)
content_typecreated_atdocument_iddocument_typefilenameidporting_order_idrecord_typeupdated_at为转网订单创建附加文档列表。
POST /porting_orders/{id}/additional_documentsjavascript
const additionalDocument = await client.portingOrders.additionalDocuments.create(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);
console.log(additionalDocument.data);返回:(字符串),(日期时间),(uuid),(枚举:loa, invoice, csr, other),(字符串),(uuid),(uuid),(字符串),(日期时间)
content_typecreated_atdocument_iddocument_typefilenameidporting_order_idrecord_typeupdated_atDelete an additional document
删除附加文档
Deletes an additional document for a porting order.
DELETE /porting_orders/{id}/additional_documents/{additional_document_id}javascript
await client.portingOrders.additionalDocuments.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
});删除转网订单的附加文档。
DELETE /porting_orders/{id}/additional_documents/{additional_document_id}javascript
await client.portingOrders.additionalDocuments.delete('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_windowsjavascript
const response = await client.portingOrders.retrieveAllowedFocWindows(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);
console.log(response.data);Returns: (date-time), (string), (date-time)
ended_atrecord_typestarted_at返回转网订单允许的FOC日期列表。
GET /porting_orders/{id}/allowed_foc_windowsjavascript
const response = await client.portingOrders.retrieveAllowedFocWindows(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);
console.log(response.data);返回:(日期时间),(字符串),(日期时间)
ended_atrecord_typestarted_atList all comments of a porting order
列出转网订单的所有评论
Returns a list of all comments of a porting order.
GET /porting_orders/{id}/commentsjavascript
// Automatically fetches more pages as needed.
for await (const commentListResponse of client.portingOrders.comments.list(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
)) {
console.log(commentListResponse.id);
}Returns: (string), (date-time), (uuid), (uuid), (string), (enum: admin, user, system)
bodycreated_atidporting_order_idrecord_typeuser_type返回转网订单的所有评论列表。
GET /porting_orders/{id}/commentsjavascript
// Automatically fetches more pages as needed.
for await (const commentListResponse of client.portingOrders.comments.list(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
)) {
console.log(commentListResponse.id);
}返回:(字符串),(日期时间),(uuid),(uuid),(字符串),(枚举:admin, user, system)
bodycreated_atidporting_order_idrecord_typeuser_typeCreate a comment for a porting order
为转网订单创建评论
Creates a new comment for a porting order.
POST /porting_orders/{id}/commentsOptional: (string)
bodyjavascript
const comment = await client.portingOrders.comments.create('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
console.log(comment.data);Returns: (string), (date-time), (uuid), (uuid), (string), (enum: admin, user, system)
bodycreated_atidporting_order_idrecord_typeuser_type为转网订单创建新评论。
POST /porting_orders/{id}/comments可选参数:(字符串)
bodyjavascript
const comment = await client.portingOrders.comments.create('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
console.log(comment.data);返回:(字符串),(日期时间),(uuid),(uuid),(字符串),(枚举:admin, user, system)
bodycreated_atidporting_order_idrecord_typeuser_typeDownload a porting order loa template
下载转网订单LOA模板
GET /porting_orders/{id}/loa_templatejavascript
const response = await client.portingOrders.retrieveLoaTemplate(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);
console.log(response);
const content = await response.blob();
console.log(content);GET /porting_orders/{id}/loa_templatejavascript
const response = await client.portingOrders.retrieveLoaTemplate(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);
console.log(response);
const content = await response.blob();
console.log(content);List porting order requirements
列出转网订单要求
Returns a list of all requirements based on country/number type for this porting order.
GET /porting_orders/{id}/requirementsjavascript
// Automatically fetches more pages as needed.
for await (const portingOrderRetrieveRequirementsResponse of client.portingOrders.retrieveRequirements(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
)) {
console.log(portingOrderRetrieveRequirementsResponse.field_type);
}Returns: (enum: document, textual), (string), (string), (string), (object)
field_typefield_valuerecord_typerequirement_statusrequirement_type返回基于国家/号码类型的转网订单所有要求列表。
GET /porting_orders/{id}/requirementsjavascript
// Automatically fetches more pages as needed.
for await (const portingOrderRetrieveRequirementsResponse of client.portingOrders.retrieveRequirements(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
)) {
console.log(portingOrderRetrieveRequirementsResponse.field_type);
}返回:(枚举:document, textual),(字符串),(字符串),(字符串),(对象)
field_typefield_valuerecord_typerequirement_statusrequirement_typeRetrieve the associated V1 sub_request_id and port_request_id
查询关联的V1 sub_request_id和port_request_id
GET /porting_orders/{id}/sub_requestjavascript
const response = await client.portingOrders.retrieveSubRequest(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);
console.log(response.data);Returns: (string), (string)
port_request_idsub_request_idGET /porting_orders/{id}/sub_requestjavascript
const response = await client.portingOrders.retrieveSubRequest(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);
console.log(response.data);返回:(字符串),(字符串)
port_request_idsub_request_idList verification codes
列出验证码
Returns a list of verification codes for a porting order.
GET /porting_orders/{id}/verification_codesjavascript
// Automatically fetches more pages as needed.
for await (const verificationCodeListResponse of client.portingOrders.verificationCodes.list(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
)) {
console.log(verificationCodeListResponse.id);
}Returns: (date-time), (uuid), (string), (uuid), (string), (date-time), (boolean)
created_atidphone_numberporting_order_idrecord_typeupdated_atverified返回转网订单的验证码列表。
GET /porting_orders/{id}/verification_codesjavascript
// Automatically fetches more pages as needed.
for await (const verificationCodeListResponse of client.portingOrders.verificationCodes.list(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
)) {
console.log(verificationCodeListResponse.id);
}返回:(日期时间),(uuid),(字符串),(uuid),(字符串),(日期时间),(布尔值)
created_atidphone_numberporting_order_idrecord_typeupdated_atverifiedSend the verification codes
发送验证码
Send the verification code for all porting phone numbers.
POST /porting_orders/{id}/verification_codes/sendjavascript
await client.portingOrders.verificationCodes.send('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');为所有转网电话号码发送验证码。
POST /porting_orders/{id}/verification_codes/sendjavascript
await client.portingOrders.verificationCodes.send('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/verifyjavascript
const response = await client.portingOrders.verificationCodes.verify(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);
console.log(response.data);Returns: (date-time), (uuid), (string), (uuid), (string), (date-time), (boolean)
created_atidphone_numberporting_order_idrecord_typeupdated_atverified验证电话号码列表的验证码。
POST /porting_orders/{id}/verification_codes/verifyjavascript
const response = await client.portingOrders.verificationCodes.verify(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
);
console.log(response.data);返回:(日期时间),(uuid),(字符串),(uuid),(字符串),(日期时间),(布尔值)
created_atidphone_numberporting_order_idrecord_typeupdated_atverifiedList action requirements for a porting order
列出转网订单的操作要求
Returns a list of action requirements for a specific porting order.
GET /porting_orders/{porting_order_id}/action_requirementsjavascript
// Automatically fetches more pages as needed.
for await (const actionRequirementListResponse of client.portingOrders.actionRequirements.list(
'porting_order_id',
)) {
console.log(actionRequirementListResponse.id);
}Returns: (string), (string | null), (string | null), (date-time), (string), (string), (enum: porting_action_requirement), (string), (enum: created, pending, completed, cancelled, failed), (date-time)
action_typeaction_urlcancel_reasoncreated_atidporting_order_idrecord_typerequirement_type_idstatusupdated_at返回特定转网订单的操作要求列表。
GET /porting_orders/{porting_order_id}/action_requirementsjavascript
// Automatically fetches more pages as needed.
for await (const actionRequirementListResponse of client.portingOrders.actionRequirements.list(
'porting_order_id',
)) {
console.log(actionRequirementListResponse.id);
}返回:(字符串),(字符串 | null),(字符串 | null),(日期时间),(字符串),(字符串),(枚举:porting_action_requirement),(字符串),(枚举:created, pending, completed, cancelled, failed),(日期时间)
action_typeaction_urlcancel_reasoncreated_atidporting_order_idrecord_typerequirement_type_idstatusupdated_atInitiate an action requirement
发起操作要求
Initiates a specific action requirement for a porting order.
POST /porting_orders/{porting_order_id}/action_requirements/{id}/initiatejavascript
const response = await client.portingOrders.actionRequirements.initiate('id', {
porting_order_id: '550e8400-e29b-41d4-a716-446655440000',
params: { first_name: 'John', last_name: 'Doe' },
});
console.log(response.data);Returns: (string), (string | null), (string | null), (date-time), (string), (string), (enum: porting_action_requirement), (string), (enum: created, pending, completed, cancelled, failed), (date-time)
action_typeaction_urlcancel_reasoncreated_atidporting_order_idrecord_typerequirement_type_idstatusupdated_at为转网订单发起特定的操作要求。
POST /porting_orders/{porting_order_id}/action_requirements/{id}/initiatejavascript
const response = await client.portingOrders.actionRequirements.initiate('id', {
porting_order_id: '550e8400-e29b-41d4-a716-446655440000',
params: { first_name: 'John', last_name: 'Doe' },
});
console.log(response.data);返回:(字符串),(字符串 | null),(字符串 | null),(日期时间),(字符串),(字符串),(枚举:porting_action_requirement),(字符串),(枚举:created, pending, completed, cancelled, failed),(日期时间)
action_typeaction_urlcancel_reasoncreated_atidporting_order_idrecord_typerequirement_type_idstatusupdated_atList all associated phone numbers
列出所有关联电话号码
Returns a list of all associated phone numbers for a porting order. Associated phone numbers are used for partial porting in GB to specify which phone numbers should be kept or disconnected.
GET /porting_orders/{porting_order_id}/associated_phone_numbersjavascript
// Automatically fetches more pages as needed.
for await (const portingAssociatedPhoneNumber of client.portingOrders.associatedPhoneNumbers.list(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
)) {
console.log(portingAssociatedPhoneNumber.id);
}Returns: (enum: keep, disconnect), (string), (date-time), (uuid), (object), (enum: landline, local, mobile, national, shared_cost, toll_free), (uuid), (string), (date-time)
actioncountry_codecreated_atidphone_number_rangephone_number_typeporting_order_idrecord_typeupdated_at返回转网订单的所有关联电话号码列表。关联电话号码用于英国地区的部分转网,以指定哪些号码应保留或注销。
GET /porting_orders/{porting_order_id}/associated_phone_numbersjavascript
// Automatically fetches more pages as needed.
for await (const portingAssociatedPhoneNumber of client.portingOrders.associatedPhoneNumbers.list(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
)) {
console.log(portingAssociatedPhoneNumber.id);
}返回:(枚举:keep, disconnect),(字符串),(日期时间),(uuid),(对象),(枚举:landline, local, mobile, national, shared_cost, toll_free),(uuid),(字符串),(日期时间)
actioncountry_codecreated_atidphone_number_rangephone_number_typeporting_order_idrecord_typeupdated_atCreate an associated phone number
创建关联电话号码
Creates a new associated phone number for a porting order. This is used for partial porting in GB to specify which phone numbers should be kept or disconnected.
POST /porting_orders/{porting_order_id}/associated_phone_numbersjavascript
const associatedPhoneNumber = await client.portingOrders.associatedPhoneNumbers.create(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
{
action: 'keep',
phone_number_range: {},
},
);
console.log(associatedPhoneNumber.data);Returns: (enum: keep, disconnect), (string), (date-time), (uuid), (object), (enum: landline, local, mobile, national, shared_cost, toll_free), (uuid), (string), (date-time)
actioncountry_codecreated_atidphone_number_rangephone_number_typeporting_order_idrecord_typeupdated_at为转网订单创建新的关联电话号码。此功能用于英国地区的部分转网,以指定哪些号码应保留或注销。
POST /porting_orders/{porting_order_id}/associated_phone_numbersjavascript
const associatedPhoneNumber = await client.portingOrders.associatedPhoneNumbers.create(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
{
action: 'keep',
phone_number_range: {},
},
);
console.log(associatedPhoneNumber.data);返回:(枚举:keep, disconnect),(字符串),(日期时间),(uuid),(对象),(枚举:landline, local, mobile, national, shared_cost, toll_free),(uuid),(字符串),(日期时间)
actioncountry_codecreated_atidphone_number_rangephone_number_typeporting_order_idrecord_typeupdated_atDelete an associated phone number
删除关联电话号码
Deletes an associated phone number from a porting order.
DELETE /porting_orders/{porting_order_id}/associated_phone_numbers/{id}javascript
const associatedPhoneNumber = await client.portingOrders.associatedPhoneNumbers.delete(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
{ porting_order_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },
);
console.log(associatedPhoneNumber.data);Returns: (enum: keep, disconnect), (string), (date-time), (uuid), (object), (enum: landline, local, mobile, national, shared_cost, toll_free), (uuid), (string), (date-time)
actioncountry_codecreated_atidphone_number_rangephone_number_typeporting_order_idrecord_typeupdated_at从转网订单中删除关联电话号码。
DELETE /porting_orders/{porting_order_id}/associated_phone_numbers/{id}javascript
const associatedPhoneNumber = await client.portingOrders.associatedPhoneNumbers.delete(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
{ porting_order_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },
);
console.log(associatedPhoneNumber.data);返回:(枚举:keep, disconnect),(字符串),(日期时间),(uuid),(对象),(枚举:landline, local, mobile, national, shared_cost, toll_free),(uuid),(字符串),(日期时间)
actioncountry_codecreated_atidphone_number_rangephone_number_typeporting_order_idrecord_typeupdated_atList all phone number blocks
列出所有号码块
Returns a list of all phone number blocks of a porting order.
GET /porting_orders/{porting_order_id}/phone_number_blocksjavascript
// Automatically fetches more pages as needed.
for await (const portingPhoneNumberBlock of client.portingOrders.phoneNumberBlocks.list(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
)) {
console.log(portingPhoneNumberBlock.id);
}Returns: (array[object]), (string), (date-time), (uuid), (object), (enum: landline, local, mobile, national, shared_cost, toll_free), (string), (date-time)
activation_rangescountry_codecreated_atidphone_number_rangephone_number_typerecord_typeupdated_at返回转网订单的所有号码块列表。
GET /porting_orders/{porting_order_id}/phone_number_blocksjavascript
// Automatically fetches more pages as needed.
for await (const portingPhoneNumberBlock of client.portingOrders.phoneNumberBlocks.list(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
)) {
console.log(portingPhoneNumberBlock.id);
}返回:(array[object]),(字符串),(日期时间),(uuid),(对象),(枚举:landline, local, mobile, national, shared_cost, toll_free),(字符串),(日期时间)
activation_rangescountry_codecreated_atidphone_number_rangephone_number_typerecord_typeupdated_atCreate a phone number block
创建号码块
Creates a new phone number block.
POST /porting_orders/{porting_order_id}/phone_number_blocksjavascript
const phoneNumberBlock = await client.portingOrders.phoneNumberBlocks.create(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
{
activation_ranges: [{ end_at: '+4930244999910', start_at: '+4930244999901' }],
phone_number_range: { end_at: '+4930244999910', start_at: '+4930244999901' },
},
);
console.log(phoneNumberBlock.data);Returns: (array[object]), (string), (date-time), (uuid), (object), (enum: landline, local, mobile, national, shared_cost, toll_free), (string), (date-time)
activation_rangescountry_codecreated_atidphone_number_rangephone_number_typerecord_typeupdated_at创建新的号码块。
POST /porting_orders/{porting_order_id}/phone_number_blocksjavascript
const phoneNumberBlock = await client.portingOrders.phoneNumberBlocks.create(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
{
activation_ranges: [{ end_at: '+4930244999910', start_at: '+4930244999901' }],
phone_number_range: { end_at: '+4930244999910', start_at: '+4930244999901' },
},
);
console.log(phoneNumberBlock.data);返回:(array[object]),(字符串),(日期时间),(uuid),(对象),(枚举:landline, local, mobile, national, shared_cost, toll_free),(字符串),(日期时间)
activation_rangescountry_codecreated_atidphone_number_rangephone_number_typerecord_typeupdated_atDelete a phone number block
删除号码块
Deletes a phone number block.
DELETE /porting_orders/{porting_order_id}/phone_number_blocks/{id}javascript
const phoneNumberBlock = await client.portingOrders.phoneNumberBlocks.delete(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
{ porting_order_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },
);
console.log(phoneNumberBlock.data);Returns: (array[object]), (string), (date-time), (uuid), (object), (enum: landline, local, mobile, national, shared_cost, toll_free), (string), (date-time)
activation_rangescountry_codecreated_atidphone_number_rangephone_number_typerecord_typeupdated_at删除号码块。
DELETE /porting_orders/{porting_order_id}/phone_number_blocks/{id}javascript
const phoneNumberBlock = await client.portingOrders.phoneNumberBlocks.delete(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
{ porting_order_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },
);
console.log(phoneNumberBlock.data);返回:(array[object]),(字符串),(日期时间),(uuid),(对象),(枚举:landline, local, mobile, national, shared_cost, toll_free),(字符串),(日期时间)
activation_rangescountry_codecreated_atidphone_number_rangephone_number_typerecord_typeupdated_atList all phone number extensions
列出所有号码分机
Returns a list of all phone number extensions of a porting order.
GET /porting_orders/{porting_order_id}/phone_number_extensionsjavascript
// Automatically fetches more pages as needed.
for await (const portingPhoneNumberExtension of client.portingOrders.phoneNumberExtensions.list(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
)) {
console.log(portingPhoneNumberExtension.id);
}Returns: (array[object]), (date-time), (object), (uuid), (uuid), (string), (date-time)
activation_rangescreated_atextension_rangeidporting_phone_number_idrecord_typeupdated_at返回转网订单的所有号码分机列表。
GET /porting_orders/{porting_order_id}/phone_number_extensionsjavascript
// Automatically fetches more pages as needed.
for await (const portingPhoneNumberExtension of client.portingOrders.phoneNumberExtensions.list(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
)) {
console.log(portingPhoneNumberExtension.id);
}返回:(array[object]),(日期时间),(对象),(uuid),(uuid),(字符串),(日期时间)
activation_rangescreated_atextension_rangeidporting_phone_number_idrecord_typeupdated_atCreate a phone number extension
创建号码分机
Creates a new phone number extension.
POST /porting_orders/{porting_order_id}/phone_number_extensionsjavascript
const phoneNumberExtension = await client.portingOrders.phoneNumberExtensions.create(
'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',
},
);
console.log(phoneNumberExtension.data);Returns: (array[object]), (date-time), (object), (uuid), (uuid), (string), (date-time)
activation_rangescreated_atextension_rangeidporting_phone_number_idrecord_typeupdated_at创建新的号码分机。
POST /porting_orders/{porting_order_id}/phone_number_extensionsjavascript
const phoneNumberExtension = await client.portingOrders.phoneNumberExtensions.create(
'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',
},
);
console.log(phoneNumberExtension.data);返回:(array[object]),(日期时间),(对象),(uuid),(uuid),(字符串),(日期时间)
activation_rangescreated_atextension_rangeidporting_phone_number_idrecord_typeupdated_atDelete a phone number extension
删除号码分机
Deletes a phone number extension.
DELETE /porting_orders/{porting_order_id}/phone_number_extensions/{id}javascript
const phoneNumberExtension = await client.portingOrders.phoneNumberExtensions.delete(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
{ porting_order_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },
);
console.log(phoneNumberExtension.data);Returns: (array[object]), (date-time), (object), (uuid), (uuid), (string), (date-time)
activation_rangescreated_atextension_rangeidporting_phone_number_idrecord_typeupdated_at删除号码分机。
DELETE /porting_orders/{porting_order_id}/phone_number_extensions/{id}javascript
const phoneNumberExtension = await client.portingOrders.phoneNumberExtensions.delete(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
{ porting_order_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },
);
console.log(phoneNumberExtension.data);返回:(array[object]),(日期时间),(对象),(uuid),(uuid),(字符串),(日期时间)
activation_rangescreated_atextension_rangeidporting_phone_number_idrecord_typeupdated_atList all porting phone numbers
列出所有转网电话号码
Returns a list of your porting phone numbers.
GET /porting_phone_numbersjavascript
// Automatically fetches more pages as needed.
for await (const portingPhoneNumberListResponse of client.portingPhoneNumbers.list()) {
console.log(portingPhoneNumberListResponse.porting_order_id);
}Returns: (enum: New, Pending, Conflict, Cancel Pending, Failed, Concurred, Activate RDY, Disconnect Pending, Concurrence Sent, Old, Sending, Active, Cancelled), (string), (enum: landline, local, mobile, national, shared_cost, toll_free), (enum: pending, confirmed, provisional), (uuid), (enum: draft, in-process, submitted, exception, foc-date-confirmed, cancel-pending, ported, cancelled), (string), (enum: requirement-info-pending, requirement-info-under-review, requirement-info-exception, approved), (string)
activation_statusphone_numberphone_number_typeportability_statusporting_order_idporting_order_statusrecord_typerequirements_statussupport_key返回您的转网电话号码列表。
GET /porting_phone_numbersjavascript
// Automatically fetches more pages as needed.
for await (const portingPhoneNumberListResponse of client.portingPhoneNumbers.list()) {
console.log(portingPhoneNumberListResponse.porting_order_id);
}返回:(枚举:New, Pending, Conflict, Cancel Pending, Failed, Concurred, Activate RDY, Disconnect Pending, Concurrence Sent, Old, Sending, Active, Cancelled),(字符串),(枚举:landline, local, mobile, national, shared_cost, toll_free),(枚举:pending, confirmed, provisional),(uuid),(枚举:draft, in-process, submitted, exception, foc-date-confirmed, cancel-pending, ported, cancelled),(字符串),(枚举:requirement-info-pending, requirement-info-under-review, requirement-info-exception, approved),(字符串)
activation_statusphone_numberphone_number_typeportability_statusporting_order_idporting_order_statusrecord_typerequirements_statussupport_key