Skip to main content
GET
/
user
/
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 userAddress of client.userAddresses.list()) {
  console.log(userAddress.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.user_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.UserAddresses.List(context.TODO(), telnyx.UserAddressListParams{})
	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.useraddresses.UserAddressListPage;
import com.telnyx.sdk.models.useraddresses.UserAddressListParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        TelnyxClient client = TelnyxOkHttpClient.fromEnv();

        UserAddressListPage page = client.userAddresses().list();
    }
}
require "telnyx"

telnyx = Telnyx::Client.new(api_key: "My API Key")

page = telnyx.user_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->userAddresses->list(
    filter: [
      'customerReference' => ['contains' => 'contains', 'eq' => 'eq'],
      'streetAddress' => ['contains' => 'contains'],
    ],
    pageNumber: 0,
    pageSize: 0,
    sort: 'street_address',
  );

  var_dump($page);
} catch (APIException $e) {
  echo $e->getMessage();
}
telnyx user-addresses list \
  --api-key 'My API Key'
curl --request GET \
  --url https://api.telnyx.com/v2/user/addresses \
  --header 'Authorization: Bearer <token>'
{
  "data": [
    {
      "id": "c3527e69-dc5a-4b3e-8f44-99d209f83c1d",
      "record_type": "user_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",
      "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

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

page
object

Consolidated page parameter (deepObject style). Originally: page[size], page[number]

filter
object

Consolidated filter parameter (deepObject style). Originally: filter[customer_reference][eq], filter[customer_reference][contains], filter[street_address][contains]

sort
enum<string>
default:created_at

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 the street_address field in ascending order.
  • -street_address: sorts the result by the street_address field 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"

Response

Successful response

data
UserAddress · object[]
meta
object