import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const portingAssociatedPhoneNumber of client.portingOrders.associatedPhoneNumbers.list(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
)) {
console.log(portingAssociatedPhoneNumber.id);
}{
"data": [
{
"id": "f24151b6-3389-41d3-8747-7dd8c681e5e2",
"porting_order_id": "a24151b6-3389-41d3-8747-7dd8c681e5e2",
"country_code": "GB",
"phone_number_type": "local",
"phone_number_range": {
"start_at": "+441234567890",
"end_at": "+441234567899"
},
"action": "keep",
"record_type": "porting_associated_phone_number",
"created_at": "2021-03-19T10:07:15.527Z",
"updated_at": "2021-03-19T10:07:15.527Z"
}
],
"meta": {
"total_pages": 3,
"page_number": 2,
"total_results": 55,
"page_size": 25
}
}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.
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const portingAssociatedPhoneNumber of client.portingOrders.associatedPhoneNumbers.list(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
)) {
console.log(portingAssociatedPhoneNumber.id);
}{
"data": [
{
"id": "f24151b6-3389-41d3-8747-7dd8c681e5e2",
"porting_order_id": "a24151b6-3389-41d3-8747-7dd8c681e5e2",
"country_code": "GB",
"phone_number_type": "local",
"phone_number_range": {
"start_at": "+441234567890",
"end_at": "+441234567899"
},
"action": "keep",
"record_type": "porting_associated_phone_number",
"created_at": "2021-03-19T10:07:15.527Z",
"updated_at": "2021-03-19T10:07:15.527Z"
}
],
"meta": {
"total_pages": 3,
"page_number": 2,
"total_results": 55,
"page_size": 25
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Identifies the Porting Order associated with the phone numbers
Consolidated filter parameter (deepObject style). Originally: filter[phone_number], filter[action]
Consolidated sort parameter (deepObject style). Originally: sort[value]
Show child attributes
Specifies the sort order for results. If not given, results are sorted by created_at in descending order
-created_at, created_at "-created_at"
Successful response
Show child attributes
Uniquely identifies this associated phone number.
"f24151b6-3389-41d3-8747-7dd8c681e5e2"
Identifies the porting order associated with this phone number.
"a24151b6-3389-41d3-8747-7dd8c681e5e2"
Specifies the country code for this associated phone number. It is a two-letter ISO 3166-1 alpha-2 country code.
"GB"
Specifies the phone number type for this associated phone number.
landline, local, mobile, national, shared_cost, toll_free "local"
Specifies the phone number range for this associated phone number.
Specifies the action to take with this phone number during partial porting.
keep, disconnect "keep"
Identifies the type of the resource.
"porting_associated_phone_number"
ISO 8601 formatted date indicating when the resource was created.
"2021-03-19T10:07:15.527Z"
ISO 8601 formatted date indicating when the resource was last updated.
"2021-03-19T10:07:15.527Z"
Was this page helpful?