List Numbers using Channel Billing for a specific Zone
Retrieve a list of phone numbers using Channel Billing for a specific Zone.
GET
/
list
/
{channel_zone_id}
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.list.retrieveByZone('channel_zone_id');
console.log(response.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
response = client.list.retrieve_by_zone(
"channel_zone_id",
)
print(response.data)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"),
)
response, err := client.List.GetByZone(context.TODO(), "channel_zone_id")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.list.ListRetrieveByZoneParams;
import com.telnyx.sdk.models.list.ListRetrieveByZoneResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
ListRetrieveByZoneResponse response = client.list().retrieveByZone("channel_zone_id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.list.retrieve_by_zone("channel_zone_id")
puts(response)<?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 {
$response = $client->list->retrieveByZone('channel_zone_id');
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx list retrieve-by-zone \
--api-key 'My API Key' \
--channel-zone-id channel_zone_idcurl --request GET \
--url https://api.telnyx.com/v2/list/{channel_zone_id} \
--header 'Authorization: Bearer <token>'{
"data": [
{
"zone_name": "Euro channel zone",
"zone_id": "1653e6a1-4bfd-4857-97c6-6a51e1c34477",
"number_of_channels": 7,
"numbers": [
{
"number": "+15554441234",
"country": "FR"
}
]
}
],
"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
Channel zone identifier
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
});
const response = await client.list.retrieveByZone('channel_zone_id');
console.log(response.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
response = client.list.retrieve_by_zone(
"channel_zone_id",
)
print(response.data)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"),
)
response, err := client.List.GetByZone(context.TODO(), "channel_zone_id")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.list.ListRetrieveByZoneParams;
import com.telnyx.sdk.models.list.ListRetrieveByZoneResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
ListRetrieveByZoneResponse response = client.list().retrieveByZone("channel_zone_id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.list.retrieve_by_zone("channel_zone_id")
puts(response)<?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 {
$response = $client->list->retrieveByZone('channel_zone_id');
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx list retrieve-by-zone \
--api-key 'My API Key' \
--channel-zone-id channel_zone_idcurl --request GET \
--url https://api.telnyx.com/v2/list/{channel_zone_id} \
--header 'Authorization: Bearer <token>'{
"data": [
{
"zone_name": "Euro channel zone",
"zone_id": "1653e6a1-4bfd-4857-97c6-6a51e1c34477",
"number_of_channels": 7,
"numbers": [
{
"number": "+15554441234",
"country": "FR"
}
]
}
],
"meta": {
"total_pages": 3,
"total_results": 55,
"page_number": 2,
"page_size": 25
}
}