REST API: アドレス

Addressインスタンスリソースは、お客様またはエンドユーザーの国内における実際の所在地です。 電話番号を購入および所有するにあたってTwilioにユーザーの名称と住所を届け出ることが、一部の地域の当局において義務付けられています。 Addressの要件については、AvailablePhoneNumberリソースのプロパティーとして公開されています。

Addressには、所在地情報およびオプションで分かりやすい名前に加え、所在地お客様またはエンドユーザーの会社名が含まれます。 アカウント、またはサブアカウント上で作成された各Addressはそのアカウントで購入される電話番号に使用されます。 Addressの作成後は、複数の電話番号およびIncomingPhoneNumberリソースを使用して購入可能なAddressの要件を持つ電話番号の要件を満たすために使用されます。

一部の国では、現地の規制に準拠するには、提供されたデータの整合性と正確性を確保するための検証が行われます。 これらの国々では、提供されたAddressが検証に通過しないとAddressとして受理されず、エラーコード21628が返されます。送信されたAddressが完全一致せずとも有効なアドレスと類似する場合、リクエスト中にAutoCorrectAddress=falseパラメーターを含まない限り、発見されたその有効な住所を使用してAddressを作成します。 この場合、エラーコード21629に推奨される住所としてこれを渡します。 推奨されたAddressがお客様またはエンドユーザーのアドレスに間違いない場合、推奨される形式を使用して有効なAddressを作成します。

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

Address インスタンスリソース

リソースURI

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

リソースのプロパティ

プロパティ 説明
Sid このアドレスを識別する 34 文字の文字列です。
AccountSid アドレスに関連するアカウントのユニーク ID です。
FriendlyName アドレス の人間が読みやすい形式の説明です。最大64文字です。
お客様の名前 名前もしくは顧客名
番地 アカウント保有者、顧客の 番地、その他詳細
住所3(市区町村) 市、区
region 都道府県
PostalCode 郵便番号
IsoCountry ISO国コード 日本は 392
URI このリソースの URI です。https://api.twilio.com からの相対パスです。
EmergencyEnabled これは緊急通話がこの電話番号でオンになっていることを示す値です。 取りうる値は true または false です。
検証済み 一部の国では、住所が現地の規制を遵守しているか検証が行われます。 これらの国では、指定したアドレスが検証に通過しない場合、住所として受理されません。 住所が検証済みの場合この値は true となり、一方検証が必要ない国か、または法を遵守していない住所の場合は false となります。

HTTP GET

コードサンプルを読み込んでいます...
Language
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 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);
});
// 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 https://twilio.com/docs/libraries/php
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
// 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 https://twilio.com/docs/libraries/php
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.api.addresses('AP2a0747eba6abf96b7e3c3ff0b4530f6e').fetch

puts @address.customer_name
// 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)
// 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());
  }
}
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses/AP2a0747eba6abf96b7e3c3ff0b4530f6e \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses/AD2a0747eba6abf96b7e3c3ff0b4530f6e.json \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
{
    "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文字です。
お客様の名前 名前もしくは顧客名
番地 アカウント保有者、顧客の 番地、その他詳細
住所3(市区町村) 市、区
region 都道府県
PostalCode 郵便番号
AutoCorrectAddress このパラメーターに値を設定しない場合、またはtrueに設定した場合、システムは必要に応じて指定された住所のオートコレクトを実行します。 システムに住所のオートコレクトを実行して欲しくない場合は、この値をfalseに明示的に指定することが必要です。

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

コードサンプルを読み込んでいます...
Language
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 Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.addresses('AD2a0747eba6abf96b7e3c3ff0b4530f6e').post({
  customerName: 'Customer 456',
  street: '2 Hasselhoff Lane',
}, (err, address) => {
  console.log(address.customerName);
});
// 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 https://twilio.com/docs/libraries/php
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
// 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 https://twilio.com/docs/libraries/php
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.api.addresses('AD2a0747eba6abf96b7e3c3ff0b4530f6e').fetch

@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.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)
// 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());
  }
}
$ 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'
$ 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'
{
    "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

アカウント内のAddressを表す、Addressリソースの表現の一覧を返します。 一覧にはページング情報が含まれます。

リストフィルター

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

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

例 1

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

コードサンプルを読み込んでいます...
Language
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 Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.addresses.list((err, data) => {
  data.addresses.forEach(address => {
    console.log(address.friendlyName);
  });
});
// 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 https://twilio.com/docs/libraries/php
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
// 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 https://twilio.com/docs/libraries/php
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.addresses.list.each do |address|
  puts address.friendly_name
end
// 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)
// 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());
    }
  }
}
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses.json \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
{
    "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' であるアドレスをすべて表示します

コードサンプルを読み込んでいます...
Language
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 Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.addresses.list({ customerName: 'Customer 123' }, (err, data) => {
  data.addresses.forEach(address => {
    console.log(address.friendlyName);
  });
});
// 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 https://twilio.com/docs/libraries/php
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
// 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 https://twilio.com/docs/libraries/php
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.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.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)
// 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());
    }
  }
}
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses?CustomerName=Customer+123 \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses.json?CustomerName=Customer+123 \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
{
    "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

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

必須パラメーター

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

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

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

パラメーター 説明
FriendlyName 理解しやすい説明最大64文字です。
AutoCorrectAddress このパラメーターに値を設定しない場合、またはtrueに設定した場合、システムは必要に応じて指定された住所のオートコレクトを実行します。 システムに住所のオートコレクトを実行して欲しくない場合は、この値をfalseに明示的に指定することが必要です。

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

Address検証関連のエラー

エラー コード エラー名 エラーの説明
21615 電話番号にはローカルアドレスが必要です この番号を購入するには、アカウントに現地の住所要件を満たした住所を持っていることが必要です。
21628 アドレス検証エラー 指定されたAddressが検証できません。
21629 アドレス検証エラー - 推奨されたアドレスを確認してください 指定されたAddressが検証できません。同様のアドレスが有効なものとして見つかりました。 推奨されるアドレスはエラーメッセージ本文に含まれます。

HTTP PUT

サポートされていません。

HTTP DELETE

サポートされていません。

例 1

Addressを作成する

コードサンプルを読み込んでいます...
Language
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 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.create({
    friendlyName: "Billing - Customer 123",
    customerName: "Customer 123",
    street: "1 Hasselhoff Lane",
    city: "Berlin",
    region: "Berlin",
    postalCode: "10875",
    isoCountry: "DE"
}, function(err, address) {
    console.log(address.customerName);
});
// 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.create({
    friendlyName: 'Billing - Customer 123',
    customerName: 'Customer 123',
    street: '1 Hasselhoff Lane',
    city: 'Berlin',
    region: 'Berlin',
    postalCode: '10875',
    isoCountry: 'DE',
  })
  .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";

    var address = twilio.AddAddress("Billing - Customer 123", "Customer 123", "2 Hasselhoff Lane", "Berlin", "Berlin", "10785", "DE");

    Console.WriteLine(address.Sid);
  }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
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);

// Create an address resource
$address = $client->account->addresses->create("Billing - Customer 123", array(
	"CustomerName" => "Customer 123",
	"Street" => "1 Hasselhoff Lane",
	"City" => "Berlin",
	"Region" => "Berlin",
	"PostalCode" => "10875",
	"IsoCountry" => "DE"
));
echo $address->sid;
# 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

# Create a new address
@address = @client.account.addresses.create(
  friendly_name: "Billing - Customer 123",
  customer_name: "Customer 123",
  street: "1 Hasselhoff Lane",
  city: "Berlin",
  region: "Berlin",
  postal_code: "10875",
  iso_country: "DE"
)
puts @address.sid
// 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.Create(
            customerName: "Customer 123",
            street: "2 Hasselhoff Lane",
            city: "Berlin",
            region: "Berlin",
            postalCode: "10785",
            isoCountry: "DE",
            friendlyName: "Billing - Customer 123");

        Console.WriteLine(address.Sid);
    }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
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);

// Create an address resource
// create($customerName, $street, $city, $region, $postalCode, $isoCountry, array $options = array())
$address = $client
    ->addresses
    ->create(
        "Customer 123", "1 Hasselhoff Lane", "Berlin", "Berlin", "10875", "DE"
    );

echo $address->sid;
# 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)

app = client.addresses.create(
    customer_name="Customer 123",
    street="1 Hasselhoff Lane",
    city="Berlin",
    region="Berlin",
    postal_code="10875",
    iso_country="DE",
    friendly_name="Billing - Customer 123",
)
print(app.sid)
# 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)

@address = @client.addresses.create(
  friendly_name: 'Billing - Customer 123',
  customer_name: 'Customer 123',
  street: '1 Hasselhoff Lane',
  city: 'Berlin',
  region: 'Berlin',
  postal_code: '10875',
  iso_country: 'DE'
)

puts @address.sid
// 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.factory.AddressFactory;
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);

    List<NameValuePair> params = new ArrayList<NameValuePair>();
    params.add(new BasicNameValuePair("FriendlyName", "Billing - Customer 123"));
    params.add(new BasicNameValuePair("CustomerName", "Customer 123"));
    params.add(new BasicNameValuePair("Street", "1 Hasselhoff Lane"));
    params.add(new BasicNameValuePair("City", "Berlin"));
    params.add(new BasicNameValuePair("Region", "Berlin"));
    params.add(new BasicNameValuePair("PostalCode", "10875"));
    params.add(new BasicNameValuePair("IsoCountry", "DE"));
    AddressFactory factory = client.getAccount().getAddressFactory();
    Address address = factory.create(params);
    System.out.println(address.getSid());
  }
}
# 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)

app = client.addresses.create(
    customer_name="Customer 123",
    street="1 Hasselhoff Lane",
    city="Berlin",
    region="Berlin",
    postal_code="10875",
    iso_country="DE",
    friendly_name="Billing - Customer 123"
)

print(app.sid)
// 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);

    Address address = Address
        .creator("Customer 123", "1 Hasselhoff Lane", "Berlin", "Berlin", "10875", "DE").create();

    System.out.println(address.getSid());
  }
}
$ curl -XPOST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Applications/AP2a0747eba6abf96b7e3c3ff0b4530f6e \
    -d "VoiceUrl=http://demo.twilio.com/docs/voice.xml" \
    -d "SmsUrl=http://demo.twilio.com/docs/sms.xml" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -XPOST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses.json \
-d "CustomerName=Customer 123" \
-d "FriendlyName=Billing - Customer 123" \
-d "Street=1 Hasselhoff Lane" \
-d "City=Berlin" \
-d "Region=Berlin" \
-d "PostalCode=10875" \
-d "IsoCountry=DE" \
-u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
{
    "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>
		<ApiVersion>2010-04-01</ApiVersion>
		<Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses/AD2a0747eba6abf96b7e3c3ff0b4530f6e</Uri>
	</Address>
</TwilioResponse>
List Postの例1

アドレスサブリソース

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

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

リソースURI

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

HTTP GET

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

ページング

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

例 1

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

コードサンプルを読み込んでいます...
Language
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 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);
        });
});
// 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 https://twilio.com/docs/libraries/php
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
// 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 https://twilio.com/docs/libraries/php
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.api.addresses('AD2a0747eba6abf96b7e3c3ff0b4530f6e').fetch

# Print friendly_name for each phone number
@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.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)
// 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());
    }
  }
}
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses/AD2a0747eba6abf96b7e3c3ff0b4530f6e/DependentPhoneNumbers \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses/AD2a0747eba6abf96b7e3c3ff0b4530f6e/DependentPhoneNumbers.json \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
{
    "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

サポートされていません

ヘルプが必要ですか?

誰しもが一度は考える「コーディングって難しい」。そんな時は、お問い合わせフォームから質問してください。 または、Stack Overflow でTwilioタグのついた情報から欲しいものを探してみましょう。

コードサンプルを読み込んでいます...
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 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);
});
// 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 https://twilio.com/docs/libraries/php
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
// 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 https://twilio.com/docs/libraries/php
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.api.addresses('AP2a0747eba6abf96b7e3c3ff0b4530f6e').fetch

puts @address.customer_name
// 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)
// 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());
  }
}
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses/AP2a0747eba6abf96b7e3c3ff0b4530f6e \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses/AD2a0747eba6abf96b7e3c3ff0b4530f6e.json \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
{
    "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 Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.addresses('AD2a0747eba6abf96b7e3c3ff0b4530f6e').post({
  customerName: 'Customer 456',
  street: '2 Hasselhoff Lane',
}, (err, address) => {
  console.log(address.customerName);
});
// 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 https://twilio.com/docs/libraries/php
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
// 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 https://twilio.com/docs/libraries/php
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.api.addresses('AD2a0747eba6abf96b7e3c3ff0b4530f6e').fetch

@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.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)
// 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());
  }
}
$ 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'
$ 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'
{
    "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 Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.addresses.list((err, data) => {
  data.addresses.forEach(address => {
    console.log(address.friendlyName);
  });
});
// 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 https://twilio.com/docs/libraries/php
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
// 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 https://twilio.com/docs/libraries/php
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.addresses.list.each do |address|
  puts address.friendly_name
end
// 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)
// 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());
    }
  }
}
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses.json \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
{
    "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 Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.addresses.list({ customerName: 'Customer 123' }, (err, data) => {
  data.addresses.forEach(address => {
    console.log(address.friendlyName);
  });
});
// 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 https://twilio.com/docs/libraries/php
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
// 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 https://twilio.com/docs/libraries/php
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.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.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)
// 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());
    }
  }
}
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses?CustomerName=Customer+123 \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses.json?CustomerName=Customer+123 \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
{
    "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 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.create({
    friendlyName: "Billing - Customer 123",
    customerName: "Customer 123",
    street: "1 Hasselhoff Lane",
    city: "Berlin",
    region: "Berlin",
    postalCode: "10875",
    isoCountry: "DE"
}, function(err, address) {
    console.log(address.customerName);
});
// 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.create({
    friendlyName: 'Billing - Customer 123',
    customerName: 'Customer 123',
    street: '1 Hasselhoff Lane',
    city: 'Berlin',
    region: 'Berlin',
    postalCode: '10875',
    isoCountry: 'DE',
  })
  .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";

    var address = twilio.AddAddress("Billing - Customer 123", "Customer 123", "2 Hasselhoff Lane", "Berlin", "Berlin", "10785", "DE");

    Console.WriteLine(address.Sid);
  }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
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);

// Create an address resource
$address = $client->account->addresses->create("Billing - Customer 123", array(
	"CustomerName" => "Customer 123",
	"Street" => "1 Hasselhoff Lane",
	"City" => "Berlin",
	"Region" => "Berlin",
	"PostalCode" => "10875",
	"IsoCountry" => "DE"
));
echo $address->sid;
# 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

# Create a new address
@address = @client.account.addresses.create(
  friendly_name: "Billing - Customer 123",
  customer_name: "Customer 123",
  street: "1 Hasselhoff Lane",
  city: "Berlin",
  region: "Berlin",
  postal_code: "10875",
  iso_country: "DE"
)
puts @address.sid
// 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.Create(
            customerName: "Customer 123",
            street: "2 Hasselhoff Lane",
            city: "Berlin",
            region: "Berlin",
            postalCode: "10785",
            isoCountry: "DE",
            friendlyName: "Billing - Customer 123");

        Console.WriteLine(address.Sid);
    }
}
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
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);

// Create an address resource
// create($customerName, $street, $city, $region, $postalCode, $isoCountry, array $options = array())
$address = $client
    ->addresses
    ->create(
        "Customer 123", "1 Hasselhoff Lane", "Berlin", "Berlin", "10875", "DE"
    );

echo $address->sid;
# 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)

app = client.addresses.create(
    customer_name="Customer 123",
    street="1 Hasselhoff Lane",
    city="Berlin",
    region="Berlin",
    postal_code="10875",
    iso_country="DE",
    friendly_name="Billing - Customer 123",
)
print(app.sid)
# 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)

@address = @client.addresses.create(
  friendly_name: 'Billing - Customer 123',
  customer_name: 'Customer 123',
  street: '1 Hasselhoff Lane',
  city: 'Berlin',
  region: 'Berlin',
  postal_code: '10875',
  iso_country: 'DE'
)

puts @address.sid
// 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.factory.AddressFactory;
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);

    List<NameValuePair> params = new ArrayList<NameValuePair>();
    params.add(new BasicNameValuePair("FriendlyName", "Billing - Customer 123"));
    params.add(new BasicNameValuePair("CustomerName", "Customer 123"));
    params.add(new BasicNameValuePair("Street", "1 Hasselhoff Lane"));
    params.add(new BasicNameValuePair("City", "Berlin"));
    params.add(new BasicNameValuePair("Region", "Berlin"));
    params.add(new BasicNameValuePair("PostalCode", "10875"));
    params.add(new BasicNameValuePair("IsoCountry", "DE"));
    AddressFactory factory = client.getAccount().getAddressFactory();
    Address address = factory.create(params);
    System.out.println(address.getSid());
  }
}
# 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)

app = client.addresses.create(
    customer_name="Customer 123",
    street="1 Hasselhoff Lane",
    city="Berlin",
    region="Berlin",
    postal_code="10875",
    iso_country="DE",
    friendly_name="Billing - Customer 123"
)

print(app.sid)
// 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);

    Address address = Address
        .creator("Customer 123", "1 Hasselhoff Lane", "Berlin", "Berlin", "10875", "DE").create();

    System.out.println(address.getSid());
  }
}
$ curl -XPOST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Applications/AP2a0747eba6abf96b7e3c3ff0b4530f6e \
    -d "VoiceUrl=http://demo.twilio.com/docs/voice.xml" \
    -d "SmsUrl=http://demo.twilio.com/docs/sms.xml" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -XPOST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses.json \
-d "CustomerName=Customer 123" \
-d "FriendlyName=Billing - Customer 123" \
-d "Street=1 Hasselhoff Lane" \
-d "City=Berlin" \
-d "Region=Berlin" \
-d "PostalCode=10875" \
-d "IsoCountry=DE" \
-u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
{
    "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>
		<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 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);
        });
});
// 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 https://twilio.com/docs/libraries/php
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
// 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 https://twilio.com/docs/libraries/php
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.api.addresses('AD2a0747eba6abf96b7e3c3ff0b4530f6e').fetch

# Print friendly_name for each phone number
@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.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)
// 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());
    }
  }
}
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses/AD2a0747eba6abf96b7e3c3ff0b4530f6e/DependentPhoneNumbers \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Addresses/AD2a0747eba6abf96b7e3c3ff0b4530f6e/DependentPhoneNumbers.json \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
{
    "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>