REST API: アドレス

アドレスインスタンスはお客さまの実際の場所を表します。電話番号の購入し所有するために、認証機関がユーザーの名前や住所をTwilioに保管することを求める国があります。

アドレスは国名、会社名、場所、フレンドリーネームが含まれます。それぞれのアドレスは親アカウントもしくはサブアカウントで作成され、電話番号の購入時に利用されます。アドレス を作成すると、複数電話番号保有、住所が必要な電話番号の購入要件を満たし、IncomingPhoneNumberリソースから購入を行えます。アドレスの必要条件はAvailablePhoneNumberのプロパティとしてご覧いただけます。

アドレスリストリソースはTwilioアカウントに作成されたすべてのアドレスのリストを表します。Addresses に POSTすることにより、新しい住所を作成・現存の住所を修正できます。

Address インスタンスリソース

リソース URI

/2010-04-01/Accounts/{AccountSid}/Addresses/{AddressSid}

リソースのプロパティ

プロパティ 説明
Sid このアドレスを識別する 34 文字の文字列です。
AccountSid アドレスに関連するアカウントのユニーク ID です。
FriendlyName アドレス の人間が読みやすい形式の説明です。最大64文字です。
CustomerName 名前もしくは顧客名
Street アカウント保有者、顧客の 番地、その他詳細
住所3(市区町村) 市、区
Region 都道府県
PostalCode 郵便番号
IsoCountry ISO国コード 日本は 392
Uri このリソースの URI です。https://api.twilio.com からの相対パスです。
EmergencyEnabled This is a value that indicates if emergency calling has been enabled on this number. Possible values are true or false.
Validated In some countries, addresses are validated to comply with local regulation. In those countries, if the address you provide does not pass validation, it will not be accepted as an Address. This value will be true if the Address has been validated, or false for countries that don't require validation or if the Address is non-compliant.

HTTP GET

インスタンスを取得する例 1
  • C#
  • curl
  • Java
  • Node.js
  • PHP
  • Python
  • Ruby
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
  • xml
SDKバージョン:
  • 6.x
  • 7.x
SDKバージョン:
  • 2.x
  • 3.x
SDKバージョン:
  • 4.x
  • 5.x
SDKバージョン:
  • 5.x
  • 6.x
SDKバージョン:
  • 4.x
  • 5.x
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        TwilioClient.Init(accountSid, authToken);

        var address = AddressResource.Fetch("AD2a0747eba6abf96b7e3c3ff0b4530f6e");

        Console.WriteLine(address.CustomerName);
    }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

// Get an object from its sid. If you do not have a sid,
// check out the list resource examples on this page
$address = $client
    ->addresses("AD2a0747eba6abf96b7e3c3ff0b4530f6e")
    ->fetch();

echo $address->customerName;
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

address = client.addresses.get("AP2a0747eba6abf96b7e3c3ff0b4530f6e")
print(address.customer_name)
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# Initialize Twilio Client
@client = Twilio::REST::Client.new(account_sid, auth_token)

# Get an object from its sid. If you do not have a sid,
# check out the list resource examples on this page
@address = @client.account.addresses('AP2a0747eba6abf96b7e3c3ff0b4530f6e').fetch

puts @address.customer_name
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses/AD2a0747eba6abf96b7e3c3ff0b4530f6e.json \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses/AP2a0747eba6abf96b7e3c3ff0b4530f6e \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.Address;

public class Example {

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

    // Get an object from its sid. If you do not have a sid,
    // check out the list resource examples on this page
    Address address = client.getAccount().getAddress("AD2a0747eba6abf96b7e3c3ff0b4530f6e");
    System.out.println(address.getCustomerName());

  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)

address = client.addresses("AP2a0747eba6abf96b7e3c3ff0b4530f6e") \
                .fetch()

print(address.customer_name)
// Download the Node helper library from twilio.com/docs/node/install
// These identifiers are your accountSid and authToken from
// https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.addresses('AD2a0747eba6abf96b7e3c3ff0b4530f6e')
  .fetch()
  .then((address) => console.log(address.customerName));
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example
{
  static void Main(string[] args)
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    var app = twilio.GetAddress("AD2a0747eba6abf96b7e3c3ff0b4530f6e");

    Console.WriteLine(app.CustomerName);
  }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Services_Twilio($sid, $token);

// Get an object from its sid. If you do not have a sid,
// check out the list resource examples on this page
$address = $client->account->addresses->get("AD2a0747eba6abf96b7e3c3ff0b4530f6e");
echo $address->customer_name;
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token

# Get an object from its sid. If you do not have a sid,
# check out the list resource examples on this page
@address = @client.account.addresses.get("AP2a0747eba6abf96b7e3c3ff0b4530f6e")
puts @address.customer_name
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.rest.api.v2010.account.Address;

public class Example {
  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    // Get an object from its sid. If you do not have a sid,
    // check out the list resource examples on this page
    Address address = Address.fetcher("AD2a0747eba6abf96b7e3c3ff0b4530f6e").fetch();

    System.out.println(address.getCustomerName());
  }
}
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.addresses("AD2a0747eba6abf96b7e3c3ff0b4530f6e").get(function(err, address) {
    console.log(address.customerName);
});
出力を表示
  • JSON
  • XML
{
    "sid": "AD2a0747eba6abf96b7e3c3ff0b4530f6e",
    "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "friendly_name": "Billing - Customer 123",
    "customer_name": "Customer 123",
    "street": "1 Hasselhoff Lane",
    "city": "Berlin",
    "region": "Berlin",
    "postal_code": "10785",
    "iso_country": "DE",
}
<TwilioResponse>
	<Address>
		<Sid>AD2a0747eba6abf96b7e3c3ff0b4530f6e</Sid>
		<DateCreated>Mon, 16 Aug 2010 23:00:23 +0000</DateCreated>
		<DateUpdated>Mon, 16 Aug 2010 23:00:23 +0000</DateUpdated>
		<AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
		<FriendlyName>Billing - Customer 123</FriendlyName>
		<CustomerName>Customer 123</CustomerName>
		<Street>1 Hasselhoff Lane</Street>
		<City>Berlin</City>
		<Region>Berlin</Region>
		<PostalCode>10785</PostalCode>
		<IsoCountry>DE</IsoCountry>
		<Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses/AD2a0747eba6abf96b7e3c3ff0b4530f6e</Uri>
	</Address>
</TwilioResponse>
インスタンスを取得する例 1

HTTP POST

POSTリクエストが成功すると、現住所をアップデートしアップデートされた情報を返します。HTTP GET と同じリターンコードを返します。

注 : IsoCountryもPOSTリクエストで変更できます。IsoCountryをアップデートするためには新しいアドレスが作成される必要があります。

オプションパラメーター

下記の1つ以上のパラメータをアップデートの際含める必要があります。

パラメーター 説明
Sid このアドレスを識別する 34 文字の文字列です。
AccountSid アドレスに関連するアカウントのユニーク ID です。
FriendlyName アドレス の人間が読みやすい形式の説明です。最大64文字です。
CustomerName 名前もしくは顧客名
Street アカウント保有者、顧客の 番地、その他詳細
住所3(市区町村) 市、区
Region 都道府県
PostalCode 郵便番号

名前と番地をそれぞれ ‘Customer 456’ と ‘2 Hasselhoff Lane’ に変更します。

インスタンスをポストする例 1
  • C#
  • curl
  • Java
  • Node.js
  • PHP
  • Python
  • Ruby
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
  • xml
SDKバージョン:
  • 6.x
  • 7.x
SDKバージョン:
  • 2.x
  • 3.x
SDKバージョン:
  • 4.x
  • 5.x
SDKバージョン:
  • 5.x
  • 6.x
SDKバージョン:
  • 4.x
  • 5.x
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        TwilioClient.Init(accountSid, authToken);

        const string addressSid = "AD2a0747eba6abf96b7e3c3ff0b4530f6e";
        AddressResource.Update(addressSid,
                               customerName: "Customer 456",
                               street: "2 Hasselhoff Lane");
    }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

// Get an object from its sid. If you do not have a sid,
// check out the list resource examples on this page
$address = $client
    ->addresses("AD2a0747eba6abf96b7e3c3ff0b4530f6e")
    ->update(
        array(
            'customerName' => 'Customer 456',
            'street' => '2 Hasselhoff Lane'
        )
    );

echo $address->customerName;
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

address = client.addresses.update(
    "AD2a0747eba6abf96b7e3c3ff0b4530f6e",
    customer_name="Customer 456",
    street="2 Hasselhoff Lane")
print(address.customer_name)
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# Initialize Twilio Client
@client = Twilio::REST::Client.new account_sid, auth_token

# Get an object from its sid. If you do not have a sid,
# check out the list resource examples on this page
@address = @client.account.addresses('AD2a0747eba6abf96b7e3c3ff0b4530f6e').fetch

@address.update(
  customer_name: 'Customer 456',
  street: '2 Hasselhoff Lane'
)

puts @address.customer_name
$ curl -XPOST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses/AD2a0747eba6abf96b7e3c3ff0b4530f6e.json \
-d "CustomerName=Customer 456" \
-d "Street=2 Hasselhoff Lane" \
-u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -XPOST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses/AD2a0747eba6abf96b7e3c3ff0b4530f6e \
    -d "CustomerName=Customer 456" \
    -d "Street=2 Hasselhoff Lane" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.Address;
import com.twilio.sdk.resource.list.AddressList;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;

public class Example {

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

    // Get an object from its sid. If you do not have a sid,
    // check out the list resource examples on this page
    Address address = client.getAccount().getAddress("AD2a0747eba6abf96b7e3c3ff0b4530f6e");
    // Build a filter for the AddressList
    List<NameValuePair> params = new ArrayList<NameValuePair>();
    params.add(new BasicNameValuePair("CustomerName", "Customer 456"));
    params.add(new BasicNameValuePair("Street", "2 Hasselhoff Lane"));
    address.update(params);

  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)

address = client.addresses("AD2a0747eba6abf96b7e3c3ff0b4530f6e") \
                .update(customer_name="Customer 456",
                        street="2 Hasselhoff Lane")

print(address.customer_name)
// Download the Node helper library from twilio.com/docs/node/install
// These identifiers are your accountSid and authToken from
// https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.addresses('AD2a0747eba6abf96b7e3c3ff0b4530f6e')
  .update({
    customerName: 'Customer 456',
    street: '2 Hasselhoff Lane',
  })
  .then((address) => console.log(address.customerName));
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example
{
  static void Main(string[] args)
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    var options = new AddressOptions();
    options.CustomerName = "Customer 456";
    options.Street = "2 Hasselhoff Lane";

    twilio.UpdateAddress("AD2a0747eba6abf96b7e3c3ff0b4530f6e", options);
  }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Services_Twilio($sid, $token);

// Get an object from its sid. If you do not have a sid,
// check out the list resource examples on this page
$address = $client->account->addresses->get("AD2a0747eba6abf96b7e3c3ff0b4530f6e");
$address->update(array(
        "CustomerName" => "Customer 456",
        "Street" => "2 Hasselhoff Lane"
    ));
echo $address->customer_name;
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token

# Get an object from its sid. If you do not have a sid,
# check out the list resource examples on this page
@address = @client.account.addresses.get("AD2a0747eba6abf96b7e3c3ff0b4530f6e")
@address.update(customer_name: "Customer 456",
  street: "2 Hasselhoff Lane")
puts @address.customer_name
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.rest.api.v2010.account.Address;

public class Example {
  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    // Get an object from its sid. If you do not have a sid,
    // check out the list resource examples on this page
    Address address = Address.updater("AD2a0747eba6abf96b7e3c3ff0b4530f6e")
        .setCustomerName("Customer 456").setStreet("2 Hasselhoff Lane").update();

    System.out.println(address.getDateUpdated());
  }
}
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.addresses("AD2a0747eba6abf96b7e3c3ff0b4530f6e").post({
    customerName: "Customer 456",
    street: "2 Hasselhoff Lane"
}, function(err, address) {
    console.log(address.customerName);
});
出力を表示
  • JSON
  • XML
{
    "sid": "AD2a0747eba6abf96b7e3c3ff0b4530f6e",
    "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "friendly_name": "Billing - Customer 123",
    "customer_name": "Customer 456",
    "street": "2 Hasselhoff Lane",
    "city": "Berlin",
    "region": "Berlin",
    "postal_code": "10785",
    "iso_country": "DE",
}
<TwilioResponse>
	<Address>
		<Sid>AD2a0747eba6abf96b7e3c3ff0b4530f6e</Sid>
		<DateCreated>Mon, 16 Aug 2010 23:00:23 +0000</DateCreated>
		<DateUpdated>Mon, 16 Aug 2010 23:00:23 +0000</DateUpdated>
		<AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
		<FriendlyName>Billing - Customer 123</FriendlyName>
		<CustomerName>Customer 456</CustomerName>
		<Street>2 Hasselhoff Lane</Street>
		<City>Berlin</City>
		<Region>Berlin</Region>
		<PostalCode>10785</PostalCode>
		<IsoCountry>DE</IsoCountry>
		<ApiVersion>2010-04-01</ApiVersion>
		<Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses/AD2a0747eba6abf96b7e3c3ff0b4530f6e</Uri>
	</Address>
</TwilioResponse>
インスタンスをポストする例 1

HTTP PUT

サポートしません。

HTTP DELETE

アドレスを削除します。

アドレスが必要でかつ利用しているIncomingPhoneNumberを削除しようとした場合21625のエラーが帰ります。AddressRequirementを満たす2番目のアドレスを持っている場合、アドレスを削除は成功します。DependentPhoneNumbers インスタンスサブリソースは どの IncomingPhoneNumber がアドレスを必要か確認することができます。

削除に成功すると、本文(Body)のない HTTP 204 レスポンスを返します。

アドレスリストリソース

リソース URI

/2010-04-01/Accounts/{AccountSid}/Addresses

HTTP GET

Application リソース表現のリストを返します。各項目は、アカウント内のアプリケーションを表現します。 このリストは ページ情報を含みます。

リスト フィルター

次のクエリ パラメーターを使って、返却されるリストに制限を加えます。 パラメーターの大文字と小文字は区別されます。

パラメーター 説明
CustomerName CustomerNameが一致するアカウント リソースのみを返します。
FriendlyName FriendlyName が一致するアドレス リソースのみを返します。
IsoCountry この国のアドレスリソースを返します

例 1

すべてのアドレスを表示する

リストを取得する例 1
  • C#
  • curl
  • Java
  • Node.js
  • PHP
  • Python
  • Ruby
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
  • xml
SDKバージョン:
  • 6.x
  • 7.x
SDKバージョン:
  • 2.x
  • 3.x
SDKバージョン:
  • 4.x
  • 5.x
SDKバージョン:
  • 5.x
  • 6.x
SDKバージョン:
  • 4.x
  • 5.x
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        TwilioClient.Init(accountSid, authToken);

        var addresses = AddressResource.Read();

        foreach (var address in addresses)
        {
            Console.WriteLine(address.FriendlyName);
        }
    }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

// Loop over the list of numbers and echo a property for each one
foreach ($client->addresses->read() as $address) {
    echo $address->friendlyName;
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

# A list of address objects with the properties described above
addresses = client.addresses.list()

for address in addresses:
    print(address.friendly_name)
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# Initialize Twilio Client
@client = Twilio::REST::Client.new(account_sid, auth_token)

# Loop over addresses and print out a property for each one
@client.account.addresses.list.each do |address|
  puts address.friendly_name
end
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses.json \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.Address;
import com.twilio.sdk.resource.list.AddressList;

public class Example {

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

    AddressList addresses = client.getAccount().getAddresses();

    // Loop over addresses and print out a property for each one.
    for (Address address : addresses) {
      System.out.println(address.getFriendlyName());
    }

  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)

# A list of address objects with the properties described above
addresses = client.addresses.list()

for address in addresses:
    print(address.friendly_name)
// Download the Node helper library from twilio.com/docs/node/install
// These identifiers are your accountSid and authToken from
// https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.addresses.each((address) => console.log(address.friendlyName));
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example
{
  static void Main(string[] args)
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    var addresses = twilio.ListAddresses();

    foreach (var address in addresses.Addresses)
    {
      Console.WriteLine(address.FriendlyName);
    }
  }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Services_Twilio($sid, $token);

// Loop over the list of addresses and echo a property for each one
foreach ($client->account->addresses as $address) {
    echo $address->friendly_name;
}
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token


# Loop over addresses and print out a property for each one
@client.account.addresses.list.each do |address|
  puts address.friendly_name
end
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.api.v2010.account.Address;

public class Example {
  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    ResourceSet<Address> addresses = Address.reader().read();

    // Loop over addresses and print out a property for each one.
    for (Address address : addresses) {
      System.out.println(address.getFriendlyName());
    }
  }
}
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.addresses.list(function(err, data) {
    data.addresses.forEach(function(address) {
        console.log(address.friendlyName);
    });
});
出力を表示
  • JSON
  • XML
{
    "page": 0,
    "page_size": 50,
    "uri":"/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses.json",
    "first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses.json?Page=0&PageSize=50",
    "previous_page_uri": null,
    "next_page_uri": null,
    "addresses": [
        {
            "sid": "AD2a0747eba6abf96b7e3c3ff0b4530f6e",
            "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
            "friendly_name": "Billing - Customer 123",
            "customer_name": "Customer 123",
            "street": "1 Hasselhoff Lane",
            "city": "Berlin",
            "region": "Berlin",
            "postal_code": "10785",
            "iso_country": "DE",
        },
    ]
}
<TwilioResponse>
	<Addresses page="0" pagesize="50" uri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses" firstpageuri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses?Page=0&PageSize=50" previouspageuri="" nextpageuri="">
		<Address>
			<Sid>AD2a0747eba6abf96b7e3c3ff0b4530f6e</Sid>
			<DateCreated>Thu, 13 Nov 2008 07:56:24 +0000</DateCreated>
			<DateUpdated>Thu, 13 Nov 2008 08:45:58 +0000</DateUpdated>
			<AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
			<FriendlyName>Billing - Customer 123</FriendlyName>
			<CustomerName>Customer 123</CustomerName>
			<Street>1 Hasselhoff Lane</Street>
			<City>Berlin</City>
			<Region>Berlin</Region>
			<PostalCode>10785</PostalCode>
			<IsoCountry>DE</IsoCountry>
			<ApiVersion>2010-04-01</ApiVersion>
			<Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses/AP3f94c94562ac88dccf16f8859a1a8b25</Uri>
		</Address>
	</Addresses>
</TwilioResponse>
リストを取得する例 1
例 2

顧客名が'Customer 123' であるアドレスをすべて表示します

リストを取得する例 2
  • C#
  • curl
  • Java
  • Node.js
  • PHP
  • Python
  • Ruby
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
  • xml
SDKバージョン:
  • 6.x
  • 7.x
SDKバージョン:
  • 2.x
  • 3.x
SDKバージョン:
  • 4.x
  • 5.x
SDKバージョン:
  • 5.x
  • 6.x
SDKバージョン:
  • 4.x
  • 5.x
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        TwilioClient.Init(accountSid, authToken);

        var addresses = AddressResource.Read(customerName: "Customer 123");

        foreach (var address in addresses)
        {
            Console.WriteLine(address.FriendlyName);
        }
    }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

$addresses = $client->addresses->read(
    array('customerName' => 'Customer 123')
);
// Loop over the list of numbers and echo a property for each one
foreach ($addresses as $address) {
    echo $address->friendlyName;
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

# A list of address objects with the properties described above
addresses = client.addresses.list(customer_name="Customer 123")

for address in addresses:
    print(address.friendly_name)
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# Initialize Twilio Client
@client = Twilio::REST::Client.new(account_sid, auth_token)

# Loop over addresses and print out a property for each one
@client.account.addresses.list(customer_name: 'Customer 123')
       .each do |address|
         puts address.friendly_name
       end
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses.json?CustomerName=Customer+123 \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses?CustomerName=Customer+123 \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.Address;
import com.twilio.sdk.resource.list.AddressList;
import java.util.HashMap;

public class Example {

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

    // Build a filter for the AddressList
    HashMap<String, String> params = new HashMap<String, String>();

    params.put("CustomerName", "Customer 123");

    AddressList addresses = client.getAccount().getAddresses(params);

    // Loop over addresses and print out a property for each one.
    for (Address address : addresses) {
      System.out.println(address.getFriendlyName());
    }

  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)

# A list of address objects with the properties described above
addresses = client.addresses.list(customer_name="Customer 123")

for address in addresses:
    print(address.friendly_name)
// Download the Node helper library from twilio.com/docs/node/install
// These identifiers are your accountSid and authToken from
// https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.addresses
  .each({customerName: 'Customer 123'}, (address) => address.friendlyName);
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example
{
  static void Main(string[] args)
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);
    var options = new AddressListRequest();
    options.CustomerName = "Customer 123";

    var addresses = twilio.ListAddresses(options);

    foreach (var address in addresses.Addresses)
    {
      Console.WriteLine(address.FriendlyName);
    }
  }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Services_Twilio($sid, $token);

// Loop over the list of addresses and echo a property for each one
foreach ($client->account->addresses->getIterator(0, 50, array(
	"CustomerName" => "Customer 123"
    )) as $address) {
    echo $address->friendly_name;
}
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token


# Loop over addresses and print out a property for each one
@client.account.addresses.list(customer_name: "Customer 123").each do |address|
  puts address.friendly_name
end
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.api.v2010.account.Address;

public class Example {
  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    ResourceSet<Address> addresses = Address.reader().setCustomerName("Customer 123").read();

    // Loop over addresses and print out a property for each one.
    for (Address address : addresses) {
      System.out.println(address.getFriendlyName());
    }
  }
}
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.addresses.list({ customerName: "Customer 123" }, function(err, data) {
    data.addresses.forEach(function(address) {
        console.log(address.friendlyName);
    });
});
出力を表示
  • JSON
  • XML
{
    "page": 0,
    "page_size": 50,
    "uri":"/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses.json?CustomerName=Customer+123",
    "first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses.json?Page=0&PageSize=50&CustomerName=Customer+123",
    "previous_page_uri": null,
    "next_page_uri": null,
    "addresses": [
        {
            "sid": "AD2a0747eba6abf96b7e3c3ff0b4530f6e",
            "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
            "friendly_name": "Billing - Customer 123",
            "customer_name": "Customer 123",
            "street": "1 Hasselhoff Lane",
            "city": "Berlin",
            "region": "Berlin",
            "postal_code": "10785",
            "iso_country": "DE",
        },
    ]
}
<TwilioResponse>
    <Addresses page="0" pagesize="50" uri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses?CustomerName=Customer+123" firstpageuri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses?CustomerName=Customer+123&Page=0&PageSize=50" previouspageuri="" nextpageuri="">
		<Address>
			<Sid>AD2a0747eba6abf96b7e3c3ff0b4530f6e</Sid>
			<DateCreated>Thu, 13 Nov 2008 07:56:24 +0000</DateCreated>
			<DateUpdated>Thu, 13 Nov 2008 08:45:58 +0000</DateUpdated>
			<AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
			<FriendlyName>Billing - Customer 123</FriendlyName>
			<CustomerName>Customer 123</CustomerName>
			<Street>1 Hasselhoff Lane</Street>
			<City>Berlin</City>
			<Region>Berlin</Region>
			<PostalCode>10785</PostalCode>
			<IsoCountry>DE</IsoCountry>
			<ApiVersion>2010-04-01</ApiVersion>
			<Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses/AP3f94c94562ac88dccf16f8859a1a8b25</Uri>
		</Address>
	</Addresses>
</TwilioResponse>
リストを取得する例 2

HTTP POST

新しいアドレスを作成します

必要なパラメーター

リクエストには、次のパラメーターを含める 必要があります

パラメーター 説明
CustomerName 名前もしくは顧客名
Street アカウント保有者、顧客の 番地、その他詳細
住所3(市区町村) 市、区
Region 都道府県
PostalCode 郵便番号
IsoCountry ISO国コード 日本は 392
オプションパラメーター

リクエストには、次のパラメーターを含めることができます。

パラメーター 説明
FriendlyName 理解しやすい説明最大64文字です。

リクエストが成功すると、Twilio は新しいアドレスを返します。

HTTP PUT

サポートしません。

HTTP DELETE

サポートしません。

アドレスサブリソース

Dependent Phone Number インスタンスリソース

それぞれのアドレスインスタンスリソースは、どの番号が住所を必要としているのか閲覧するためのサブリソースをサポートします。電話番号の要件を満たす2つの住所を持っている場合、このサブリソースは電話番号をリストに表示しません。

リソース URI

/2010-04-01/Accounts/{AccountSid}/Addresses/{AddressSid}/DependentPhoneNumbers

HTTP GET

あなたのアカウントにあるIncomingPhoneNumbers で住所の特定を必要とする番号のリストを返します。

ページ情報

このリストは ページ情報を 含みます。一つのページにレコードを入れようと計画している場合、ページバゴン号を増やして対応するよりも、nextpageuri を使ってください。nextpageuriを使用すると、次の要求はそれが中断したところからピックアップできます。あなたが積極的にアドレスを作成する場合、重複するデータを検索するのを防ぐことができようにすることができます。

例 1

あなたのアカウントの AD2a0747eba6abf96b7e3c3ff0b4530f6eの住所が必要な電話番号を全て表示します。

住所の必要な電話番号をリストする例 1
  • C#
  • curl
  • Java
  • Node.js
  • PHP
  • Python
  • Ruby
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
  • xml
SDKバージョン:
  • 6.x
  • 7.x
SDKバージョン:
  • 2.x
  • 3.x
SDKバージョン:
  • 4.x
  • 5.x
SDKバージョン:
  • 5.x
  • 6.x
SDKバージョン:
  • 4.x
  • 5.x
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account.Address;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        const string addressSid = "AD2a0747eba6abf96b7e3c3ff0b4530f6e";
        TwilioClient.Init(accountSid, authToken);

        var dependentNumbers = DependentPhoneNumberResource.Read(addressSid);

        foreach (var number in dependentNumbers)
        {
            Console.WriteLine(number.FriendlyName);
        }
    }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

$address = $client
    ->addresses("AD2a0747eba6abf96b7e3c3ff0b4530f6e");

// Loop over the list of numbers and echo a property for each one
foreach ($address->dependentPhoneNumbers->read() as $number) {
    echo $number->friendlyName;
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

# A list of dependent phone number objects
numbers = client.dependent_phone_numbers('AD2a0747eba6abf96b7e3c3ff0b4530f6e').list()

for number in numbers:
    print(number.friendly_name)
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# Initialize Twilio Client
@client = Twilio::REST::Client.new(account_sid, auth_token)

# Get address by sid
@address = @client.account.addresses('AD2a0747eba6abf96b7e3c3ff0b4530f6e').fetch

# Print friendly_name for each phone number
@address.dependent_phone_numbers.list.each do |number|
  puts number.friendly_name
end
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses/AD2a0747eba6abf96b7e3c3ff0b4530f6e/DependentPhoneNumbers.json \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses/AD2a0747eba6abf96b7e3c3ff0b4530f6e/DependentPhoneNumbers \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.DependentPhoneNumber;
import com.twilio.sdk.resource.list.DependentPhoneNumberList;

public class Example {

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

    DependentPhoneNumberList numbers = client.getAccount().getAddress("AD2a0747eba6abf96b7e3c3ff0b4530f6e").getDependentPhoneNumbers();

    // Loop over numbers and print out a property for each one.
    for (DependentPhoneNumber number : numbers) {
      System.out.println(number.getPhoneNumber());
    }

  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)

# A list of dependent phone number objects
numbers = client.addresses('AD2a0747eba6abf96b7e3c3ff0b4530f6e') \
                .dependent_phone_numbers \
                .list()

for number in numbers:
    print(number.friendly_name)
// Download the Node helper library from twilio.com/docs/node/install
// These identifiers are your accountSid and authToken from
// https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.addresses('AD2a0747eba6abf96b7e3c3ff0b4530f6e')
  .dependentPhoneNumbers
  .each((number) => console.log(number.friendlyName));
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example
{
  static void Main(string[] args)
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    var dependentNumbers = twilio.ListDependentPhoneNumbers("AD2a0747eba6abf96b7e3c3ff0b4530f6e");

    foreach (var number in dependentNumbers.DependentPhoneNumbers)
    {
      Console.WriteLine(number.FriendlyName);
    }
  }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Services_Twilio($sid, $token);

$address = $client->account->addresses->get('AD2a0747eba6abf96b7e3c3ff0b4530f6e');
// Loop over the list of numbers and echo a property for each one
foreach ($address->dependent_phone_numbers as $number) {
    echo $number->friendly_name;
}
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token


# Loop over addresses and print out a property for each one
@address = @client.account.addresses.get('AD2a0747eba6abf96b7e3c3ff0b4530f6e')
@address.dependent_phone_numbers.list.each do |number|
  puts number.friendly_name
end
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.api.v2010.account.address.DependentPhoneNumber;

public class Example {
  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    ResourceSet<DependentPhoneNumber> numbers =
        DependentPhoneNumber.reader("AD2a0747eba6abf96b7e3c3ff0b4530f6e").read();

    // Loop over numbers and print out a property for each one.
    for (DependentPhoneNumber number : numbers) {
      System.out.println(number.getPhoneNumber());
    }
  }
}
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.addresses('AD2a0747eba6abf96b7e3c3ff0b4530f6e').dependentPhoneNumbers.list(
    function(err, data) {
        data.dependentPhoneNumbers.forEach(function(number) {
            console.log(number.friendlyName);
        });
});
出力を表示
  • JSON
  • XML
{
    "page": 0,
    "page_size": 50,
    "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses/AD2a0747eba6abf96b7e3c3ff0b4530f6e/DependentPhoneNumbers.json",
    "first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses/AD2a0747eba6abf96b7e3c3ff0b4530f6e/DependentPhoneNumbers.json?Page=0&PageSize=50",
    "previous_page_uri": null,
    "next_page_uri": null,
    "dependent_phone_numbers": [
        {
            "friendly_name": "(510) 555-1212",
            "phone_number": "+15105551212",
            "lata": "722",
            "rate_center": "OKLD TRNID",
            "latitude": "37.780000",
            "longitude": "-122.380000",
            "region": "CA",
            "postal_code": "94703",
            "iso_country": "US",
            "capabilities":{
                "voice":"true",
                "SMS":"true",
                "MMS":"false"
            }
            "address_requirements": "any"
        }
    ]
}
<TwilioResponse>
	<DependentPhoneNumbers page="0" pagesize="50" uri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses/AD2a0747eba6abf96b7e3c3ff0b4530f6e/DependentPhoneNumbers" firstpageuri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses/AD2a0747eba6abf96b7e3c3ff0b4530f6e/DependentPhoneNumbers?Page=0&PageSize=50" previouspageuri="" nextpageuri="">
		<DependentPhoneNumber>
			<Sid>PN2a0747eba6abf96b7e3c3ff0b4530f6e</Sid>
			<DateCreated>Thu, 13 Nov 2008 07:56:24 +0000</DateCreated>
			<DateUpdated>Thu, 13 Nov 2008 08:45:58 +0000</DateUpdated>
			<AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
			<FriendlyName>(510) 555-1212</FriendlyName>
			<PhoneNumber>+15105551212</PhoneNumber>
			...
			<ApiVersion>2010-04-01</ApiVersion>
			<Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PN3f94c94562ac88dccf16f8859a1a8b25</Uri>
		</DependentPhoneNumber>
	</DependentPhoneNumbers>
</TwilioResponse>
住所の必要な電話番号をリストする例 1

HTTP POST

サポートしません。

HTTP PUT

サポートしません。

HTTP DELETE

サポートしません。

1 / 1
Loading Code Samples...
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
  • xml
SDKバージョン:
  • 6.x
  • 7.x
SDKバージョン:
  • 2.x
  • 3.x
SDKバージョン:
  • 4.x
  • 5.x
SDKバージョン:
  • 5.x
  • 6.x
SDKバージョン:
  • 4.x
  • 5.x
形式:
  • JSON
  • XML
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        TwilioClient.Init(accountSid, authToken);

        var address = AddressResource.Fetch("AD2a0747eba6abf96b7e3c3ff0b4530f6e");

        Console.WriteLine(address.CustomerName);
    }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

// Get an object from its sid. If you do not have a sid,
// check out the list resource examples on this page
$address = $client
    ->addresses("AD2a0747eba6abf96b7e3c3ff0b4530f6e")
    ->fetch();

echo $address->customerName;
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

address = client.addresses.get("AP2a0747eba6abf96b7e3c3ff0b4530f6e")
print(address.customer_name)
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# Initialize Twilio Client
@client = Twilio::REST::Client.new(account_sid, auth_token)

# Get an object from its sid. If you do not have a sid,
# check out the list resource examples on this page
@address = @client.account.addresses('AP2a0747eba6abf96b7e3c3ff0b4530f6e').fetch

puts @address.customer_name
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses/AD2a0747eba6abf96b7e3c3ff0b4530f6e.json \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses/AP2a0747eba6abf96b7e3c3ff0b4530f6e \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.Address;

public class Example {

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

    // Get an object from its sid. If you do not have a sid,
    // check out the list resource examples on this page
    Address address = client.getAccount().getAddress("AD2a0747eba6abf96b7e3c3ff0b4530f6e");
    System.out.println(address.getCustomerName());

  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)

address = client.addresses("AP2a0747eba6abf96b7e3c3ff0b4530f6e") \
                .fetch()

print(address.customer_name)
// Download the Node helper library from twilio.com/docs/node/install
// These identifiers are your accountSid and authToken from
// https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.addresses('AD2a0747eba6abf96b7e3c3ff0b4530f6e')
  .fetch()
  .then((address) => console.log(address.customerName));
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example
{
  static void Main(string[] args)
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    var app = twilio.GetAddress("AD2a0747eba6abf96b7e3c3ff0b4530f6e");

    Console.WriteLine(app.CustomerName);
  }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Services_Twilio($sid, $token);

// Get an object from its sid. If you do not have a sid,
// check out the list resource examples on this page
$address = $client->account->addresses->get("AD2a0747eba6abf96b7e3c3ff0b4530f6e");
echo $address->customer_name;
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token

# Get an object from its sid. If you do not have a sid,
# check out the list resource examples on this page
@address = @client.account.addresses.get("AP2a0747eba6abf96b7e3c3ff0b4530f6e")
puts @address.customer_name
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.rest.api.v2010.account.Address;

public class Example {
  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    // Get an object from its sid. If you do not have a sid,
    // check out the list resource examples on this page
    Address address = Address.fetcher("AD2a0747eba6abf96b7e3c3ff0b4530f6e").fetch();

    System.out.println(address.getCustomerName());
  }
}
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.addresses("AD2a0747eba6abf96b7e3c3ff0b4530f6e").get(function(err, address) {
    console.log(address.customerName);
});
{
    "sid": "AD2a0747eba6abf96b7e3c3ff0b4530f6e",
    "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "friendly_name": "Billing - Customer 123",
    "customer_name": "Customer 123",
    "street": "1 Hasselhoff Lane",
    "city": "Berlin",
    "region": "Berlin",
    "postal_code": "10785",
    "iso_country": "DE",
}
<TwilioResponse>
	<Address>
		<Sid>AD2a0747eba6abf96b7e3c3ff0b4530f6e</Sid>
		<DateCreated>Mon, 16 Aug 2010 23:00:23 +0000</DateCreated>
		<DateUpdated>Mon, 16 Aug 2010 23:00:23 +0000</DateUpdated>
		<AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
		<FriendlyName>Billing - Customer 123</FriendlyName>
		<CustomerName>Customer 123</CustomerName>
		<Street>1 Hasselhoff Lane</Street>
		<City>Berlin</City>
		<Region>Berlin</Region>
		<PostalCode>10785</PostalCode>
		<IsoCountry>DE</IsoCountry>
		<Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses/AD2a0747eba6abf96b7e3c3ff0b4530f6e</Uri>
	</Address>
</TwilioResponse>
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
  • xml
SDKバージョン:
  • 6.x
  • 7.x
SDKバージョン:
  • 2.x
  • 3.x
SDKバージョン:
  • 4.x
  • 5.x
SDKバージョン:
  • 5.x
  • 6.x
SDKバージョン:
  • 4.x
  • 5.x
形式:
  • JSON
  • XML
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        TwilioClient.Init(accountSid, authToken);

        const string addressSid = "AD2a0747eba6abf96b7e3c3ff0b4530f6e";
        AddressResource.Update(addressSid,
                               customerName: "Customer 456",
                               street: "2 Hasselhoff Lane");
    }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

// Get an object from its sid. If you do not have a sid,
// check out the list resource examples on this page
$address = $client
    ->addresses("AD2a0747eba6abf96b7e3c3ff0b4530f6e")
    ->update(
        array(
            'customerName' => 'Customer 456',
            'street' => '2 Hasselhoff Lane'
        )
    );

echo $address->customerName;
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

address = client.addresses.update(
    "AD2a0747eba6abf96b7e3c3ff0b4530f6e",
    customer_name="Customer 456",
    street="2 Hasselhoff Lane")
print(address.customer_name)
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# Initialize Twilio Client
@client = Twilio::REST::Client.new account_sid, auth_token

# Get an object from its sid. If you do not have a sid,
# check out the list resource examples on this page
@address = @client.account.addresses('AD2a0747eba6abf96b7e3c3ff0b4530f6e').fetch

@address.update(
  customer_name: 'Customer 456',
  street: '2 Hasselhoff Lane'
)

puts @address.customer_name
$ curl -XPOST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses/AD2a0747eba6abf96b7e3c3ff0b4530f6e.json \
-d "CustomerName=Customer 456" \
-d "Street=2 Hasselhoff Lane" \
-u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -XPOST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses/AD2a0747eba6abf96b7e3c3ff0b4530f6e \
    -d "CustomerName=Customer 456" \
    -d "Street=2 Hasselhoff Lane" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.Address;
import com.twilio.sdk.resource.list.AddressList;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;

public class Example {

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

    // Get an object from its sid. If you do not have a sid,
    // check out the list resource examples on this page
    Address address = client.getAccount().getAddress("AD2a0747eba6abf96b7e3c3ff0b4530f6e");
    // Build a filter for the AddressList
    List<NameValuePair> params = new ArrayList<NameValuePair>();
    params.add(new BasicNameValuePair("CustomerName", "Customer 456"));
    params.add(new BasicNameValuePair("Street", "2 Hasselhoff Lane"));
    address.update(params);

  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)

address = client.addresses("AD2a0747eba6abf96b7e3c3ff0b4530f6e") \
                .update(customer_name="Customer 456",
                        street="2 Hasselhoff Lane")

print(address.customer_name)
// Download the Node helper library from twilio.com/docs/node/install
// These identifiers are your accountSid and authToken from
// https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.addresses('AD2a0747eba6abf96b7e3c3ff0b4530f6e')
  .update({
    customerName: 'Customer 456',
    street: '2 Hasselhoff Lane',
  })
  .then((address) => console.log(address.customerName));
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example
{
  static void Main(string[] args)
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    var options = new AddressOptions();
    options.CustomerName = "Customer 456";
    options.Street = "2 Hasselhoff Lane";

    twilio.UpdateAddress("AD2a0747eba6abf96b7e3c3ff0b4530f6e", options);
  }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Services_Twilio($sid, $token);

// Get an object from its sid. If you do not have a sid,
// check out the list resource examples on this page
$address = $client->account->addresses->get("AD2a0747eba6abf96b7e3c3ff0b4530f6e");
$address->update(array(
        "CustomerName" => "Customer 456",
        "Street" => "2 Hasselhoff Lane"
    ));
echo $address->customer_name;
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token

# Get an object from its sid. If you do not have a sid,
# check out the list resource examples on this page
@address = @client.account.addresses.get("AD2a0747eba6abf96b7e3c3ff0b4530f6e")
@address.update(customer_name: "Customer 456",
  street: "2 Hasselhoff Lane")
puts @address.customer_name
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.rest.api.v2010.account.Address;

public class Example {
  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    // Get an object from its sid. If you do not have a sid,
    // check out the list resource examples on this page
    Address address = Address.updater("AD2a0747eba6abf96b7e3c3ff0b4530f6e")
        .setCustomerName("Customer 456").setStreet("2 Hasselhoff Lane").update();

    System.out.println(address.getDateUpdated());
  }
}
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.addresses("AD2a0747eba6abf96b7e3c3ff0b4530f6e").post({
    customerName: "Customer 456",
    street: "2 Hasselhoff Lane"
}, function(err, address) {
    console.log(address.customerName);
});
{
    "sid": "AD2a0747eba6abf96b7e3c3ff0b4530f6e",
    "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "friendly_name": "Billing - Customer 123",
    "customer_name": "Customer 456",
    "street": "2 Hasselhoff Lane",
    "city": "Berlin",
    "region": "Berlin",
    "postal_code": "10785",
    "iso_country": "DE",
}
<TwilioResponse>
	<Address>
		<Sid>AD2a0747eba6abf96b7e3c3ff0b4530f6e</Sid>
		<DateCreated>Mon, 16 Aug 2010 23:00:23 +0000</DateCreated>
		<DateUpdated>Mon, 16 Aug 2010 23:00:23 +0000</DateUpdated>
		<AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
		<FriendlyName>Billing - Customer 123</FriendlyName>
		<CustomerName>Customer 456</CustomerName>
		<Street>2 Hasselhoff Lane</Street>
		<City>Berlin</City>
		<Region>Berlin</Region>
		<PostalCode>10785</PostalCode>
		<IsoCountry>DE</IsoCountry>
		<ApiVersion>2010-04-01</ApiVersion>
		<Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses/AD2a0747eba6abf96b7e3c3ff0b4530f6e</Uri>
	</Address>
</TwilioResponse>
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
  • xml
SDKバージョン:
  • 6.x
  • 7.x
SDKバージョン:
  • 2.x
  • 3.x
SDKバージョン:
  • 4.x
  • 5.x
SDKバージョン:
  • 5.x
  • 6.x
SDKバージョン:
  • 4.x
  • 5.x
形式:
  • JSON
  • XML
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        TwilioClient.Init(accountSid, authToken);

        var addresses = AddressResource.Read();

        foreach (var address in addresses)
        {
            Console.WriteLine(address.FriendlyName);
        }
    }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

// Loop over the list of numbers and echo a property for each one
foreach ($client->addresses->read() as $address) {
    echo $address->friendlyName;
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

# A list of address objects with the properties described above
addresses = client.addresses.list()

for address in addresses:
    print(address.friendly_name)
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# Initialize Twilio Client
@client = Twilio::REST::Client.new(account_sid, auth_token)

# Loop over addresses and print out a property for each one
@client.account.addresses.list.each do |address|
  puts address.friendly_name
end
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses.json \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.Address;
import com.twilio.sdk.resource.list.AddressList;

public class Example {

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

    AddressList addresses = client.getAccount().getAddresses();

    // Loop over addresses and print out a property for each one.
    for (Address address : addresses) {
      System.out.println(address.getFriendlyName());
    }

  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)

# A list of address objects with the properties described above
addresses = client.addresses.list()

for address in addresses:
    print(address.friendly_name)
// Download the Node helper library from twilio.com/docs/node/install
// These identifiers are your accountSid and authToken from
// https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.addresses.each((address) => console.log(address.friendlyName));
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example
{
  static void Main(string[] args)
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    var addresses = twilio.ListAddresses();

    foreach (var address in addresses.Addresses)
    {
      Console.WriteLine(address.FriendlyName);
    }
  }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Services_Twilio($sid, $token);

// Loop over the list of addresses and echo a property for each one
foreach ($client->account->addresses as $address) {
    echo $address->friendly_name;
}
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token


# Loop over addresses and print out a property for each one
@client.account.addresses.list.each do |address|
  puts address.friendly_name
end
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.api.v2010.account.Address;

public class Example {
  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    ResourceSet<Address> addresses = Address.reader().read();

    // Loop over addresses and print out a property for each one.
    for (Address address : addresses) {
      System.out.println(address.getFriendlyName());
    }
  }
}
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.addresses.list(function(err, data) {
    data.addresses.forEach(function(address) {
        console.log(address.friendlyName);
    });
});
{
    "page": 0,
    "page_size": 50,
    "uri":"/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses.json",
    "first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses.json?Page=0&PageSize=50",
    "previous_page_uri": null,
    "next_page_uri": null,
    "addresses": [
        {
            "sid": "AD2a0747eba6abf96b7e3c3ff0b4530f6e",
            "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
            "friendly_name": "Billing - Customer 123",
            "customer_name": "Customer 123",
            "street": "1 Hasselhoff Lane",
            "city": "Berlin",
            "region": "Berlin",
            "postal_code": "10785",
            "iso_country": "DE",
        },
    ]
}
<TwilioResponse>
	<Addresses page="0" pagesize="50" uri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses" firstpageuri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses?Page=0&PageSize=50" previouspageuri="" nextpageuri="">
		<Address>
			<Sid>AD2a0747eba6abf96b7e3c3ff0b4530f6e</Sid>
			<DateCreated>Thu, 13 Nov 2008 07:56:24 +0000</DateCreated>
			<DateUpdated>Thu, 13 Nov 2008 08:45:58 +0000</DateUpdated>
			<AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
			<FriendlyName>Billing - Customer 123</FriendlyName>
			<CustomerName>Customer 123</CustomerName>
			<Street>1 Hasselhoff Lane</Street>
			<City>Berlin</City>
			<Region>Berlin</Region>
			<PostalCode>10785</PostalCode>
			<IsoCountry>DE</IsoCountry>
			<ApiVersion>2010-04-01</ApiVersion>
			<Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses/AP3f94c94562ac88dccf16f8859a1a8b25</Uri>
		</Address>
	</Addresses>
</TwilioResponse>
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
  • xml
SDKバージョン:
  • 6.x
  • 7.x
SDKバージョン:
  • 2.x
  • 3.x
SDKバージョン:
  • 4.x
  • 5.x
SDKバージョン:
  • 5.x
  • 6.x
SDKバージョン:
  • 4.x
  • 5.x
形式:
  • JSON
  • XML
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        TwilioClient.Init(accountSid, authToken);

        var addresses = AddressResource.Read(customerName: "Customer 123");

        foreach (var address in addresses)
        {
            Console.WriteLine(address.FriendlyName);
        }
    }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

$addresses = $client->addresses->read(
    array('customerName' => 'Customer 123')
);
// Loop over the list of numbers and echo a property for each one
foreach ($addresses as $address) {
    echo $address->friendlyName;
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

# A list of address objects with the properties described above
addresses = client.addresses.list(customer_name="Customer 123")

for address in addresses:
    print(address.friendly_name)
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# Initialize Twilio Client
@client = Twilio::REST::Client.new(account_sid, auth_token)

# Loop over addresses and print out a property for each one
@client.account.addresses.list(customer_name: 'Customer 123')
       .each do |address|
         puts address.friendly_name
       end
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses.json?CustomerName=Customer+123 \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses?CustomerName=Customer+123 \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.Address;
import com.twilio.sdk.resource.list.AddressList;
import java.util.HashMap;

public class Example {

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

    // Build a filter for the AddressList
    HashMap<String, String> params = new HashMap<String, String>();

    params.put("CustomerName", "Customer 123");

    AddressList addresses = client.getAccount().getAddresses(params);

    // Loop over addresses and print out a property for each one.
    for (Address address : addresses) {
      System.out.println(address.getFriendlyName());
    }

  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)

# A list of address objects with the properties described above
addresses = client.addresses.list(customer_name="Customer 123")

for address in addresses:
    print(address.friendly_name)
// Download the Node helper library from twilio.com/docs/node/install
// These identifiers are your accountSid and authToken from
// https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.addresses
  .each({customerName: 'Customer 123'}, (address) => address.friendlyName);
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example
{
  static void Main(string[] args)
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);
    var options = new AddressListRequest();
    options.CustomerName = "Customer 123";

    var addresses = twilio.ListAddresses(options);

    foreach (var address in addresses.Addresses)
    {
      Console.WriteLine(address.FriendlyName);
    }
  }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Services_Twilio($sid, $token);

// Loop over the list of addresses and echo a property for each one
foreach ($client->account->addresses->getIterator(0, 50, array(
	"CustomerName" => "Customer 123"
    )) as $address) {
    echo $address->friendly_name;
}
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token


# Loop over addresses and print out a property for each one
@client.account.addresses.list(customer_name: "Customer 123").each do |address|
  puts address.friendly_name
end
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.api.v2010.account.Address;

public class Example {
  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    ResourceSet<Address> addresses = Address.reader().setCustomerName("Customer 123").read();

    // Loop over addresses and print out a property for each one.
    for (Address address : addresses) {
      System.out.println(address.getFriendlyName());
    }
  }
}
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.addresses.list({ customerName: "Customer 123" }, function(err, data) {
    data.addresses.forEach(function(address) {
        console.log(address.friendlyName);
    });
});
{
    "page": 0,
    "page_size": 50,
    "uri":"/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses.json?CustomerName=Customer+123",
    "first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses.json?Page=0&PageSize=50&CustomerName=Customer+123",
    "previous_page_uri": null,
    "next_page_uri": null,
    "addresses": [
        {
            "sid": "AD2a0747eba6abf96b7e3c3ff0b4530f6e",
            "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
            "friendly_name": "Billing - Customer 123",
            "customer_name": "Customer 123",
            "street": "1 Hasselhoff Lane",
            "city": "Berlin",
            "region": "Berlin",
            "postal_code": "10785",
            "iso_country": "DE",
        },
    ]
}
<TwilioResponse>
    <Addresses page="0" pagesize="50" uri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses?CustomerName=Customer+123" firstpageuri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses?CustomerName=Customer+123&Page=0&PageSize=50" previouspageuri="" nextpageuri="">
		<Address>
			<Sid>AD2a0747eba6abf96b7e3c3ff0b4530f6e</Sid>
			<DateCreated>Thu, 13 Nov 2008 07:56:24 +0000</DateCreated>
			<DateUpdated>Thu, 13 Nov 2008 08:45:58 +0000</DateUpdated>
			<AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
			<FriendlyName>Billing - Customer 123</FriendlyName>
			<CustomerName>Customer 123</CustomerName>
			<Street>1 Hasselhoff Lane</Street>
			<City>Berlin</City>
			<Region>Berlin</Region>
			<PostalCode>10785</PostalCode>
			<IsoCountry>DE</IsoCountry>
			<ApiVersion>2010-04-01</ApiVersion>
			<Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses/AP3f94c94562ac88dccf16f8859a1a8b25</Uri>
		</Address>
	</Addresses>
</TwilioResponse>
SDKバージョン:
  • 4.x
  • 5.x
レスポンス形式:
  • JSON
  • xml
SDKバージョン:
  • 6.x
  • 7.x
SDKバージョン:
  • 2.x
  • 3.x
SDKバージョン:
  • 4.x
  • 5.x
SDKバージョン:
  • 5.x
  • 6.x
SDKバージョン:
  • 4.x
  • 5.x
形式:
  • JSON
  • XML
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account.Address;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        const string addressSid = "AD2a0747eba6abf96b7e3c3ff0b4530f6e";
        TwilioClient.Init(accountSid, authToken);

        var dependentNumbers = DependentPhoneNumberResource.Read(addressSid);

        foreach (var number in dependentNumbers)
        {
            Console.WriteLine(number.FriendlyName);
        }
    }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

$address = $client
    ->addresses("AD2a0747eba6abf96b7e3c3ff0b4530f6e");

// Loop over the list of numbers and echo a property for each one
foreach ($address->dependentPhoneNumbers->read() as $number) {
    echo $number->friendlyName;
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

# A list of dependent phone number objects
numbers = client.dependent_phone_numbers('AD2a0747eba6abf96b7e3c3ff0b4530f6e').list()

for number in numbers:
    print(number.friendly_name)
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# Initialize Twilio Client
@client = Twilio::REST::Client.new(account_sid, auth_token)

# Get address by sid
@address = @client.account.addresses('AD2a0747eba6abf96b7e3c3ff0b4530f6e').fetch

# Print friendly_name for each phone number
@address.dependent_phone_numbers.list.each do |number|
  puts number.friendly_name
end
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses/AD2a0747eba6abf96b7e3c3ff0b4530f6e/DependentPhoneNumbers.json \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses/AD2a0747eba6abf96b7e3c3ff0b4530f6e/DependentPhoneNumbers \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.DependentPhoneNumber;
import com.twilio.sdk.resource.list.DependentPhoneNumberList;

public class Example {

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

    DependentPhoneNumberList numbers = client.getAccount().getAddress("AD2a0747eba6abf96b7e3c3ff0b4530f6e").getDependentPhoneNumbers();

    // Loop over numbers and print out a property for each one.
    for (DependentPhoneNumber number : numbers) {
      System.out.println(number.getPhoneNumber());
    }

  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)

# A list of dependent phone number objects
numbers = client.addresses('AD2a0747eba6abf96b7e3c3ff0b4530f6e') \
                .dependent_phone_numbers \
                .list()

for number in numbers:
    print(number.friendly_name)
// Download the Node helper library from twilio.com/docs/node/install
// These identifiers are your accountSid and authToken from
// https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.addresses('AD2a0747eba6abf96b7e3c3ff0b4530f6e')
  .dependentPhoneNumbers
  .each((number) => console.log(number.friendlyName));
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example
{
  static void Main(string[] args)
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    var dependentNumbers = twilio.ListDependentPhoneNumbers("AD2a0747eba6abf96b7e3c3ff0b4530f6e");

    foreach (var number in dependentNumbers.DependentPhoneNumbers)
    {
      Console.WriteLine(number.FriendlyName);
    }
  }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Services_Twilio($sid, $token);

$address = $client->account->addresses->get('AD2a0747eba6abf96b7e3c3ff0b4530f6e');
// Loop over the list of numbers and echo a property for each one
foreach ($address->dependent_phone_numbers as $number) {
    echo $number->friendly_name;
}
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token


# Loop over addresses and print out a property for each one
@address = @client.account.addresses.get('AD2a0747eba6abf96b7e3c3ff0b4530f6e')
@address.dependent_phone_numbers.list.each do |number|
  puts number.friendly_name
end
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.api.v2010.account.address.DependentPhoneNumber;

public class Example {
  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

    ResourceSet<DependentPhoneNumber> numbers =
        DependentPhoneNumber.reader("AD2a0747eba6abf96b7e3c3ff0b4530f6e").read();

    // Loop over numbers and print out a property for each one.
    for (DependentPhoneNumber number : numbers) {
      System.out.println(number.getPhoneNumber());
    }
  }
}
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.addresses('AD2a0747eba6abf96b7e3c3ff0b4530f6e').dependentPhoneNumbers.list(
    function(err, data) {
        data.dependentPhoneNumbers.forEach(function(number) {
            console.log(number.friendlyName);
        });
});
{
    "page": 0,
    "page_size": 50,
    "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses/AD2a0747eba6abf96b7e3c3ff0b4530f6e/DependentPhoneNumbers.json",
    "first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses/AD2a0747eba6abf96b7e3c3ff0b4530f6e/DependentPhoneNumbers.json?Page=0&PageSize=50",
    "previous_page_uri": null,
    "next_page_uri": null,
    "dependent_phone_numbers": [
        {
            "friendly_name": "(510) 555-1212",
            "phone_number": "+15105551212",
            "lata": "722",
            "rate_center": "OKLD TRNID",
            "latitude": "37.780000",
            "longitude": "-122.380000",
            "region": "CA",
            "postal_code": "94703",
            "iso_country": "US",
            "capabilities":{
                "voice":"true",
                "SMS":"true",
                "MMS":"false"
            }
            "address_requirements": "any"
        }
    ]
}
<TwilioResponse>
	<DependentPhoneNumbers page="0" pagesize="50" uri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses/AD2a0747eba6abf96b7e3c3ff0b4530f6e/DependentPhoneNumbers" firstpageuri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses/AD2a0747eba6abf96b7e3c3ff0b4530f6e/DependentPhoneNumbers?Page=0&PageSize=50" previouspageuri="" nextpageuri="">
		<DependentPhoneNumber>
			<Sid>PN2a0747eba6abf96b7e3c3ff0b4530f6e</Sid>
			<DateCreated>Thu, 13 Nov 2008 07:56:24 +0000</DateCreated>
			<DateUpdated>Thu, 13 Nov 2008 08:45:58 +0000</DateUpdated>
			<AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
			<FriendlyName>(510) 555-1212</FriendlyName>
			<PhoneNumber>+15105551212</PhoneNumber>
			...
			<ApiVersion>2010-04-01</ApiVersion>
			<Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PN3f94c94562ac88dccf16f8859a1a8b25</Uri>
		</DependentPhoneNumber>
	</DependentPhoneNumbers>
</TwilioResponse>