List 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_numbers
JavaScript
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);
}import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
page = client.porting_orders.associated_phone_numbers.list(
porting_order_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
page = page.data[0]
print(page.id)package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
page, err := client.PortingOrders.AssociatedPhoneNumbers.List(
context.TODO(),
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
telnyx.PortingOrderAssociatedPhoneNumberListParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.portingorders.associatedphonenumbers.AssociatedPhoneNumberListPage;
import com.telnyx.sdk.models.portingorders.associatedphonenumbers.AssociatedPhoneNumberListParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
AssociatedPhoneNumberListPage page = client.portingOrders().associatedPhoneNumbers().list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
page = telnyx.porting_orders.associated_phone_numbers.list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
puts(page)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$page = $client->portingOrders->associatedPhoneNumbers->list(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
filter: ['action' => 'keep', 'phoneNumber' => '+441234567890'],
pageNumber: 0,
pageSize: 0,
sort: ['value' => '-created_at'],
);
var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx porting-orders:associated-phone-numbers list \
--api-key 'My API Key' \
--porting-order-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26ecurl --request GET \
--url https://api.telnyx.com/v2/porting_orders/{porting_order_id}/associated_phone_numbers \
--header 'Authorization: Bearer <token>'{
"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,
"total_results": 55,
"page_number": 2,
"page_size": 25
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Identifies the Porting Order associated with the phone numbers
Query Parameters
Consolidated page parameter (deepObject style). Originally: page[size], page[number]
Show child attributes
Show child attributes
Consolidated filter parameter (deepObject style). Originally: filter[phone_number], filter[action]
Show child attributes
Show child attributes
Consolidated sort parameter (deepObject style). Originally: sort[value]
Show child attributes
Show child attributes
Was this page helpful?
⌘I
JavaScript
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);
}import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
page = client.porting_orders.associated_phone_numbers.list(
porting_order_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
page = page.data[0]
print(page.id)package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
page, err := client.PortingOrders.AssociatedPhoneNumbers.List(
context.TODO(),
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
telnyx.PortingOrderAssociatedPhoneNumberListParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.portingorders.associatedphonenumbers.AssociatedPhoneNumberListPage;
import com.telnyx.sdk.models.portingorders.associatedphonenumbers.AssociatedPhoneNumberListParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
AssociatedPhoneNumberListPage page = client.portingOrders().associatedPhoneNumbers().list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
page = telnyx.porting_orders.associated_phone_numbers.list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
puts(page)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$page = $client->portingOrders->associatedPhoneNumbers->list(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
filter: ['action' => 'keep', 'phoneNumber' => '+441234567890'],
pageNumber: 0,
pageSize: 0,
sort: ['value' => '-created_at'],
);
var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx porting-orders:associated-phone-numbers list \
--api-key 'My API Key' \
--porting-order-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26ecurl --request GET \
--url https://api.telnyx.com/v2/porting_orders/{porting_order_id}/associated_phone_numbers \
--header 'Authorization: Bearer <token>'{
"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,
"total_results": 55,
"page_number": 2,
"page_size": 25
}
}