List all addresses
Returns a paginated list of the addresses on your account, with support for filtering and sorting.
GET
/
addresses
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 address of client.addresses.list()) {
console.log(address.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.addresses.list()
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.Addresses.List(context.TODO(), telnyx.AddressListParams{})
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.addresses.AddressListPage;
import com.telnyx.sdk.models.addresses.AddressListParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
AddressListPage page = client.addresses().list();
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
page = telnyx.addresses.list
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->addresses->list(
filter: [
'addressBook' => ['eq' => 'eq'],
'customerReference' => 'string',
'streetAddress' => ['contains' => 'contains'],
'usedAsEmergency' => 'used_as_emergency',
],
pageNumber: 0,
pageSize: 0,
sort: 'street_address',
);
var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx addresses list \
--api-key 'My API Key'curl --request GET \
--url https://api.telnyx.com/v2/addresses \
--header 'Authorization: Bearer <token>'{
"data": [
{
"id": "1293384261075731499",
"record_type": "address",
"customer_reference": "MY REF 001",
"first_name": "Alfred",
"last_name": "Foster",
"business_name": "Toy-O'Kon",
"phone_number": "+12125559000",
"street_address": "600 Congress Avenue",
"extended_address": "14th Floor",
"locality": "Austin",
"administrative_area": "TX",
"neighborhood": "Ciudad de los deportes",
"borough": "Guadalajara",
"postal_code": "78701",
"country_code": "US",
"address_book": false,
"validate_address": true,
"created_at": "2018-02-02T22:25:27.521Z",
"updated_at": "2018-02-02T22:25:27.521Z"
}
],
"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.
Query Parameters
Consolidated page parameter (deepObject style). Originally: page[number], page[size]
Show child attributes
Show child attributes
Consolidated filter parameter (deepObject style). Originally: filter[customer_reference][eq], filter[customer_reference][contains], filter[used_as_emergency], filter[street_address][contains], filter[address_book][eq]
Show child attributes
Show child attributes
Specifies the sort order for results. By default sorting direction is ascending. To have the results sorted in descending order add the - prefix.
That is:
-
street_address: sorts the result by thestreet_addressfield in ascending order. -
-street_address: sorts the result by thestreet_addressfield in descending order.
If not given, results are sorted by
created_at in descending order.Available options:
created_at, first_name, last_name, business_name, street_address Example:
"street_address"
Was this page helpful?
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 address of client.addresses.list()) {
console.log(address.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.addresses.list()
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.Addresses.List(context.TODO(), telnyx.AddressListParams{})
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.addresses.AddressListPage;
import com.telnyx.sdk.models.addresses.AddressListParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
AddressListPage page = client.addresses().list();
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
page = telnyx.addresses.list
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->addresses->list(
filter: [
'addressBook' => ['eq' => 'eq'],
'customerReference' => 'string',
'streetAddress' => ['contains' => 'contains'],
'usedAsEmergency' => 'used_as_emergency',
],
pageNumber: 0,
pageSize: 0,
sort: 'street_address',
);
var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx addresses list \
--api-key 'My API Key'curl --request GET \
--url https://api.telnyx.com/v2/addresses \
--header 'Authorization: Bearer <token>'{
"data": [
{
"id": "1293384261075731499",
"record_type": "address",
"customer_reference": "MY REF 001",
"first_name": "Alfred",
"last_name": "Foster",
"business_name": "Toy-O'Kon",
"phone_number": "+12125559000",
"street_address": "600 Congress Avenue",
"extended_address": "14th Floor",
"locality": "Austin",
"administrative_area": "TX",
"neighborhood": "Ciudad de los deportes",
"borough": "Guadalajara",
"postal_code": "78701",
"country_code": "US",
"address_book": false,
"validate_address": true,
"created_at": "2018-02-02T22:25:27.521Z",
"updated_at": "2018-02-02T22:25:27.521Z"
}
],
"meta": {
"total_pages": 3,
"total_results": 55,
"page_number": 2,
"page_size": 25
}
}