REST API: 着信電話番号

An IncomingPhoneNumber instance resource represents a Twilio phone number purchased from Twilio, ported or hosted to Twilio.

IncomingPhoneNumber リスト リソースは、アカウントの Twilio 電話番号を表現します。 新しい Twilio 番号をプロビジョニングするには、このリスト リソースに POST します。 プロビジョニングする新しい番号を検索するには、 AvailablePhoneNumber リソースのサブリソースを使用します。

サブアカウントを使用している場合は、2 つの Twilio アカウントの間で電話番号を移動することができます。 詳細は、 サブアカウント間で番号を交換するを参照してください。

電話番号のプロビジョニングには、2 つのステップがあります。 まず、 AvailablePhoneNumber リソースのサブリソースを使って、プロビジョニングを行う使用可能な番号を検索します。 次に、必ず IncomingPhoneNumbers リスト リソースに POSTします。 次のセクションで詳細を説明します。

IncomingPhoneNumber Properties

Each instance of an IncomingPhoneNumber resource has the following properties:

名前 概要
account_sid

The unique id of the Account responsible for this phone number. (🏢 not PII)

address_requirements

This indicates whether the phone number requires you or your customer to have an Address registered with Twilio. Possible values are none, any, local, or foreign. (🏢 not PII)

address_sid

The 34 character sid of the address Twilio should use to associate with the number. Addresses are required in some regions to meet local regulations (🏢 not PII)

api_version

Calls to this phone number will start a new TwiML session with this API version. (🏢 not PII)

ベータ

Phone numbers new to the Twilio platform are marked as beta. Possible values are either true or false. (🏢 not PII)

capabilities

This is a set of boolean properties that indicate whether a phone number can receive calls or messages. Possible capabilities are Voice, SMS, and MMS with each having a value of either true or false. (🏢 not PII)

date_created

The date that this resource was created, given as GMT RFC 2822 format. (🏢 not PII)

date_updated

The date that this resource was last updated, given as GMT RFC 2822 format. (🏢 not PII)

friendly_name

A human readable descriptive text for this resource, up to 64 characters long. By default, the FriendlyName is a nicely formatted version of the phone number. (📇 PII MTL: 30 days)

identity_sid

The 34 character sid of the identity Twilio should use to associate with the number. Identities are required in some regions to meet local regulations (🏢 not PII)

origin

Twilio owned phone numbers are marked as twilio while hosted phone numbers are marked as hosted. (🏢 not PII)

phone_number

The incoming phone number. e.g., +16175551212 (E.164 format) (🏢 not PII)

sid

A 34 character string that uniquely identifies this resource. (🏢 not PII)

sms_application_sid

The 34 character sid of the application Twilio should use to handle SMSs sent to this number. If a SmsApplicationSid is present, Twilio will ignore all of the SMS urls above and use those set on the application. (🏢 not PII)

sms_fallback_method

The HTTP method Twilio will use when requesting the above URL. Either GET or POST. (🏢 not PII)

sms_fallback_url

The URL that Twilio will request if an error occurs retrieving or executing the TwiML from SmsUrl. (🏢 not PII)

sms_method

The HTTP method Twilio will use when making requests to the SmsUrl. Either GET or POST. (🏢 not PII)

sms_url

The URL Twilio will request when receiving an incoming SMS message to this number. (🏢 not PII)

status_callback

The URL that Twilio will request to pass status parameters (such as call ended) to your application. (🏢 not PII)

status_callback_method

The HTTP method Twilio will use to make requests to the StatusCallback URL. Either GET or POST. (🏢 not PII)

trunk_sid

The 34 character sid of the Trunk Twilio should use to handle phone calls to this number. If a TrunkSid is present, Twilio will ignore all of the voice urls and voice applications above and use those set on the Trunk. Setting a TrunkSid will automatically delete your VoiceApplicationSid and vice versa. (🏢 not PII)

uri

The URI for this resource, relative to https://api.twilio.com. (🏢 not PII)

voice_application_sid

The 34 character sid of the application Twilio should use to handle phone calls to this number. If a VoiceApplicationSid is present, Twilio will ignore all of the voice urls above and use those set on the application. Setting a VoiceApplicationSid will automatically delete your TrunkSid and vice versa. (🏢 not PII)

voice_caller_id_lookup

Look up the caller's caller-ID name from the CNAM database ($0.01 per look up). Either true or false. (🏢 not PII)

voice_fallback_method

The HTTP method Twilio will use when requesting the VoiceFallbackUrl. Either GET or POST. (🏢 not PII)

voice_fallback_url

The URL that Twilio will request if an error occurs retrieving or executing the TwiML requested by Url. (🏢 not PII)

voice_method

The HTTP method Twilio will use when requesting the above Url. Either GET or POST. (🏢 not PII)

voice_url

The URL Twilio will request when this phone number receives a call. The VoiceURL will no longer be used if a VoiceApplicationSid or a TrunkSid is set. (🏢 not PII)

アドレス要件値

下記は address_required プロパティ として取りうる値です。

Status 概要
none このアドレスは電話番号に必要ではありません。
any このアカウントは住所を必要としています。しかし、世界中のどこでもご利用いただけます。
local このアカウントは電話番号の国の住所が必要です。
foreign あなたのアカウントは電話番号の国ではない住所が必要です。
POST
https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers

自分のアカウントの新しい電話番号を購入します。 リクエストに一致する電話番号が見つかると、Twilio はこの番号をアカウントに追加し、初月の料金を課金します。 リクエストに一致する電話番号が見つからない場合、HTTP 400番台のエラーと Twilio エラー コード 21452 が返ります。

If the number you are trying to purchase has address requirements, the system will look for an address on your account that satisfies the requirement. If you have multiple addresses, you can specify which address to associate with the number by passing the optional AddressSid parameter.

購入しようとしている電話番号が提出された身分証明書を必要とし、アカウントに関連づけられた確認済の身分証明書がない場合、Twilioエラーコード21650を伴ったHTTP 400を受信することになります。 詳細については、このサポート記事をご参照ください。

POST する番号を検索するには、 AvailablePhoneNumbers リスト リソースのサブリソースを使用します。

パラメーター

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

名前 概要
AreaCode

Required if PhoneNumber is not passed. The desired area code for your new incoming phone number. Any three digit, US or Canada area code is valid. Twilio will provision a random phone number within this area code for you. You must include either this or a PhoneNumber parameter to have your POST succeed. (US and Canada only) (🏢 not PII)

PhoneNumber

Required if AreaCode is not passed. The phone number you want to purchase. The number should be formatted starting with a '+' followed by the country code and the number in E.164 format e.g., '+15105555555'. You must include either this or an AreaCode parameter to have your POST succeed. (🏢 not PII)

AddressSid

Optional. The 34 character sid of the address Twilio should use to associate with the number. Addresses are required in some regions to meet local regulations (🏢 not PII)

ApiVersion

Optional. The Twilio REST API version to use for incoming calls made to this number. If omitted, uses 2010-04-01. (🏢 not PII)

FriendlyName

Optional. A human readable descriptive text for this resource, up to 64 characters long. By default, the FriendlyName is a nicely formatted version of the phone number. (📇 PII MTL: 30 days)

IdentitySid

Optional. The 34 character sid of the identity Twilio should use to associate with the number. Identities are required in some regions to meet local regulations (🏢 not PII)

SmsApplicationSid

Optional. The 34 character sid of the application Twilio should use to handle SMSs sent to the new number. If a SmsApplicationSid is present, Twilio will ignore all of the SMS urls above and use those set on the application. (🏢 not PII)

SmsFallbackMethod

Optional. The HTTP method that should be used to request the SmsFallbackUrl. Must be either GET or POST. Defaults to POST. (🏢 not PII)

SmsFallbackUrl

Optional. A URL that Twilio will request if an error occurs requesting or executing the TwiML defined by SmsUrl. (🏢 not PII)

SmsMethod

Optional. The HTTP method that should be used to request the SmsUrl. Must be either GET or POST. Defaults to POST. (🏢 not PII)

SmsUrl

Optional. The URL Twilio will request when receiving an incoming SMS message to this number. (🏢 not PII)

StatusCallback

Optional. The URL that Twilio will request to pass status parameters (such as call ended) to your application. (🏢 not PII)

StatusCallbackMethod

Optional. The HTTP method Twilio will use to make requests to the StatusCallback URL. Either GET or POST. Defaults to POST. (🏢 not PII)

TrunkSid

Optional. The 34 character sid of the Trunk Twilio should use to handle phone calls to this number. If a TrunkSid is present, Twilio will ignore all of the voice urls and voice applications above and use those set on the Trunk. Setting a TrunkSid will automatically delete your VoiceApplicationSid and vice versa. (🏢 not PII)

VoiceApplicationSid

Optional. The 34 character sid of the application Twilio should use to handle phone calls to the new number. If a VoiceApplicationSid is present, Twilio will ignore all of the voice urls above and use those set on the application. Setting a VoiceApplicationSid will automatically delete your TrunkSid and vice versa. (🏢 not PII)

VoiceCallerIdLookup

Optional. Do a lookup of a caller's name from the CNAM database and post it to your app. Either true or false. Defaults to false. (🏢 not PII)

VoiceFallbackMethod

Optional. The HTTP method that should be used to request the VoiceFallbackUrl. Either GET or POST. Defaults to POST. (🏢 not PII)

VoiceFallbackUrl

Optional. The URL that Twilio will request if an error occurs retrieving or executing the TwiML requested by Url. (🏢 not PII)

VoiceMethod

Optional. The HTTP method that should be used to request the VoiceUrl. Must be either GET or POST. Defaults to POST. (🏢 not PII)

VoiceUrl

Optional. The URL that Twilio should request when somebody dials the new phone number. The VoiceURL will no longer be used if a VoiceApplicationSid or a TrunkSid is set. (🏢 not PII)

リクエストが成功すると、Twilio はアカウントに割り当てられた新しい電話番号の表現を返します。

注 : 無料トライアル アカウント使用中は、番号をリクエストすることはできません。 Twilio 電話番号を購入するには、アカウントのアップグレードが必要です。
コードサンプルを読み込んでいます...
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.incomingPhoneNumbers.create(
  {
    friendlyName: 'My Company Line',
    voiceUrl: 'http://demo.twilio.com/docs/voice.xml',
    phoneNumber: '+15105647903',
    voiceMethod: 'GET',
  },
  (err, number) => {
    console.log(number.sid);
  }
);
// Download the helper library from https://www.twilio.com/docs/node/install
// Your Account Sid and Auth Token from twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.incomingPhoneNumbers
      .create({
         friendlyName: 'My Company Line',
         phoneNumber: '+15105647903',
         voiceMethod: 'GET',
         voiceUrl: 'http://demo.twilio.com/docs/voice.xml'
       })
      .then(incoming_phone_number => console.log(incoming_phone_number.sid))
      .done();
// 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 PhoneNumberOptions();
    options.FriendlyName = "My Company Line";
    options.VoiceUrl = "http://demo.twilio.com/docs/voice.xml";
    options.PhoneNumber = "+15105647903";
    options.VoiceMethod = "GET";
    var number = twilio.AddIncomingPhoneNumber(options);
    
    Console.WriteLine(number.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);

$number = $client->account->incoming_phone_numbers->create(
    array(
        "FriendlyName" => "My Company Line",
        "VoiceUrl" => "http://demo.twilio.com/docs/voice.xml",
        "PhoneNumber" => "+15105647903",
        "VoiceMethod" => "GET"
    )
);
echo $number->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

number = @client.account.incoming_phone_numbers
                .create(friendly_name: 'My Company Line',
                        voice_url: 'http://demo.twilio.com/docs/voice.xml',
                        phone_number: '+15105647903',
                        voice_method: 'GET')
puts number.sms_url
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;


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

        TwilioClient.Init(accountSid, authToken);

        var incomingPhoneNumber = IncomingPhoneNumberResource.Create(
            friendlyName: "My Company Line",
            phoneNumber: new Twilio.Types.PhoneNumber("+15105647903"),
            voiceMethod: Twilio.Http.HttpMethod.Get,
            voiceUrl: new Uri("http://demo.twilio.com/docs/voice.xml"),
            pathAccountSid: "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
        );

        Console.WriteLine(incomingPhoneNumber.Sid);
    }
}
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once '/path/to/vendor/autoload.php';

use Twilio\Rest\Client;

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

$incoming_phone_number = $twilio->incomingPhoneNumbers
                                ->create(array(
                                             "friendlyName" => "My Company Line",
                                             "phoneNumber" => "+15105647903",
                                             "voiceMethod" => "GET",
                                             "voiceUrl" => "http://demo.twilio.com/docs/voice.xml"
                                         )
                                );

print($incoming_phone_number->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)

number = client.phone_numbers.purchase(
    friendly_name="My Company Line",
    voice_url="http://demo.twilio.com/docs/voice.xml",
    phone_number="+15105647903",
    voice_method="GET"
)
print(number.sid)
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'rubygems'
require 'twilio-ruby'

# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

incoming_phone_number = @client.incoming_phone_numbers
  .create(
     friendly_name: 'My Company Line',
     phone_number: '+15105647903',
     voice_method: 'GET',
     voice_url: 'http://demo.twilio.com/docs/voice.xml'
   )

puts incoming_phone_number.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.factory.IncomingPhoneNumberFactory;
import com.twilio.sdk.resource.instance.IncomingPhoneNumber;
import com.twilio.sdk.resource.list.IncomingPhoneNumberList;
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);

    // Build a filter for the IncomingPhoneNumberList
    List<NameValuePair> params = new ArrayList<NameValuePair>();
    params.add(new BasicNameValuePair("FriendlyName", "My Company Line"));
    params.add(new BasicNameValuePair("VoiceUrl", "http://demo.twilio.com/docs/voice.xml"));
    params.add(new BasicNameValuePair("PhoneNumber", "+15105647903"));
    params.add(new BasicNameValuePair("VoiceMethod", "GET"));
    
    IncomingPhoneNumberFactory numberFactory = client.getAccount().getIncomingPhoneNumberFactory();
    IncomingPhoneNumber number = numberFactory.create(params);
    System.out.println(number.getSid());
  }
}
# Download the helper library from https://www.twilio.com/docs/python/install
from twilio.rest import Client


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

incoming_phone_number = client.incoming_phone_numbers \
    .create(
         friendly_name='My Company Line',
         phone_number='+15105647903',
         voice_method='GET',
         voice_url='http://demo.twilio.com/docs/voice.xml'
     )

print(incoming_phone_number.sid)
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.http.HttpMethod;
import com.twilio.rest.api.v2010.account.IncomingPhoneNumber;
import com.twilio.type.PhoneNumber;

import java.net.URI;

public class Example {
    // Find your Account Sid and Token at twilio.com/console
    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);
        IncomingPhoneNumber incomingPhoneNumber = IncomingPhoneNumber.creator(
                new com.twilio.type.PhoneNumber("+15105647903"))
            .setFriendlyName("My Company Line")
            .setVoiceMethod(HttpMethod.GET)
            .setVoiceUrl(URI.create("http://demo.twilio.com/docs/voice.xml"))
            .create();

        System.out.println(incomingPhoneNumber.getSid());
    }
}
curl -XPOST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers \
    -d "FriendlyName=My%20Company%20Line" \
    -d "VoiceUrl=http://demo.twilio.com/docs/voice.xml" \
    -d "PhoneNumber=%2B15105647903" \
    -d "VoiceMethod=GET" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
curl -X POST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json \
--data-urlencode "FriendlyName=My Company Line" \
--data-urlencode "PhoneNumber=+15105647903" \
--data-urlencode "VoiceMethod=GET" \
--data-urlencode "VoiceUrl=http://demo.twilio.com/docs/voice.xml" \
-u ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token
{
  "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "address_requirements": "none",
  "address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "api_version": "2010-04-01",
  "beta": false,
  "capabilities": {
    "mms": true,
    "sms": false,
    "voice": true
  },
  "date_created": "Thu, 30 Jul 2015 23:19:04 +0000",
  "date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
  "emergency_status": "Active",
  "emergency_address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "friendly_name": "My Company Line",
  "identity_sid": "RIXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "origin": "origin",
  "phone_number": "+15105647903",
  "sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "sms_application_sid": "APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "sms_fallback_method": "POST",
  "sms_fallback_url": "",
  "sms_method": "POST",
  "sms_url": "",
  "status_callback": "",
  "status_callback_method": "POST",
  "trunk_sid": "TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
  "voice_application_sid": "APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "voice_caller_id_lookup": false,
  "voice_fallback_method": "POST",
  "voice_fallback_url": null,
  "voice_method": "GET",
  "voice_url": "http://demo.twilio.com/docs/voice.xml"
}
<TwilioResponse>
  <IncomingPhoneNumber>
    <Sid>PN2a0747eba6abf96b7e3c3ff0b4530f6e</Sid>
    <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
    <FriendlyName>My Company Line</FriendlyName>
    <PhoneNumber>+15105647903</PhoneNumber>
    <VoiceUrl>http://demo.twilio.com/docs/voice.xml</VoiceUrl>
    <VoiceMethod>GET</VoiceMethod>
    <VoiceFallbackUrl></VoiceFallbackUrl>
    <VoiceFallbackMethod>POST</VoiceFallbackMethod>
    <VoiceCallerIdLookup>false</VoiceCallerIdLookup>
    <VoiceApplicationSid/>
    <DateCreated>Mon, 16 Aug 2010 23:00:23 +0000</DateCreated>
    <DateUpdated>Mon, 16 Aug 2010 23:00:23 +0000</DateUpdated>
    <SmsUrl></SmsUrl>
    <SmsMethod>POST</SmsMethod>
    <SmsFallbackUrl></SmsFallbackUrl>
    <SmsFallbackMethod>GET</SmsFallbackMethod>
    <SmsApplicationSid/>
    <Capabilities>
      <Voice>true</Voice>
      <SMS>true</SMS>
      <MMS>false</MMS>
    </Capabilities>
    <Beta>false</Beta>
    <StatusCallback/>
    <StatusCallbackMethod/>
    <ApiVersion>2010-04-01</ApiVersion>
    <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PN2a0747eba6abf96b7e3c3ff0b4530f6e</Uri>
  </IncomingPhoneNumber>
</TwilioResponse>
新しい IncomingPhoneNumber の作成
GET
https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{IncomingPhoneNumberSid}
コードサンプルを読み込んでいます...
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
  .incomingPhoneNumbers('PN2a0747eba6abf96b7e3c3ff0b4530f6e')
  .get((err, number) => {
    console.log(number.phoneNumber);
  });
// Download the helper library from https://www.twilio.com/docs/node/install
// Your Account Sid and Auth Token from twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.incomingPhoneNumbers('PN2a0747eba6abf96b7e3c3ff0b4530f6e')
  .fetch()
  .then(incoming_phone_number => console.log(incoming_phone_number.friendlyName))
  .done();
// 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 number = twilio.GetIncomingPhoneNumber("PN2a0747eba6abf96b7e3c3ff0b4530f6e");
    
    Console.WriteLine(number.PhoneNumber);
  }
}
<?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
$number = $client->account->incoming_phone_numbers->get("PN2a0747eba6abf96b7e3c3ff0b4530f6e");
echo $number->phone_number;
# 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
number = client.account.incoming_phone_numbers
               .get('PN2a0747eba6abf96b7e3c3ff0b4530f6e')
puts number.phone_number
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;


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

        TwilioClient.Init(accountSid, authToken);

        var incomingPhoneNumber = IncomingPhoneNumberResource.Fetch(
            pathAccountSid: "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
            pathSid: "PN2a0747eba6abf96b7e3c3ff0b4530f6e"
        );

        Console.WriteLine(incomingPhoneNumber.FriendlyName);
    }
}
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once '/path/to/vendor/autoload.php';

use Twilio\Rest\Client;

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

$incoming_phone_number = $twilio->incomingPhoneNumbers("PN2a0747eba6abf96b7e3c3ff0b4530f6e")
                                ->fetch();

print($incoming_phone_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)

number = client.phone_numbers.get("PN2a0747eba6abf96b7e3c3ff0b4530f6e")
print(number.phone_number)
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'rubygems'
require 'twilio-ruby'

# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

incoming_phone_number = @client
  .incoming_phone_numbers('PN2a0747eba6abf96b7e3c3ff0b4530f6e')
  .fetch

puts incoming_phone_number.friendly_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.IncomingPhoneNumber;

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
    IncomingPhoneNumber number = client.getAccount().getIncomingPhoneNumber("PN2a0747eba6abf96b7e3c3ff0b4530f6e");
    System.out.println(number.getPhoneNumber());
    
  }
}
# Download the helper library from https://www.twilio.com/docs/python/install
from twilio.rest import Client


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

incoming_phone_number = client \
    .incoming_phone_numbers('PN2a0747eba6abf96b7e3c3ff0b4530f6e') \
    .fetch()

print(incoming_phone_number.friendly_name)
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.api.v2010.account.IncomingPhoneNumber;

public class Example {
    // Find your Account Sid and Token at twilio.com/console
    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);
        IncomingPhoneNumber incomingPhoneNumber = IncomingPhoneNumber.fetcher(
                "PN2a0747eba6abf96b7e3c3ff0b4530f6e")
            .fetch();

        System.out.println(incomingPhoneNumber.getFriendlyName());
    }
}
curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PN2a0747eba6abf96b7e3c3ff0b4530f6e \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
curl -X GET 'https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PN2a0747eba6abf96b7e3c3ff0b4530f6e.json' \
-u ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token
{
  "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "address_requirements": "none",
  "address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "api_version": "2010-04-01",
  "beta": false,
  "capabilities": {
    "mms": true,
    "sms": false,
    "voice": true
  },
  "date_created": "Thu, 30 Jul 2015 23:19:04 +0000",
  "date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
  "emergency_status": "Active",
  "emergency_address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "friendly_name": "(808) 925-5327",
  "identity_sid": "RIXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "origin": "origin",
  "phone_number": "+15017122661",
  "sid": "PN2a0747eba6abf96b7e3c3ff0b4530f6e",
  "sms_application_sid": "APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "sms_fallback_method": "POST",
  "sms_fallback_url": "",
  "sms_method": "POST",
  "sms_url": "",
  "status_callback": "",
  "status_callback_method": "POST",
  "trunk_sid": "TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PN2a0747eba6abf96b7e3c3ff0b4530f6e.json",
  "voice_application_sid": "APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "voice_caller_id_lookup": false,
  "voice_fallback_method": "POST",
  "voice_fallback_url": null,
  "voice_method": "POST",
  "voice_url": null
}
<TwilioResponse>
  <IncomingPhoneNumber>
    <Sid>PN2a0747eba6abf96b7e3c3ff0b4530f6e</Sid>
    <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
    <FriendlyName>My Company Line</FriendlyName>
    <PhoneNumber>+15105647903</PhoneNumber>
    <VoiceUrl>http://demo.twilio.com/docs/voice.xml</VoiceUrl>
    <VoiceMethod>POST</VoiceMethod>
    <VoiceFallbackUrl/>
    <VoiceFallbackMethod>POST</VoiceFallbackMethod>
    <StatusCallback/>
    <StatusCallbackMethod/>
    <VoiceCallerIdLookup>false</VoiceCallerIdLookup>
    <VoiceApplicationSid/>
    <DateCreated>Mon, 16 Aug 2010 23:00:23 +0000</DateCreated>
    <DateUpdated>Mon, 16 Aug 2010 23:00:23 +0000</DateUpdated>
    <SmsUrl/>
    <SmsMethod>POST</SmsMethod>
    <SmsFallbackUrl/>
    <SmsFallbackMethod>GET</SmsFallbackMethod>
    <SmsApplicationSid>AP9b2e38d8c592488c397fc871a82a74ec</SmsApplicationSid>
    <Capabilities>
      <Voice>true</Voice>
      <SMS>true</SMS>
      <MMS>false</MMS>
    </Capabilities>
    <Beta>false</Beta>
    <ApiVersion>2010-04-01</ApiVersion>
    <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PN2a0747eba6abf96b7e3c3ff0b4530f6e</Uri>
  </IncomingPhoneNumber>
</TwilioResponse>
IncomingPhoneNumber の取得
GET
https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers

IncomingPhoneNumber リソース表現のリストを返します。各項目は、アカウントに割り当てられた電話番号を表現します。 このリストは ページ情報を含みます。

リストフィルター

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

名前 概要
ベータ

Optional. Include phone numbers new to the Twilio platform. Possible values are either true or false. Default is true. (🏢 not PII)

FriendlyName

Optional. Only show the incoming phone number resources with friendly names that exactly match this name. (📇 PII MTL: 30 days)

Origin

Optional. Include phone numbers based on the origin, by default, phone numbers of all origin are included. Possible values are either twilio or hosted. (🏢 not PII)

PhoneNumber

Optional. Only show the incoming phone number resources that match this pattern. You can specify partial numbers and use '*' as a wildcard for any digit. (🏢 not PII)

コードサンプルを読み込んでいます...
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.incomingPhoneNumbers.list((err, data) => {
  data.incomingPhoneNumbers.forEach(number => {
    console.log(number.phoneNumber);
  });
});
// Download the helper library from https://www.twilio.com/docs/node/install
// Your Account Sid and Auth Token from twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.incomingPhoneNumbers
      .each(incomingPhoneNumbers => console.log(incomingPhoneNumbers.sid));
// 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 numbers = twilio.ListIncomingPhoneNumbers(null, null, null, null);
    
    foreach (var number in numbers.IncomingPhoneNumbers)
    {
      Console.WriteLine(number.PhoneNumber);
    }
  }
}
<?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 numbers and echo a property for each one
foreach ($client->account->incoming_phone_numbers as $number) {
    echo $number->phone_number;
}
# 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 numbers and print out a property for each one
@client.account.incoming_phone_numbers.list.each do |number|
  puts number.phone_number
end
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;


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

        TwilioClient.Init(accountSid, authToken);

        var incomingPhoneNumbers = IncomingPhoneNumberResource.Read(
            pathAccountSid: "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
        );

        foreach(var record in incomingPhoneNumbers)
        {
           Console.WriteLine(record.Sid);
        }
    }
}
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once '/path/to/vendor/autoload.php';

use Twilio\Rest\Client;

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

$incomingPhoneNumbers = $twilio->incomingPhoneNumbers
                               ->read();

foreach ($incomingPhoneNumbers as $record) {
    print($record->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)

# A list of number objects with the properties described above
numbers = client.phone_numbers.list()
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'rubygems'
require 'twilio-ruby'

# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

incoming_phone_numbers = @client.incoming_phone_numbers.list

incoming_phone_numbers.each do |record|
  puts record.sid
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.IncomingPhoneNumber;
import com.twilio.sdk.resource.list.IncomingPhoneNumberList;

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);
    
    IncomingPhoneNumberList numbers = client.getAccount().getIncomingPhoneNumbers();
    
    // Loop over numbers and print out a property for each one.
    for (IncomingPhoneNumber number : numbers) {
      System.out.println(number.getPhoneNumber());
    } 
  }
}
# Download the helper library from https://www.twilio.com/docs/python/install
from twilio.rest import Client


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

incoming_phone_numbers = client.incoming_phone_numbers.list()

for record in incoming_phone_numbers:
    print(record.sid)
// 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.IncomingPhoneNumber;

public class Example {
    // Find your Account Sid and Token at twilio.com/console
    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<IncomingPhoneNumber> incomingPhoneNumbers = 
            IncomingPhoneNumber.reader()
            .read();

        for(IncomingPhoneNumber record : incomingPhoneNumbers) {
            System.out.println(record.getSid());
        }
    }
}
curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
curl -X GET 'https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json' \
-u ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token
{
  "end": 0,
  "first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json?PageSize=1&Page=0",
  "incoming_phone_numbers": [
    {
      "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "address_requirements": "none",
      "address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "api_version": "2010-04-01",
      "beta": null,
      "capabilities": {
        "mms": true,
        "sms": false,
        "voice": true
      },
      "date_created": "Thu, 30 Jul 2015 23:19:04 +0000",
      "date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
      "emergency_status": "Active",
      "emergency_address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "friendly_name": "(808) 925-5327",
      "identity_sid": "RIXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "origin": "origin",
      "phone_number": "+15017122661",
      "sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "sms_application_sid": "APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "sms_fallback_method": "POST",
      "sms_fallback_url": "",
      "sms_method": "POST",
      "sms_url": "",
      "status_callback": "",
      "status_callback_method": "POST",
      "trunk_sid": "TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
      "voice_application_sid": "APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "voice_caller_id_lookup": false,
      "voice_fallback_method": "POST",
      "voice_fallback_url": null,
      "voice_method": "POST",
      "voice_url": null
    }
  ],
  "last_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json?PageSize=1&Page=2",
  "next_page_uri": null,
  "num_pages": 3,
  "page": 0,
  "page_size": 1,
  "previous_page_uri": null,
  "start": 0,
  "total": 3,
  "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json?PageSize=1",
  "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}
<TwilioResponse>
  <IncomingPhoneNumbers page="0" pagesize="50" uri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers" firstpageuri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers?Page=0&PageSize=50" previouspageuri="" nextpageuri="">
    <IncomingPhoneNumber>
      <Sid>PN3f94c94562ac88dccf16f8859a1a8b25</Sid>
      <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
      <FriendlyName>Long Play</FriendlyName>
      <PhoneNumber>+14152374451</PhoneNumber>
      <VoiceUrl>http://demo.twilio.com/docs/voice.xml</VoiceUrl>
      <VoiceMethod>GET</VoiceMethod>
      <VoiceFallbackUrl/>
      <VoiceFallbackMethod/>
      <VoiceCallerIdLookup>false</VoiceCallerIdLookup>
      <VoiceApplicationSid/>
      <DateCreated>Thu, 13 Nov 2008 07:56:24 +0000</DateCreated>
      <DateUpdated>Thu, 13 Nov 2008 08:45:58 +0000</DateUpdated>
      <SmsUrl/>
      <SmsMethod/>
      <SmsFallbackUrl/>
      <SmsFallbackMethod/>
      <SmsApplicationSid>AP9b2e38d8c592488c397fc871a82a74ec</SmsApplicationSid>
      <Capabilities>
        <Voice>true</Voice>
        <SMS>false</SMS>
        <MMS>false</MMS>
      </Capabilities>
      <Beta>false</Beta>
      <StatusCallback/>
      <StatusCallbackMethod/>
      <ApiVersion>2010-04-01</ApiVersion>
      <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PN3f94c94562ac88dccf16f8859a1a8b25</Uri>
    </IncomingPhoneNumber>
    ...
  </IncomingPhoneNumbers>
</TwilioResponse>
アカウントのすべての IncomingPhoneNumber のリストの取得
例 2

(415) 867-5309 に完全に一致する電話番号のセットを返します。

コードサンプルを読み込んでいます...
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.incomingPhoneNumbers.list(
  {
    phoneNumber: '+14158675310',
  },
  (err, data) => {
    data.incomingPhoneNumbers.forEach(number => {
      console.log(number.phoneNumber);
    });
  }
);
// Download the helper library from https://www.twilio.com/docs/node/install
// Your Account Sid and Auth Token from twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.incomingPhoneNumbers
      .each({
         phoneNumber: '+14158675310'
       },
           incomingPhoneNumbers => console.log(incomingPhoneNumbers.sid)
       );
// 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 numbers = twilio.ListIncomingPhoneNumbers("+14158675310", null, null, null);
    
    foreach (var number in numbers.IncomingPhoneNumbers)
    {
      Console.WriteLine(number.PhoneNumber);
    }
  }
}
<?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 numbers and echo a property for each one
foreach ($client->account->incoming_phone_numbers->getIterator(0, 50, array(
        "PhoneNumber" => "+14158675310"
    )) as $number
) {
    echo $number->phone_number;
}
# 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 numbers and print out a property for each one
numbers = client.account
                .incoming_phone_numbers.list(phone_number: '+14158675310')
numbers.each do |number|
  puts number.phone_number
end
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;


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

        TwilioClient.Init(accountSid, authToken);

        var incomingPhoneNumbers = IncomingPhoneNumberResource.Read(
            phoneNumber: new Twilio.Types.PhoneNumber("+14158675310"),
            pathAccountSid: "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
        );

        foreach(var record in incomingPhoneNumbers)
        {
           Console.WriteLine(record.Sid);
        }
    }
}
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once '/path/to/vendor/autoload.php';

use Twilio\Rest\Client;

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

$incomingPhoneNumbers = $twilio->incomingPhoneNumbers
                               ->read(array("phoneNumber" => "+14158675310"));

foreach ($incomingPhoneNumbers as $record) {
    print($record->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)

# A list of number objects with the properties described above
numbers = client.phone_numbers.list(phone_number="+14158675310")
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'rubygems'
require 'twilio-ruby'

# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

incoming_phone_numbers = @client.incoming_phone_numbers
                                .list(phone_number: '+14158675310')

incoming_phone_numbers.each do |record|
  puts record.sid
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.IncomingPhoneNumber;
import com.twilio.sdk.resource.list.IncomingPhoneNumberList;
import java.util.HashMap;
import java.util.Map;

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 IncomingPhoneNumberList
    Map<String, String> params = new HashMap<String, String>();
    
    params.put("PhoneNumber", "+14158675310");
    
    IncomingPhoneNumberList numbers = client.getAccount().getIncomingPhoneNumbers(params);
    
    // Loop over numbers and print out a property for each one.
    for (IncomingPhoneNumber number : numbers) {
      System.out.println(number.getPhoneNumber());
    } 
  }
}
# Download the helper library from https://www.twilio.com/docs/python/install
from twilio.rest import Client


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

incoming_phone_numbers = client.incoming_phone_numbers \
                               .list(phone_number='+14158675310')

for record in incoming_phone_numbers:
    print(record.sid)
// 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.IncomingPhoneNumber;
import com.twilio.type.PhoneNumber;

public class Example {
    // Find your Account Sid and Token at twilio.com/console
    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<IncomingPhoneNumber> incomingPhoneNumbers = 
            IncomingPhoneNumber.reader()
            .setPhoneNumber(new com.twilio.type.PhoneNumber("+14158675310"))
            .read();

        for(IncomingPhoneNumber record : incomingPhoneNumbers) {
            System.out.println(record.getSid());
        }
    }
}
curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers \
    -d "PhoneNumber=%2B14158675310" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
curl -X GET 'https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json?PhoneNumber=%2B14158675310' \
-u ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token
{
  "end": 0,
  "first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json?PageSize=1&Page=0",
  "incoming_phone_numbers": [
    {
      "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "address_requirements": "none",
      "address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "api_version": "2010-04-01",
      "beta": null,
      "capabilities": {
        "mms": true,
        "sms": false,
        "voice": true
      },
      "date_created": "Thu, 30 Jul 2015 23:19:04 +0000",
      "date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
      "emergency_status": "Active",
      "emergency_address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "friendly_name": "(808) 925-5327",
      "identity_sid": "RIXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "origin": "origin",
      "phone_number": "+14158675310",
      "sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "sms_application_sid": "APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "sms_fallback_method": "POST",
      "sms_fallback_url": "",
      "sms_method": "POST",
      "sms_url": "",
      "status_callback": "",
      "status_callback_method": "POST",
      "trunk_sid": "TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
      "voice_application_sid": "APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "voice_caller_id_lookup": false,
      "voice_fallback_method": "POST",
      "voice_fallback_url": null,
      "voice_method": "POST",
      "voice_url": null
    }
  ],
  "last_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json?PageSize=1&Page=2",
  "next_page_uri": null,
  "num_pages": 3,
  "page": 0,
  "page_size": 1,
  "previous_page_uri": null,
  "start": 0,
  "total": 3,
  "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json?PageSize=1",
  "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "phone_number": "+14158675310"
}
<?xml version="1.0" encoding="UTF-8"?>
<TwilioResponse>
    <IncomingPhoneNumbers page="0" pagesize="50" uri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.xml?PhoneNumber=%2B14158675310" firstpageuri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.xml?PhoneNumber=%2B14158675310&Page=0&PageSize=50" previouspageuri="" nextpageuri="">
        <IncomingPhoneNumber>
            <Sid>PN3f94c94562ac88dccf16f8859a1a8b25</Sid>
            <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
            <FriendlyName>Joey</FriendlyName>
            <PhoneNumber>+14158675310</PhoneNumber>
            <VoiceUrl>http://demo.twilio.com/docs/voice.xml</VoiceUrl>
            <VoiceMethod>GET</VoiceMethod>
            <VoiceFallbackUrl/>
            <VoiceFallbackMethod/>
            <VoiceCallerIdLookup>false</VoiceCallerIdLookup>
            <VoiceApplicationSid/>
            <DateCreated>Thu, 13 Nov 2008 07:56:24 +0000</DateCreated>
            <DateUpdated>Thu, 13 Nov 2008 08:45:58 +0000</DateUpdated>
            <SmsUrl/>
            <SmsMethod/>
            <SmsFallbackUrl/>
            <SmsFallbackMethod/>
            <SmsApplicationSid>AP9b2e38d8c592488c397fc871a82a74ec</SmsApplicationSid>
            <Capabilities>
                <Voice>true</Voice>
                <SMS>false</SMS>
                <MMS>false</MMS>
            </Capabilities>
            <Beta>false</Beta>
            <StatusCallback/>
            <StatusCallbackMethod/>
            <ApiVersion>2010-04-01</ApiVersion>
            <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PN3f94c94562ac88dccf16f8859a1a8b26</Uri>
        </IncomingPhoneNumber>
    </IncomingPhoneNumbers>
</TwilioResponse>
完全一致による IncomingPhoneNumbers のフィルタリング
例 3

数字 867 を含むすべてのショート コードのセットを返します。

コードサンプルを読み込んでいます...
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.incomingPhoneNumbers.list(
  {
    phoneNumber: '867',
  },
  (err, data) => {
    data.incomingPhoneNumbers.forEach(number => {
      console.log(number.voiceUrl);
    });
  }
);
// Download the helper library from https://www.twilio.com/docs/node/install
// Your Account Sid and Auth Token from twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.incomingPhoneNumbers
      .each({
         phoneNumber: '867'
       },
           incomingPhoneNumbers => console.log(incomingPhoneNumbers.sid)
       );
// 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 numbers = twilio.ListIncomingPhoneNumbers("867", null, null, null);
    
    foreach (var number in numbers.IncomingPhoneNumbers)
    {
      Console.WriteLine(number.VoiceUrl);
    }
  }
}
<?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 numbers and echo a property for each one
foreach ($client->account->incoming_phone_numbers->getIterator(0, 50, array(
        "PhoneNumber" => "867"
    )) as $number
) {
    echo $number->voice_url;
}
# 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 numbers and print out a property for each one
numbers = client.account.incoming_phone_numbers.list(phone_number: '867')
numbers.each do |number|
  puts number.voice_url
end
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;


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

        TwilioClient.Init(accountSid, authToken);

        var incomingPhoneNumbers = IncomingPhoneNumberResource.Read(
            phoneNumber: new Twilio.Types.PhoneNumber("867"),
            pathAccountSid: "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
        );

        foreach(var record in incomingPhoneNumbers)
        {
           Console.WriteLine(record.Sid);
        }
    }
}
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once '/path/to/vendor/autoload.php';

use Twilio\Rest\Client;

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

$incomingPhoneNumbers = $twilio->incomingPhoneNumbers
                               ->read(array("phoneNumber" => "867"));

foreach ($incomingPhoneNumbers as $record) {
    print($record->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)

# A list of number objects with the properties described above
numbers = client.phone_numbers.list(phone_number="867")
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'rubygems'
require 'twilio-ruby'

# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

incoming_phone_numbers = @client.incoming_phone_numbers.list(
                                                          phone_number: '867'
                                                        )

incoming_phone_numbers.each do |record|
  puts record.sid
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.IncomingPhoneNumber;
import com.twilio.sdk.resource.list.IncomingPhoneNumberList;
import java.util.HashMap;
import java.util.Map;

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 IncomingPhoneNumberList
    Map<String, String> params = new HashMap<String, String>();
    
    params.put("PhoneNumber", "867");
    
    IncomingPhoneNumberList numbers = client.getAccount().getIncomingPhoneNumbers(params);
    
    // Loop over numbers and print out a property for each one.
    for (IncomingPhoneNumber number : numbers) {
      System.out.println(number.getVoiceUrl());
    } 
  }
}
# Download the helper library from https://www.twilio.com/docs/python/install
from twilio.rest import Client


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

incoming_phone_numbers = client.incoming_phone_numbers.list(phone_number='867')

for record in incoming_phone_numbers:
    print(record.sid)
// 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.IncomingPhoneNumber;
import com.twilio.type.PhoneNumber;

public class Example {
    // Find your Account Sid and Token at twilio.com/console
    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<IncomingPhoneNumber> incomingPhoneNumbers = 
            IncomingPhoneNumber.reader()
            .setPhoneNumber(new com.twilio.type.PhoneNumber("867"))
            .read();

        for(IncomingPhoneNumber record : incomingPhoneNumbers) {
            System.out.println(record.getSid());
        }
    }
}
curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers \
    -d "PhoneNumber=867" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
curl -X GET 'https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json?PhoneNumber=867' \
-u ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token
{
  "end": 0,
  "first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json?PageSize=1&Page=0",
  "incoming_phone_numbers": [
    {
      "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "address_requirements": "none",
      "address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "api_version": "2010-04-01",
      "beta": null,
      "capabilities": {
        "mms": true,
        "sms": false,
        "voice": true
      },
      "date_created": "Thu, 30 Jul 2015 23:19:04 +0000",
      "date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
      "emergency_status": "Active",
      "emergency_address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "friendly_name": "(808) 925-5327",
      "identity_sid": "RIXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "origin": "origin",
      "phone_number": "867",
      "sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "sms_application_sid": "APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "sms_fallback_method": "POST",
      "sms_fallback_url": "",
      "sms_method": "POST",
      "sms_url": "",
      "status_callback": "",
      "status_callback_method": "POST",
      "trunk_sid": "TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
      "voice_application_sid": "APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "voice_caller_id_lookup": false,
      "voice_fallback_method": "POST",
      "voice_fallback_url": null,
      "voice_method": "POST",
      "voice_url": null
    }
  ],
  "last_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json?PageSize=1&Page=2",
  "next_page_uri": null,
  "num_pages": 3,
  "page": 0,
  "page_size": 1,
  "previous_page_uri": null,
  "start": 0,
  "total": 3,
  "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json?PageSize=1",
  "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "phone_number": "867"
}
<?xml version="1.0" encoding="UTF-8"?>
<TwilioResponse>
    <IncomingPhoneNumbers page="0" pagesize="50" uri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.xml?PhoneNumber=%2B14158675310" firstpageuri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.xml?PhoneNumber=%2B14158675310&Page=0&PageSize=50" previouspageuri="" nextpageuri="">
        <IncomingPhoneNumber>
            <Sid>PN3f94c94562ac88dccf16f8859a1a8b25</Sid>
            <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
            <FriendlyName>Joey</FriendlyName>
            <PhoneNumber>+14158675310</PhoneNumber>
            <VoiceUrl>http://demo.twilio.com/docs/voice.xml</VoiceUrl>
            <VoiceMethod>GET</VoiceMethod>
            <VoiceFallbackUrl/>
            <VoiceFallbackMethod/>
            <VoiceCallerIdLookup>false</VoiceCallerIdLookup>
            <VoiceApplicationSid/>
            <DateCreated>Thu, 13 Nov 2008 07:56:24 +0000</DateCreated>
            <DateUpdated>Thu, 13 Nov 2008 08:45:58 +0000</DateUpdated>
            <SmsUrl/>
            <SmsMethod/>
            <SmsFallbackUrl/>
            <SmsFallbackMethod/>
            <SmsApplicationSid>AP9b2e38d8c592488c397fc871a82a74ec</SmsApplicationSid>
            <Capabilities>
                <Voice>true</Voice>
                <SMS>false</SMS>
                <MMS>false</MMS>
            </Capabilities>
            <Beta>false</Beta>
            <StatusCallback/>
            <StatusCallbackMethod/>
            <ApiVersion>2010-04-01</ApiVersion>
            <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PN3f94c94562ac88dccf16f8859a1a8b26</Uri>
        </IncomingPhoneNumber>
    ...
    </IncomingPhoneNumbers>
</TwilioResponse>
部分一致による IncomingPhoneNumbers のフィルタリング
POST
https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{IncomingPhoneNumberSid}

着信電話番号のプロパティを更新します。更新に成功すると、更新されたリソース表現を返します。 返却されるレスポンスは、GET リクエストを送信した場合と同じです。

パラメーター

次のパラメーターの 1 つまたは複数を指定して、この電話番号のプロパティを更新できます。

名前 概要
AccountSid

Required. The unique 34 character id of the account to which you wish to transfer this phone number. See Exchanging Numbers Between Subaccounts. (🏢 not PII)

AddressSid

Optional. The 34 character sid of the address Twilio should associate with the number. If the number has address restrictions, only another address that satisfies the requirement can replace the existing one. (🏢 not PII)

ApiVersion

Optional. Calls to this phone number will start a new TwiML session with this API version. Either 2010-04-01 or 2008-08-01. (🏢 not PII)

FriendlyName

Optional. A human readable descriptive text for this resource, up to 64 characters long. By default, the FriendlyName is a nicely formatted version of the phone number. (📇 PII MTL: 30 days)

IdentitySid

Optional. The 34 character sid of the identity Twilio should use to associate with the number. Identities are required in some regions to meet local regulations (🏢 not PII)

SmsApplicationSid

Optional. The 34 character sid of the application Twilio should use to handle SMSs sent to this number. If a SmsApplicationSid is present, Twilio will ignore all of the SMS urls above and use those set on the application instead. (🏢 not PII)

SmsFallbackMethod

Optional. The HTTP method that should be used to request the SmsFallbackUrl. Either GET or POST. (🏢 not PII)

SmsFallbackUrl

Optional. A URL that Twilio will request if an error occurs requesting or executing the TwiML defined by SmsUrl. (🏢 not PII)

SmsMethod

Optional. The HTTP method Twilio will use when making requests to the SmsUrl. Either GET or POST. (🏢 not PII)

SmsUrl

Optional. The URL that Twilio should request when somebody sends an SMS to the new phone number. (🏢 not PII)

StatusCallback

Optional. The URL that Twilio will request to pass status parameters (such as call ended) to your application. (🏢 not PII)

StatusCallbackMethod

Optional. The HTTP method Twilio will use to make requests to the StatusCallback URL. Either GET or POST. (🏢 not PII)

TrunkSid

Optional. The 34 character sid of the Trunk Twilio should use to handle phone calls to this number. If a TrunkSid is present, Twilio will ignore all of the voice urls and voice applications above and use those set on the Trunk. Setting a TrunkSid will automatically delete your VoiceApplicationSid and vice versa. (🏢 not PII)

VoiceApplicationSid

Optional. The 34 character sid of the application Twilio should use to handle phone calls to this number. If a VoiceApplicationSid is present, Twilio will ignore all of the voice urls above and use those set on the application instead. Setting a VoiceApplicationSid will automatically delete your TrunkSid and vice versa. (🏢 not PII)

VoiceCallerIdLookup

Optional. Look up the caller's caller-ID name from the CNAM database ($0.01 per look up). Either true or false. (🏢 not PII)

VoiceFallbackMethod

Optional. The HTTP method Twilio will use when requesting the VoiceFallbackUrl. Either GET or POST. (🏢 not PII)

VoiceFallbackUrl

Optional. A URL that Twilio will request if an error occurs requesting or executing the TwiML defined by VoiceUrl. (🏢 not PII)

VoiceMethod

Optional. The HTTP method Twilio will use when requesting the above Url. Either GET or POST. (🏢 not PII)

VoiceUrl

Optional. The URL that Twilio should request when somebody dials the phone number. The VoiceURL will no longer be used if a VoiceApplicationSid or a TrunkSid is set. (🏢 not PII)

例 1

VoiceUrlとSmsUrlを電話場号に割り当てます

コードサンプルを読み込んでいます...
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.incomingPhoneNumbers('PN2a0747eba6abf96b7e3c3ff0b4530f6e').update({
  voiceUrl: 'http://demo.twilio.com/docs/voice.xml',
  smsUrl: 'http://demo.twilio.com/docs/sms.xml',
}, (err, number) => {
  console.log(number.voiceUrl);
});
// Download the helper library from https://www.twilio.com/docs/node/install
// Your Account Sid and Auth Token from twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.incomingPhoneNumbers('PN2a0747eba6abf96b7e3c3ff0b4530f6e')
  .update({
     accountSid: 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
     smsUrl: 'http://demo.twilio.com/docs/sms.xml',
     voiceUrl: 'http://demo.twilio.com/docs/voice.xml'
   })
  .then(incoming_phone_number => console.log(incoming_phone_number.friendlyName))
  .done();
// 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 PhoneNumberOptions();
    options.VoiceUrl = "http://demo.twilio.com/docs/voice.xml";
    options.SmsUrl = "http://demo.twilio.com/docs/sms.xml";
    
    twilio.UpdateIncomingPhoneNumber("PN2a0747eba6abf96b7e3c3ff0b4530f6e", 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
$number = $client->account->incoming_phone_numbers->get("PN2a0747eba6abf96b7e3c3ff0b4530f6e");
$number->update(array(
        "VoiceUrl" => "http://demo.twilio.com/docs/voice.xml",
    "SmsUrl" => "http://demo.twilio.com/docs/sms.xml"
    ));
echo $number->voice_url;
# 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
number = client.account
               .incoming_phone_numbers
               .get('PN2a0747eba6abf96b7e3c3ff0b4530f6e')
               .update(voice_url: 'http://demo.twilio.com/docs/voice.xml',
                       sms_url: 'http://demo.twilio.com/docs/sms.xml')
puts number.voice_url
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;


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

        TwilioClient.Init(accountSid, authToken);

        var incomingPhoneNumber = IncomingPhoneNumberResource.Update(
            accountSid: "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
            smsUrl: new Uri("http://demo.twilio.com/docs/sms.xml"),
            voiceUrl: new Uri("http://demo.twilio.com/docs/voice.xml"),
            pathAccountSid: "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
            pathSid: "PN2a0747eba6abf96b7e3c3ff0b4530f6e"
        );

        Console.WriteLine(incomingPhoneNumber.FriendlyName);
    }
}
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once '/path/to/vendor/autoload.php';

use Twilio\Rest\Client;

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

$incoming_phone_number = $twilio->incomingPhoneNumbers("PN2a0747eba6abf96b7e3c3ff0b4530f6e")
                                ->update(array(
                                             "accountSid" => "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
                                             "smsUrl" => "http://demo.twilio.com/docs/sms.xml",
                                             "voiceUrl" => "http://demo.twilio.com/docs/voice.xml"
                                         )
                                );

print($incoming_phone_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)

number = client.phone_numbers.update(
    "PN2a0747eba6abf96b7e3c3ff0b4530f6e",
    voice_url="http://demo.twilio.com/docs/voice.xml",
    sms_url="http://demo.twilio.com/docs/sms.xml"
)
print(number.voice_url)
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'rubygems'
require 'twilio-ruby'

# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

incoming_phone_number = @client
  .incoming_phone_numbers('PN2a0747eba6abf96b7e3c3ff0b4530f6e')
  .update(
     account_sid: 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
     sms_url: 'http://demo.twilio.com/docs/sms.xml',
     voice_url: 'http://demo.twilio.com/docs/voice.xml'
   )

puts incoming_phone_number.friendly_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.IncomingPhoneNumber;
import com.twilio.sdk.resource.list.IncomingPhoneNumberList;
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
    IncomingPhoneNumber number = client.getAccount().getIncomingPhoneNumber("PN2a0747eba6abf96b7e3c3ff0b4530f6e");
    // Build a filter for the IncomingPhoneNumberList
    List<NameValuePair> params = new ArrayList<NameValuePair>();
    params.add(new BasicNameValuePair("VoiceUrl", "http://demo.twilio.com/docs/voice.xml"));
    params.add(new BasicNameValuePair("SmsUrl", "http://demo.twilio.com/docs/sms.xml"));
    number.update(params); 
  }
}
# Download the helper library from https://www.twilio.com/docs/python/install
from twilio.rest import Client


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

incoming_phone_number = client \
    .incoming_phone_numbers('PN2a0747eba6abf96b7e3c3ff0b4530f6e') \
    .update(
         account_sid='ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
         sms_url='http://demo.twilio.com/docs/sms.xml',
         voice_url='http://demo.twilio.com/docs/voice.xml'
     )

print(incoming_phone_number.friendly_name)
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.api.v2010.account.IncomingPhoneNumber;

import java.net.URI;

public class Example {
    // Find your Account Sid and Token at twilio.com/console
    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);
        IncomingPhoneNumber incomingPhoneNumber = IncomingPhoneNumber.updater(
                "PN2a0747eba6abf96b7e3c3ff0b4530f6e")
            .setAccountSid("ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
            .setSmsUrl(URI.create("http://demo.twilio.com/docs/sms.xml"))
            .setVoiceUrl(URI.create("http://demo.twilio.com/docs/voice.xml"))
            .update();

        System.out.println(incomingPhoneNumber.getFriendlyName());
    }
}
curl -XPOST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PN2a0747eba6abf96b7e3c3ff0b4530f6e \
    -d "VoiceUrl=http://demo.twilio.com/docs/voice.xml" \
    -d "SmsUrl=http://demo.twilio.com/docs/sms.xml" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
curl -X POST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PN2a0747eba6abf96b7e3c3ff0b4530f6e.json \
--data-urlencode "AccountSid=ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
--data-urlencode "SmsUrl=http://demo.twilio.com/docs/sms.xml" \
--data-urlencode "VoiceUrl=http://demo.twilio.com/docs/voice.xml" \
-u ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token
{
  "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "address_requirements": "none",
  "address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "api_version": "2010-04-01",
  "beta": false,
  "capabilities": {
    "mms": true,
    "sms": false,
    "voice": true
  },
  "date_created": "Thu, 30 Jul 2015 23:19:04 +0000",
  "date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
  "emergency_status": "Inactive",
  "emergency_address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "friendly_name": "(808) 925-5327",
  "identity_sid": "RIXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "origin": "origin",
  "phone_number": "+15017122661",
  "sid": "PN2a0747eba6abf96b7e3c3ff0b4530f6e",
  "sms_application_sid": "APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "sms_fallback_method": "POST",
  "sms_fallback_url": "",
  "sms_method": "POST",
  "sms_url": "http://demo.twilio.com/docs/sms.xml",
  "status_callback": "",
  "status_callback_method": "POST",
  "trunk_sid": "TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PN2a0747eba6abf96b7e3c3ff0b4530f6e.json",
  "voice_application_sid": "APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "voice_caller_id_lookup": false,
  "voice_fallback_method": "POST",
  "voice_fallback_url": null,
  "voice_method": "POST",
  "voice_url": "http://demo.twilio.com/docs/voice.xml"
}
<TwilioResponse>
  <IncomingPhoneNumber>
    <Sid>PN2a0747eba6abf96b7e3c3ff0b4530f6e</Sid>
    <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
    <FriendlyName>My Company Line</FriendlyName>
    <PhoneNumber>+15105647903</PhoneNumber>
    <VoiceUrl>http://demo.twilio.com/docs/voice.xml</VoiceUrl>
    <VoiceMethod>POST</VoiceMethod>
    <VoiceFallbackUrl/>
    <VoiceFallbackMethod>POST</VoiceFallbackMethod>
    <VoiceCallerIdLookup>false</VoiceCallerIdLookup>
    <VoiceApplicationSid/>
    <DateCreated>Mon, 16 Aug 2010 23:00:23 +0000</DateCreated>
    <DateUpdated>Mon, 16 Aug 2010 23:00:23 +0000</DateUpdated>
    <SmsUrl>http://demo.twilio.com/docs/sms.xml</SmsUrl>
    <SmsMethod>POST</SmsMethod>
    <SmsFallbackUrl/>
    <SmsFallbackMethod>GET</SmsFallbackMethod>
    <SmsApplicationSid/>
    <Capabilities>
      <Voice>true</Voice>
      <SMS>true</SMS>
      <MMS>false</MMS>
    </Capabilities>
    <Beta>false</Beta>
    <StatusCallback/>
    <StatusCallbackMethod/>
    <ApiVersion>2010-04-01</ApiVersion>
    <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PN2a0747eba6abf96b7e3c3ff0b4530f6e</Uri>
  </IncomingPhoneNumber>
</TwilioResponse>
IncomingPhoneNumber の更新
削除
https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{IncomingPhoneNumberSid}

この電話番号をアカウントから開放します。 Twilio は今後、この電話番号への通話に応答しません。毎月の電話番号使用料の課金は停止されます。電話番号は再利用されます。将来他のユーザーに付与される可能性がありますので、注意してください。 誤って開放してしまった場合は、Twilio へお問い合わせください。 番号を復元できる場合があります。

開放に成功すると、ボディーのない HTTP 204 レスポンスを返します。

例 1

Release a phone number from your account.

コードサンプルを読み込んでいます...
Language
SDKバージョン:
  • 5.x
レスポンス形式:
  • JSON
SDKバージョン:
  • 7.x
SDKバージョン:
  • 3.x
SDKバージョン:
  • 5.x
SDKバージョン:
  • 6.x
SDKバージョン:
  • 5.x
形式:
  • JSON
// Download the helper library from https://www.twilio.com/docs/node/install
// Your Account Sid and Auth Token from twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.incomingPhoneNumbers('PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
      .remove()
      .then(incoming_phone_number => console.log(incoming_phone_number.sid))
      .done();
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;


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

        TwilioClient.Init(accountSid, authToken);

        IncomingPhoneNumberResource.Delete(
            pathAccountSid: "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
            pathSid: "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
        );
    }
}
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once '/path/to/vendor/autoload.php';

use Twilio\Rest\Client;

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

$twilio->incomingPhoneNumbers("PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
       ->delete();
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'rubygems'
require 'twilio-ruby'

# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

@client.incoming_phone_numbers('PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete
# Download the helper library from https://www.twilio.com/docs/python/install
from twilio.rest import Client


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

client.incoming_phone_numbers('PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.api.v2010.account.IncomingPhoneNumber;

public class Example {
    // Find your Account Sid and Token at twilio.com/console
    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);
        IncomingPhoneNumber.deleter(
                "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
            .delete();
    }
}
curl -X DELETE https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json \
-u ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token
null
Delete Incoming Phone Number

ヘルプが必要ですか?

誰しもが一度は考える「コーディングって難しい」。そんな時は、お問い合わせフォームから質問してください。 または、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
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.incomingPhoneNumbers.create(
  {
    friendlyName: 'My Company Line',
    voiceUrl: 'http://demo.twilio.com/docs/voice.xml',
    phoneNumber: '+15105647903',
    voiceMethod: 'GET',
  },
  (err, number) => {
    console.log(number.sid);
  }
);
// Download the helper library from https://www.twilio.com/docs/node/install
// Your Account Sid and Auth Token from twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.incomingPhoneNumbers
      .create({
         friendlyName: 'My Company Line',
         phoneNumber: '+15105647903',
         voiceMethod: 'GET',
         voiceUrl: 'http://demo.twilio.com/docs/voice.xml'
       })
      .then(incoming_phone_number => console.log(incoming_phone_number.sid))
      .done();
// 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 PhoneNumberOptions();
    options.FriendlyName = "My Company Line";
    options.VoiceUrl = "http://demo.twilio.com/docs/voice.xml";
    options.PhoneNumber = "+15105647903";
    options.VoiceMethod = "GET";
    var number = twilio.AddIncomingPhoneNumber(options);
    
    Console.WriteLine(number.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);

$number = $client->account->incoming_phone_numbers->create(
    array(
        "FriendlyName" => "My Company Line",
        "VoiceUrl" => "http://demo.twilio.com/docs/voice.xml",
        "PhoneNumber" => "+15105647903",
        "VoiceMethod" => "GET"
    )
);
echo $number->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

number = @client.account.incoming_phone_numbers
                .create(friendly_name: 'My Company Line',
                        voice_url: 'http://demo.twilio.com/docs/voice.xml',
                        phone_number: '+15105647903',
                        voice_method: 'GET')
puts number.sms_url
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;


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

        TwilioClient.Init(accountSid, authToken);

        var incomingPhoneNumber = IncomingPhoneNumberResource.Create(
            friendlyName: "My Company Line",
            phoneNumber: new Twilio.Types.PhoneNumber("+15105647903"),
            voiceMethod: Twilio.Http.HttpMethod.Get,
            voiceUrl: new Uri("http://demo.twilio.com/docs/voice.xml"),
            pathAccountSid: "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
        );

        Console.WriteLine(incomingPhoneNumber.Sid);
    }
}
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once '/path/to/vendor/autoload.php';

use Twilio\Rest\Client;

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

$incoming_phone_number = $twilio->incomingPhoneNumbers
                                ->create(array(
                                             "friendlyName" => "My Company Line",
                                             "phoneNumber" => "+15105647903",
                                             "voiceMethod" => "GET",
                                             "voiceUrl" => "http://demo.twilio.com/docs/voice.xml"
                                         )
                                );

print($incoming_phone_number->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)

number = client.phone_numbers.purchase(
    friendly_name="My Company Line",
    voice_url="http://demo.twilio.com/docs/voice.xml",
    phone_number="+15105647903",
    voice_method="GET"
)
print(number.sid)
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'rubygems'
require 'twilio-ruby'

# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

incoming_phone_number = @client.incoming_phone_numbers
  .create(
     friendly_name: 'My Company Line',
     phone_number: '+15105647903',
     voice_method: 'GET',
     voice_url: 'http://demo.twilio.com/docs/voice.xml'
   )

puts incoming_phone_number.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.factory.IncomingPhoneNumberFactory;
import com.twilio.sdk.resource.instance.IncomingPhoneNumber;
import com.twilio.sdk.resource.list.IncomingPhoneNumberList;
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);

    // Build a filter for the IncomingPhoneNumberList
    List<NameValuePair> params = new ArrayList<NameValuePair>();
    params.add(new BasicNameValuePair("FriendlyName", "My Company Line"));
    params.add(new BasicNameValuePair("VoiceUrl", "http://demo.twilio.com/docs/voice.xml"));
    params.add(new BasicNameValuePair("PhoneNumber", "+15105647903"));
    params.add(new BasicNameValuePair("VoiceMethod", "GET"));
    
    IncomingPhoneNumberFactory numberFactory = client.getAccount().getIncomingPhoneNumberFactory();
    IncomingPhoneNumber number = numberFactory.create(params);
    System.out.println(number.getSid());
  }
}
# Download the helper library from https://www.twilio.com/docs/python/install
from twilio.rest import Client


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

incoming_phone_number = client.incoming_phone_numbers \
    .create(
         friendly_name='My Company Line',
         phone_number='+15105647903',
         voice_method='GET',
         voice_url='http://demo.twilio.com/docs/voice.xml'
     )

print(incoming_phone_number.sid)
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.http.HttpMethod;
import com.twilio.rest.api.v2010.account.IncomingPhoneNumber;
import com.twilio.type.PhoneNumber;

import java.net.URI;

public class Example {
    // Find your Account Sid and Token at twilio.com/console
    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);
        IncomingPhoneNumber incomingPhoneNumber = IncomingPhoneNumber.creator(
                new com.twilio.type.PhoneNumber("+15105647903"))
            .setFriendlyName("My Company Line")
            .setVoiceMethod(HttpMethod.GET)
            .setVoiceUrl(URI.create("http://demo.twilio.com/docs/voice.xml"))
            .create();

        System.out.println(incomingPhoneNumber.getSid());
    }
}
curl -XPOST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers \
    -d "FriendlyName=My%20Company%20Line" \
    -d "VoiceUrl=http://demo.twilio.com/docs/voice.xml" \
    -d "PhoneNumber=%2B15105647903" \
    -d "VoiceMethod=GET" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
curl -X POST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json \
--data-urlencode "FriendlyName=My Company Line" \
--data-urlencode "PhoneNumber=+15105647903" \
--data-urlencode "VoiceMethod=GET" \
--data-urlencode "VoiceUrl=http://demo.twilio.com/docs/voice.xml" \
-u ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token
{
  "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "address_requirements": "none",
  "address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "api_version": "2010-04-01",
  "beta": false,
  "capabilities": {
    "mms": true,
    "sms": false,
    "voice": true
  },
  "date_created": "Thu, 30 Jul 2015 23:19:04 +0000",
  "date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
  "emergency_status": "Active",
  "emergency_address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "friendly_name": "My Company Line",
  "identity_sid": "RIXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "origin": "origin",
  "phone_number": "+15105647903",
  "sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "sms_application_sid": "APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "sms_fallback_method": "POST",
  "sms_fallback_url": "",
  "sms_method": "POST",
  "sms_url": "",
  "status_callback": "",
  "status_callback_method": "POST",
  "trunk_sid": "TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
  "voice_application_sid": "APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "voice_caller_id_lookup": false,
  "voice_fallback_method": "POST",
  "voice_fallback_url": null,
  "voice_method": "GET",
  "voice_url": "http://demo.twilio.com/docs/voice.xml"
}
<TwilioResponse>
  <IncomingPhoneNumber>
    <Sid>PN2a0747eba6abf96b7e3c3ff0b4530f6e</Sid>
    <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
    <FriendlyName>My Company Line</FriendlyName>
    <PhoneNumber>+15105647903</PhoneNumber>
    <VoiceUrl>http://demo.twilio.com/docs/voice.xml</VoiceUrl>
    <VoiceMethod>GET</VoiceMethod>
    <VoiceFallbackUrl></VoiceFallbackUrl>
    <VoiceFallbackMethod>POST</VoiceFallbackMethod>
    <VoiceCallerIdLookup>false</VoiceCallerIdLookup>
    <VoiceApplicationSid/>
    <DateCreated>Mon, 16 Aug 2010 23:00:23 +0000</DateCreated>
    <DateUpdated>Mon, 16 Aug 2010 23:00:23 +0000</DateUpdated>
    <SmsUrl></SmsUrl>
    <SmsMethod>POST</SmsMethod>
    <SmsFallbackUrl></SmsFallbackUrl>
    <SmsFallbackMethod>GET</SmsFallbackMethod>
    <SmsApplicationSid/>
    <Capabilities>
      <Voice>true</Voice>
      <SMS>true</SMS>
      <MMS>false</MMS>
    </Capabilities>
    <Beta>false</Beta>
    <StatusCallback/>
    <StatusCallbackMethod/>
    <ApiVersion>2010-04-01</ApiVersion>
    <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PN2a0747eba6abf96b7e3c3ff0b4530f6e</Uri>
  </IncomingPhoneNumber>
</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
  .incomingPhoneNumbers('PN2a0747eba6abf96b7e3c3ff0b4530f6e')
  .get((err, number) => {
    console.log(number.phoneNumber);
  });
// Download the helper library from https://www.twilio.com/docs/node/install
// Your Account Sid and Auth Token from twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.incomingPhoneNumbers('PN2a0747eba6abf96b7e3c3ff0b4530f6e')
  .fetch()
  .then(incoming_phone_number => console.log(incoming_phone_number.friendlyName))
  .done();
// 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 number = twilio.GetIncomingPhoneNumber("PN2a0747eba6abf96b7e3c3ff0b4530f6e");
    
    Console.WriteLine(number.PhoneNumber);
  }
}
<?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
$number = $client->account->incoming_phone_numbers->get("PN2a0747eba6abf96b7e3c3ff0b4530f6e");
echo $number->phone_number;
# 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
number = client.account.incoming_phone_numbers
               .get('PN2a0747eba6abf96b7e3c3ff0b4530f6e')
puts number.phone_number
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;


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

        TwilioClient.Init(accountSid, authToken);

        var incomingPhoneNumber = IncomingPhoneNumberResource.Fetch(
            pathAccountSid: "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
            pathSid: "PN2a0747eba6abf96b7e3c3ff0b4530f6e"
        );

        Console.WriteLine(incomingPhoneNumber.FriendlyName);
    }
}
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once '/path/to/vendor/autoload.php';

use Twilio\Rest\Client;

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

$incoming_phone_number = $twilio->incomingPhoneNumbers("PN2a0747eba6abf96b7e3c3ff0b4530f6e")
                                ->fetch();

print($incoming_phone_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)

number = client.phone_numbers.get("PN2a0747eba6abf96b7e3c3ff0b4530f6e")
print(number.phone_number)
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'rubygems'
require 'twilio-ruby'

# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

incoming_phone_number = @client
  .incoming_phone_numbers('PN2a0747eba6abf96b7e3c3ff0b4530f6e')
  .fetch

puts incoming_phone_number.friendly_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.IncomingPhoneNumber;

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
    IncomingPhoneNumber number = client.getAccount().getIncomingPhoneNumber("PN2a0747eba6abf96b7e3c3ff0b4530f6e");
    System.out.println(number.getPhoneNumber());
    
  }
}
# Download the helper library from https://www.twilio.com/docs/python/install
from twilio.rest import Client


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

incoming_phone_number = client \
    .incoming_phone_numbers('PN2a0747eba6abf96b7e3c3ff0b4530f6e') \
    .fetch()

print(incoming_phone_number.friendly_name)
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.api.v2010.account.IncomingPhoneNumber;

public class Example {
    // Find your Account Sid and Token at twilio.com/console
    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);
        IncomingPhoneNumber incomingPhoneNumber = IncomingPhoneNumber.fetcher(
                "PN2a0747eba6abf96b7e3c3ff0b4530f6e")
            .fetch();

        System.out.println(incomingPhoneNumber.getFriendlyName());
    }
}
curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PN2a0747eba6abf96b7e3c3ff0b4530f6e \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
curl -X GET 'https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PN2a0747eba6abf96b7e3c3ff0b4530f6e.json' \
-u ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token
{
  "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "address_requirements": "none",
  "address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "api_version": "2010-04-01",
  "beta": false,
  "capabilities": {
    "mms": true,
    "sms": false,
    "voice": true
  },
  "date_created": "Thu, 30 Jul 2015 23:19:04 +0000",
  "date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
  "emergency_status": "Active",
  "emergency_address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "friendly_name": "(808) 925-5327",
  "identity_sid": "RIXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "origin": "origin",
  "phone_number": "+15017122661",
  "sid": "PN2a0747eba6abf96b7e3c3ff0b4530f6e",
  "sms_application_sid": "APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "sms_fallback_method": "POST",
  "sms_fallback_url": "",
  "sms_method": "POST",
  "sms_url": "",
  "status_callback": "",
  "status_callback_method": "POST",
  "trunk_sid": "TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PN2a0747eba6abf96b7e3c3ff0b4530f6e.json",
  "voice_application_sid": "APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "voice_caller_id_lookup": false,
  "voice_fallback_method": "POST",
  "voice_fallback_url": null,
  "voice_method": "POST",
  "voice_url": null
}
<TwilioResponse>
  <IncomingPhoneNumber>
    <Sid>PN2a0747eba6abf96b7e3c3ff0b4530f6e</Sid>
    <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
    <FriendlyName>My Company Line</FriendlyName>
    <PhoneNumber>+15105647903</PhoneNumber>
    <VoiceUrl>http://demo.twilio.com/docs/voice.xml</VoiceUrl>
    <VoiceMethod>POST</VoiceMethod>
    <VoiceFallbackUrl/>
    <VoiceFallbackMethod>POST</VoiceFallbackMethod>
    <StatusCallback/>
    <StatusCallbackMethod/>
    <VoiceCallerIdLookup>false</VoiceCallerIdLookup>
    <VoiceApplicationSid/>
    <DateCreated>Mon, 16 Aug 2010 23:00:23 +0000</DateCreated>
    <DateUpdated>Mon, 16 Aug 2010 23:00:23 +0000</DateUpdated>
    <SmsUrl/>
    <SmsMethod>POST</SmsMethod>
    <SmsFallbackUrl/>
    <SmsFallbackMethod>GET</SmsFallbackMethod>
    <SmsApplicationSid>AP9b2e38d8c592488c397fc871a82a74ec</SmsApplicationSid>
    <Capabilities>
      <Voice>true</Voice>
      <SMS>true</SMS>
      <MMS>false</MMS>
    </Capabilities>
    <Beta>false</Beta>
    <ApiVersion>2010-04-01</ApiVersion>
    <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PN2a0747eba6abf96b7e3c3ff0b4530f6e</Uri>
  </IncomingPhoneNumber>
</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.incomingPhoneNumbers.list((err, data) => {
  data.incomingPhoneNumbers.forEach(number => {
    console.log(number.phoneNumber);
  });
});
// Download the helper library from https://www.twilio.com/docs/node/install
// Your Account Sid and Auth Token from twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.incomingPhoneNumbers
      .each(incomingPhoneNumbers => console.log(incomingPhoneNumbers.sid));
// 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 numbers = twilio.ListIncomingPhoneNumbers(null, null, null, null);
    
    foreach (var number in numbers.IncomingPhoneNumbers)
    {
      Console.WriteLine(number.PhoneNumber);
    }
  }
}
<?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 numbers and echo a property for each one
foreach ($client->account->incoming_phone_numbers as $number) {
    echo $number->phone_number;
}
# 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 numbers and print out a property for each one
@client.account.incoming_phone_numbers.list.each do |number|
  puts number.phone_number
end
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;


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

        TwilioClient.Init(accountSid, authToken);

        var incomingPhoneNumbers = IncomingPhoneNumberResource.Read(
            pathAccountSid: "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
        );

        foreach(var record in incomingPhoneNumbers)
        {
           Console.WriteLine(record.Sid);
        }
    }
}
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once '/path/to/vendor/autoload.php';

use Twilio\Rest\Client;

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

$incomingPhoneNumbers = $twilio->incomingPhoneNumbers
                               ->read();

foreach ($incomingPhoneNumbers as $record) {
    print($record->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)

# A list of number objects with the properties described above
numbers = client.phone_numbers.list()
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'rubygems'
require 'twilio-ruby'

# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

incoming_phone_numbers = @client.incoming_phone_numbers.list

incoming_phone_numbers.each do |record|
  puts record.sid
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.IncomingPhoneNumber;
import com.twilio.sdk.resource.list.IncomingPhoneNumberList;

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);
    
    IncomingPhoneNumberList numbers = client.getAccount().getIncomingPhoneNumbers();
    
    // Loop over numbers and print out a property for each one.
    for (IncomingPhoneNumber number : numbers) {
      System.out.println(number.getPhoneNumber());
    } 
  }
}
# Download the helper library from https://www.twilio.com/docs/python/install
from twilio.rest import Client


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

incoming_phone_numbers = client.incoming_phone_numbers.list()

for record in incoming_phone_numbers:
    print(record.sid)
// 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.IncomingPhoneNumber;

public class Example {
    // Find your Account Sid and Token at twilio.com/console
    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<IncomingPhoneNumber> incomingPhoneNumbers = 
            IncomingPhoneNumber.reader()
            .read();

        for(IncomingPhoneNumber record : incomingPhoneNumbers) {
            System.out.println(record.getSid());
        }
    }
}
curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
curl -X GET 'https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json' \
-u ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token
{
  "end": 0,
  "first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json?PageSize=1&Page=0",
  "incoming_phone_numbers": [
    {
      "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "address_requirements": "none",
      "address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "api_version": "2010-04-01",
      "beta": null,
      "capabilities": {
        "mms": true,
        "sms": false,
        "voice": true
      },
      "date_created": "Thu, 30 Jul 2015 23:19:04 +0000",
      "date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
      "emergency_status": "Active",
      "emergency_address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "friendly_name": "(808) 925-5327",
      "identity_sid": "RIXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "origin": "origin",
      "phone_number": "+15017122661",
      "sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "sms_application_sid": "APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "sms_fallback_method": "POST",
      "sms_fallback_url": "",
      "sms_method": "POST",
      "sms_url": "",
      "status_callback": "",
      "status_callback_method": "POST",
      "trunk_sid": "TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
      "voice_application_sid": "APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "voice_caller_id_lookup": false,
      "voice_fallback_method": "POST",
      "voice_fallback_url": null,
      "voice_method": "POST",
      "voice_url": null
    }
  ],
  "last_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json?PageSize=1&Page=2",
  "next_page_uri": null,
  "num_pages": 3,
  "page": 0,
  "page_size": 1,
  "previous_page_uri": null,
  "start": 0,
  "total": 3,
  "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json?PageSize=1",
  "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}
<TwilioResponse>
  <IncomingPhoneNumbers page="0" pagesize="50" uri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers" firstpageuri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers?Page=0&PageSize=50" previouspageuri="" nextpageuri="">
    <IncomingPhoneNumber>
      <Sid>PN3f94c94562ac88dccf16f8859a1a8b25</Sid>
      <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
      <FriendlyName>Long Play</FriendlyName>
      <PhoneNumber>+14152374451</PhoneNumber>
      <VoiceUrl>http://demo.twilio.com/docs/voice.xml</VoiceUrl>
      <VoiceMethod>GET</VoiceMethod>
      <VoiceFallbackUrl/>
      <VoiceFallbackMethod/>
      <VoiceCallerIdLookup>false</VoiceCallerIdLookup>
      <VoiceApplicationSid/>
      <DateCreated>Thu, 13 Nov 2008 07:56:24 +0000</DateCreated>
      <DateUpdated>Thu, 13 Nov 2008 08:45:58 +0000</DateUpdated>
      <SmsUrl/>
      <SmsMethod/>
      <SmsFallbackUrl/>
      <SmsFallbackMethod/>
      <SmsApplicationSid>AP9b2e38d8c592488c397fc871a82a74ec</SmsApplicationSid>
      <Capabilities>
        <Voice>true</Voice>
        <SMS>false</SMS>
        <MMS>false</MMS>
      </Capabilities>
      <Beta>false</Beta>
      <StatusCallback/>
      <StatusCallbackMethod/>
      <ApiVersion>2010-04-01</ApiVersion>
      <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PN3f94c94562ac88dccf16f8859a1a8b25</Uri>
    </IncomingPhoneNumber>
    ...
  </IncomingPhoneNumbers>
</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.incomingPhoneNumbers.list(
  {
    phoneNumber: '+14158675310',
  },
  (err, data) => {
    data.incomingPhoneNumbers.forEach(number => {
      console.log(number.phoneNumber);
    });
  }
);
// Download the helper library from https://www.twilio.com/docs/node/install
// Your Account Sid and Auth Token from twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.incomingPhoneNumbers
      .each({
         phoneNumber: '+14158675310'
       },
           incomingPhoneNumbers => console.log(incomingPhoneNumbers.sid)
       );
// 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 numbers = twilio.ListIncomingPhoneNumbers("+14158675310", null, null, null);
    
    foreach (var number in numbers.IncomingPhoneNumbers)
    {
      Console.WriteLine(number.PhoneNumber);
    }
  }
}
<?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 numbers and echo a property for each one
foreach ($client->account->incoming_phone_numbers->getIterator(0, 50, array(
        "PhoneNumber" => "+14158675310"
    )) as $number
) {
    echo $number->phone_number;
}
# 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 numbers and print out a property for each one
numbers = client.account
                .incoming_phone_numbers.list(phone_number: '+14158675310')
numbers.each do |number|
  puts number.phone_number
end
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;


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

        TwilioClient.Init(accountSid, authToken);

        var incomingPhoneNumbers = IncomingPhoneNumberResource.Read(
            phoneNumber: new Twilio.Types.PhoneNumber("+14158675310"),
            pathAccountSid: "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
        );

        foreach(var record in incomingPhoneNumbers)
        {
           Console.WriteLine(record.Sid);
        }
    }
}
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once '/path/to/vendor/autoload.php';

use Twilio\Rest\Client;

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

$incomingPhoneNumbers = $twilio->incomingPhoneNumbers
                               ->read(array("phoneNumber" => "+14158675310"));

foreach ($incomingPhoneNumbers as $record) {
    print($record->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)

# A list of number objects with the properties described above
numbers = client.phone_numbers.list(phone_number="+14158675310")
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'rubygems'
require 'twilio-ruby'

# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

incoming_phone_numbers = @client.incoming_phone_numbers
                                .list(phone_number: '+14158675310')

incoming_phone_numbers.each do |record|
  puts record.sid
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.IncomingPhoneNumber;
import com.twilio.sdk.resource.list.IncomingPhoneNumberList;
import java.util.HashMap;
import java.util.Map;

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 IncomingPhoneNumberList
    Map<String, String> params = new HashMap<String, String>();
    
    params.put("PhoneNumber", "+14158675310");
    
    IncomingPhoneNumberList numbers = client.getAccount().getIncomingPhoneNumbers(params);
    
    // Loop over numbers and print out a property for each one.
    for (IncomingPhoneNumber number : numbers) {
      System.out.println(number.getPhoneNumber());
    } 
  }
}
# Download the helper library from https://www.twilio.com/docs/python/install
from twilio.rest import Client


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

incoming_phone_numbers = client.incoming_phone_numbers \
                               .list(phone_number='+14158675310')

for record in incoming_phone_numbers:
    print(record.sid)
// 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.IncomingPhoneNumber;
import com.twilio.type.PhoneNumber;

public class Example {
    // Find your Account Sid and Token at twilio.com/console
    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<IncomingPhoneNumber> incomingPhoneNumbers = 
            IncomingPhoneNumber.reader()
            .setPhoneNumber(new com.twilio.type.PhoneNumber("+14158675310"))
            .read();

        for(IncomingPhoneNumber record : incomingPhoneNumbers) {
            System.out.println(record.getSid());
        }
    }
}
curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers \
    -d "PhoneNumber=%2B14158675310" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
curl -X GET 'https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json?PhoneNumber=%2B14158675310' \
-u ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token
{
  "end": 0,
  "first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json?PageSize=1&Page=0",
  "incoming_phone_numbers": [
    {
      "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "address_requirements": "none",
      "address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "api_version": "2010-04-01",
      "beta": null,
      "capabilities": {
        "mms": true,
        "sms": false,
        "voice": true
      },
      "date_created": "Thu, 30 Jul 2015 23:19:04 +0000",
      "date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
      "emergency_status": "Active",
      "emergency_address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "friendly_name": "(808) 925-5327",
      "identity_sid": "RIXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "origin": "origin",
      "phone_number": "+14158675310",
      "sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "sms_application_sid": "APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "sms_fallback_method": "POST",
      "sms_fallback_url": "",
      "sms_method": "POST",
      "sms_url": "",
      "status_callback": "",
      "status_callback_method": "POST",
      "trunk_sid": "TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
      "voice_application_sid": "APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "voice_caller_id_lookup": false,
      "voice_fallback_method": "POST",
      "voice_fallback_url": null,
      "voice_method": "POST",
      "voice_url": null
    }
  ],
  "last_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json?PageSize=1&Page=2",
  "next_page_uri": null,
  "num_pages": 3,
  "page": 0,
  "page_size": 1,
  "previous_page_uri": null,
  "start": 0,
  "total": 3,
  "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json?PageSize=1",
  "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "phone_number": "+14158675310"
}
<?xml version="1.0" encoding="UTF-8"?>
<TwilioResponse>
    <IncomingPhoneNumbers page="0" pagesize="50" uri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.xml?PhoneNumber=%2B14158675310" firstpageuri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.xml?PhoneNumber=%2B14158675310&Page=0&PageSize=50" previouspageuri="" nextpageuri="">
        <IncomingPhoneNumber>
            <Sid>PN3f94c94562ac88dccf16f8859a1a8b25</Sid>
            <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
            <FriendlyName>Joey</FriendlyName>
            <PhoneNumber>+14158675310</PhoneNumber>
            <VoiceUrl>http://demo.twilio.com/docs/voice.xml</VoiceUrl>
            <VoiceMethod>GET</VoiceMethod>
            <VoiceFallbackUrl/>
            <VoiceFallbackMethod/>
            <VoiceCallerIdLookup>false</VoiceCallerIdLookup>
            <VoiceApplicationSid/>
            <DateCreated>Thu, 13 Nov 2008 07:56:24 +0000</DateCreated>
            <DateUpdated>Thu, 13 Nov 2008 08:45:58 +0000</DateUpdated>
            <SmsUrl/>
            <SmsMethod/>
            <SmsFallbackUrl/>
            <SmsFallbackMethod/>
            <SmsApplicationSid>AP9b2e38d8c592488c397fc871a82a74ec</SmsApplicationSid>
            <Capabilities>
                <Voice>true</Voice>
                <SMS>false</SMS>
                <MMS>false</MMS>
            </Capabilities>
            <Beta>false</Beta>
            <StatusCallback/>
            <StatusCallbackMethod/>
            <ApiVersion>2010-04-01</ApiVersion>
            <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PN3f94c94562ac88dccf16f8859a1a8b26</Uri>
        </IncomingPhoneNumber>
    </IncomingPhoneNumbers>
</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.incomingPhoneNumbers.list(
  {
    phoneNumber: '867',
  },
  (err, data) => {
    data.incomingPhoneNumbers.forEach(number => {
      console.log(number.voiceUrl);
    });
  }
);
// Download the helper library from https://www.twilio.com/docs/node/install
// Your Account Sid and Auth Token from twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.incomingPhoneNumbers
      .each({
         phoneNumber: '867'
       },
           incomingPhoneNumbers => console.log(incomingPhoneNumbers.sid)
       );
// 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 numbers = twilio.ListIncomingPhoneNumbers("867", null, null, null);
    
    foreach (var number in numbers.IncomingPhoneNumbers)
    {
      Console.WriteLine(number.VoiceUrl);
    }
  }
}
<?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 numbers and echo a property for each one
foreach ($client->account->incoming_phone_numbers->getIterator(0, 50, array(
        "PhoneNumber" => "867"
    )) as $number
) {
    echo $number->voice_url;
}
# 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 numbers and print out a property for each one
numbers = client.account.incoming_phone_numbers.list(phone_number: '867')
numbers.each do |number|
  puts number.voice_url
end
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;


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

        TwilioClient.Init(accountSid, authToken);

        var incomingPhoneNumbers = IncomingPhoneNumberResource.Read(
            phoneNumber: new Twilio.Types.PhoneNumber("867"),
            pathAccountSid: "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
        );

        foreach(var record in incomingPhoneNumbers)
        {
           Console.WriteLine(record.Sid);
        }
    }
}
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once '/path/to/vendor/autoload.php';

use Twilio\Rest\Client;

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

$incomingPhoneNumbers = $twilio->incomingPhoneNumbers
                               ->read(array("phoneNumber" => "867"));

foreach ($incomingPhoneNumbers as $record) {
    print($record->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)

# A list of number objects with the properties described above
numbers = client.phone_numbers.list(phone_number="867")
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'rubygems'
require 'twilio-ruby'

# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

incoming_phone_numbers = @client.incoming_phone_numbers.list(
                                                          phone_number: '867'
                                                        )

incoming_phone_numbers.each do |record|
  puts record.sid
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.IncomingPhoneNumber;
import com.twilio.sdk.resource.list.IncomingPhoneNumberList;
import java.util.HashMap;
import java.util.Map;

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 IncomingPhoneNumberList
    Map<String, String> params = new HashMap<String, String>();
    
    params.put("PhoneNumber", "867");
    
    IncomingPhoneNumberList numbers = client.getAccount().getIncomingPhoneNumbers(params);
    
    // Loop over numbers and print out a property for each one.
    for (IncomingPhoneNumber number : numbers) {
      System.out.println(number.getVoiceUrl());
    } 
  }
}
# Download the helper library from https://www.twilio.com/docs/python/install
from twilio.rest import Client


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

incoming_phone_numbers = client.incoming_phone_numbers.list(phone_number='867')

for record in incoming_phone_numbers:
    print(record.sid)
// 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.IncomingPhoneNumber;
import com.twilio.type.PhoneNumber;

public class Example {
    // Find your Account Sid and Token at twilio.com/console
    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<IncomingPhoneNumber> incomingPhoneNumbers = 
            IncomingPhoneNumber.reader()
            .setPhoneNumber(new com.twilio.type.PhoneNumber("867"))
            .read();

        for(IncomingPhoneNumber record : incomingPhoneNumbers) {
            System.out.println(record.getSid());
        }
    }
}
curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers \
    -d "PhoneNumber=867" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
curl -X GET 'https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json?PhoneNumber=867' \
-u ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token
{
  "end": 0,
  "first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json?PageSize=1&Page=0",
  "incoming_phone_numbers": [
    {
      "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "address_requirements": "none",
      "address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "api_version": "2010-04-01",
      "beta": null,
      "capabilities": {
        "mms": true,
        "sms": false,
        "voice": true
      },
      "date_created": "Thu, 30 Jul 2015 23:19:04 +0000",
      "date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
      "emergency_status": "Active",
      "emergency_address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "friendly_name": "(808) 925-5327",
      "identity_sid": "RIXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "origin": "origin",
      "phone_number": "867",
      "sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "sms_application_sid": "APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "sms_fallback_method": "POST",
      "sms_fallback_url": "",
      "sms_method": "POST",
      "sms_url": "",
      "status_callback": "",
      "status_callback_method": "POST",
      "trunk_sid": "TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
      "voice_application_sid": "APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "voice_caller_id_lookup": false,
      "voice_fallback_method": "POST",
      "voice_fallback_url": null,
      "voice_method": "POST",
      "voice_url": null
    }
  ],
  "last_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json?PageSize=1&Page=2",
  "next_page_uri": null,
  "num_pages": 3,
  "page": 0,
  "page_size": 1,
  "previous_page_uri": null,
  "start": 0,
  "total": 3,
  "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.json?PageSize=1",
  "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "phone_number": "867"
}
<?xml version="1.0" encoding="UTF-8"?>
<TwilioResponse>
    <IncomingPhoneNumbers page="0" pagesize="50" uri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.xml?PhoneNumber=%2B14158675310" firstpageuri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers.xml?PhoneNumber=%2B14158675310&Page=0&PageSize=50" previouspageuri="" nextpageuri="">
        <IncomingPhoneNumber>
            <Sid>PN3f94c94562ac88dccf16f8859a1a8b25</Sid>
            <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
            <FriendlyName>Joey</FriendlyName>
            <PhoneNumber>+14158675310</PhoneNumber>
            <VoiceUrl>http://demo.twilio.com/docs/voice.xml</VoiceUrl>
            <VoiceMethod>GET</VoiceMethod>
            <VoiceFallbackUrl/>
            <VoiceFallbackMethod/>
            <VoiceCallerIdLookup>false</VoiceCallerIdLookup>
            <VoiceApplicationSid/>
            <DateCreated>Thu, 13 Nov 2008 07:56:24 +0000</DateCreated>
            <DateUpdated>Thu, 13 Nov 2008 08:45:58 +0000</DateUpdated>
            <SmsUrl/>
            <SmsMethod/>
            <SmsFallbackUrl/>
            <SmsFallbackMethod/>
            <SmsApplicationSid>AP9b2e38d8c592488c397fc871a82a74ec</SmsApplicationSid>
            <Capabilities>
                <Voice>true</Voice>
                <SMS>false</SMS>
                <MMS>false</MMS>
            </Capabilities>
            <Beta>false</Beta>
            <StatusCallback/>
            <StatusCallbackMethod/>
            <ApiVersion>2010-04-01</ApiVersion>
            <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PN3f94c94562ac88dccf16f8859a1a8b26</Uri>
        </IncomingPhoneNumber>
    ...
    </IncomingPhoneNumbers>
</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.incomingPhoneNumbers('PN2a0747eba6abf96b7e3c3ff0b4530f6e').update({
  voiceUrl: 'http://demo.twilio.com/docs/voice.xml',
  smsUrl: 'http://demo.twilio.com/docs/sms.xml',
}, (err, number) => {
  console.log(number.voiceUrl);
});
// Download the helper library from https://www.twilio.com/docs/node/install
// Your Account Sid and Auth Token from twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.incomingPhoneNumbers('PN2a0747eba6abf96b7e3c3ff0b4530f6e')
  .update({
     accountSid: 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
     smsUrl: 'http://demo.twilio.com/docs/sms.xml',
     voiceUrl: 'http://demo.twilio.com/docs/voice.xml'
   })
  .then(incoming_phone_number => console.log(incoming_phone_number.friendlyName))
  .done();
// 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 PhoneNumberOptions();
    options.VoiceUrl = "http://demo.twilio.com/docs/voice.xml";
    options.SmsUrl = "http://demo.twilio.com/docs/sms.xml";
    
    twilio.UpdateIncomingPhoneNumber("PN2a0747eba6abf96b7e3c3ff0b4530f6e", 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
$number = $client->account->incoming_phone_numbers->get("PN2a0747eba6abf96b7e3c3ff0b4530f6e");
$number->update(array(
        "VoiceUrl" => "http://demo.twilio.com/docs/voice.xml",
    "SmsUrl" => "http://demo.twilio.com/docs/sms.xml"
    ));
echo $number->voice_url;
# 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
number = client.account
               .incoming_phone_numbers
               .get('PN2a0747eba6abf96b7e3c3ff0b4530f6e')
               .update(voice_url: 'http://demo.twilio.com/docs/voice.xml',
                       sms_url: 'http://demo.twilio.com/docs/sms.xml')
puts number.voice_url
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;


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

        TwilioClient.Init(accountSid, authToken);

        var incomingPhoneNumber = IncomingPhoneNumberResource.Update(
            accountSid: "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
            smsUrl: new Uri("http://demo.twilio.com/docs/sms.xml"),
            voiceUrl: new Uri("http://demo.twilio.com/docs/voice.xml"),
            pathAccountSid: "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
            pathSid: "PN2a0747eba6abf96b7e3c3ff0b4530f6e"
        );

        Console.WriteLine(incomingPhoneNumber.FriendlyName);
    }
}
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once '/path/to/vendor/autoload.php';

use Twilio\Rest\Client;

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

$incoming_phone_number = $twilio->incomingPhoneNumbers("PN2a0747eba6abf96b7e3c3ff0b4530f6e")
                                ->update(array(
                                             "accountSid" => "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
                                             "smsUrl" => "http://demo.twilio.com/docs/sms.xml",
                                             "voiceUrl" => "http://demo.twilio.com/docs/voice.xml"
                                         )
                                );

print($incoming_phone_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)

number = client.phone_numbers.update(
    "PN2a0747eba6abf96b7e3c3ff0b4530f6e",
    voice_url="http://demo.twilio.com/docs/voice.xml",
    sms_url="http://demo.twilio.com/docs/sms.xml"
)
print(number.voice_url)
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'rubygems'
require 'twilio-ruby'

# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

incoming_phone_number = @client
  .incoming_phone_numbers('PN2a0747eba6abf96b7e3c3ff0b4530f6e')
  .update(
     account_sid: 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
     sms_url: 'http://demo.twilio.com/docs/sms.xml',
     voice_url: 'http://demo.twilio.com/docs/voice.xml'
   )

puts incoming_phone_number.friendly_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.IncomingPhoneNumber;
import com.twilio.sdk.resource.list.IncomingPhoneNumberList;
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
    IncomingPhoneNumber number = client.getAccount().getIncomingPhoneNumber("PN2a0747eba6abf96b7e3c3ff0b4530f6e");
    // Build a filter for the IncomingPhoneNumberList
    List<NameValuePair> params = new ArrayList<NameValuePair>();
    params.add(new BasicNameValuePair("VoiceUrl", "http://demo.twilio.com/docs/voice.xml"));
    params.add(new BasicNameValuePair("SmsUrl", "http://demo.twilio.com/docs/sms.xml"));
    number.update(params); 
  }
}
# Download the helper library from https://www.twilio.com/docs/python/install
from twilio.rest import Client


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

incoming_phone_number = client \
    .incoming_phone_numbers('PN2a0747eba6abf96b7e3c3ff0b4530f6e') \
    .update(
         account_sid='ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
         sms_url='http://demo.twilio.com/docs/sms.xml',
         voice_url='http://demo.twilio.com/docs/voice.xml'
     )

print(incoming_phone_number.friendly_name)
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.api.v2010.account.IncomingPhoneNumber;

import java.net.URI;

public class Example {
    // Find your Account Sid and Token at twilio.com/console
    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);
        IncomingPhoneNumber incomingPhoneNumber = IncomingPhoneNumber.updater(
                "PN2a0747eba6abf96b7e3c3ff0b4530f6e")
            .setAccountSid("ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
            .setSmsUrl(URI.create("http://demo.twilio.com/docs/sms.xml"))
            .setVoiceUrl(URI.create("http://demo.twilio.com/docs/voice.xml"))
            .update();

        System.out.println(incomingPhoneNumber.getFriendlyName());
    }
}
curl -XPOST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PN2a0747eba6abf96b7e3c3ff0b4530f6e \
    -d "VoiceUrl=http://demo.twilio.com/docs/voice.xml" \
    -d "SmsUrl=http://demo.twilio.com/docs/sms.xml" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
curl -X POST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PN2a0747eba6abf96b7e3c3ff0b4530f6e.json \
--data-urlencode "AccountSid=ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
--data-urlencode "SmsUrl=http://demo.twilio.com/docs/sms.xml" \
--data-urlencode "VoiceUrl=http://demo.twilio.com/docs/voice.xml" \
-u ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token
{
  "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "address_requirements": "none",
  "address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "api_version": "2010-04-01",
  "beta": false,
  "capabilities": {
    "mms": true,
    "sms": false,
    "voice": true
  },
  "date_created": "Thu, 30 Jul 2015 23:19:04 +0000",
  "date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
  "emergency_status": "Inactive",
  "emergency_address_sid": "ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "friendly_name": "(808) 925-5327",
  "identity_sid": "RIXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "origin": "origin",
  "phone_number": "+15017122661",
  "sid": "PN2a0747eba6abf96b7e3c3ff0b4530f6e",
  "sms_application_sid": "APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "sms_fallback_method": "POST",
  "sms_fallback_url": "",
  "sms_method": "POST",
  "sms_url": "http://demo.twilio.com/docs/sms.xml",
  "status_callback": "",
  "status_callback_method": "POST",
  "trunk_sid": "TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PN2a0747eba6abf96b7e3c3ff0b4530f6e.json",
  "voice_application_sid": "APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "voice_caller_id_lookup": false,
  "voice_fallback_method": "POST",
  "voice_fallback_url": null,
  "voice_method": "POST",
  "voice_url": "http://demo.twilio.com/docs/voice.xml"
}
<TwilioResponse>
  <IncomingPhoneNumber>
    <Sid>PN2a0747eba6abf96b7e3c3ff0b4530f6e</Sid>
    <AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
    <FriendlyName>My Company Line</FriendlyName>
    <PhoneNumber>+15105647903</PhoneNumber>
    <VoiceUrl>http://demo.twilio.com/docs/voice.xml</VoiceUrl>
    <VoiceMethod>POST</VoiceMethod>
    <VoiceFallbackUrl/>
    <VoiceFallbackMethod>POST</VoiceFallbackMethod>
    <VoiceCallerIdLookup>false</VoiceCallerIdLookup>
    <VoiceApplicationSid/>
    <DateCreated>Mon, 16 Aug 2010 23:00:23 +0000</DateCreated>
    <DateUpdated>Mon, 16 Aug 2010 23:00:23 +0000</DateUpdated>
    <SmsUrl>http://demo.twilio.com/docs/sms.xml</SmsUrl>
    <SmsMethod>POST</SmsMethod>
    <SmsFallbackUrl/>
    <SmsFallbackMethod>GET</SmsFallbackMethod>
    <SmsApplicationSid/>
    <Capabilities>
      <Voice>true</Voice>
      <SMS>true</SMS>
      <MMS>false</MMS>
    </Capabilities>
    <Beta>false</Beta>
    <StatusCallback/>
    <StatusCallbackMethod/>
    <ApiVersion>2010-04-01</ApiVersion>
    <Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PN2a0747eba6abf96b7e3c3ff0b4530f6e</Uri>
  </IncomingPhoneNumber>
</TwilioResponse>
SDKバージョン:
  • 5.x
レスポンス形式:
  • JSON
SDKバージョン:
  • 7.x
SDKバージョン:
  • 3.x
SDKバージョン:
  • 5.x
SDKバージョン:
  • 6.x
SDKバージョン:
  • 5.x
形式:
  • JSON
// Download the helper library from https://www.twilio.com/docs/node/install
// Your Account Sid and Auth Token from twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.incomingPhoneNumbers('PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
      .remove()
      .then(incoming_phone_number => console.log(incoming_phone_number.sid))
      .done();
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;


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

        TwilioClient.Init(accountSid, authToken);

        IncomingPhoneNumberResource.Delete(
            pathAccountSid: "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
            pathSid: "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
        );
    }
}
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once '/path/to/vendor/autoload.php';

use Twilio\Rest\Client;

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

$twilio->incomingPhoneNumbers("PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
       ->delete();
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'rubygems'
require 'twilio-ruby'

# Your Account Sid and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)

@client.incoming_phone_numbers('PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete
# Download the helper library from https://www.twilio.com/docs/python/install
from twilio.rest import Client


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

client.incoming_phone_numbers('PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.api.v2010.account.IncomingPhoneNumber;

public class Example {
    // Find your Account Sid and Token at twilio.com/console
    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);
        IncomingPhoneNumber.deleter(
                "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
            .delete();
    }
}
curl -X DELETE https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json \
-u ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token
null