メニュー

Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

REST API: Active Numbers

Active Numbers API is currently in Developer Preview

The Global Phone Numbers Catalog - Active Numbers resource has the same search and filtering functions as Available Numbers. You can filter based on the attributes of a phone number and see detailed attributes of your current inventory. Some PhoneNumber instances may be null due to missing data. We are working towards a 100% inventory backed resource.

リソースのプロパティ

Basic Capability Properties

The table below states basic properties of the phone number that associate the number to a unique group within Twilio's inventory system.

プロパティ 概要
PhoneNumber E.164 (「+国番号」付き) フォーマットの電話番号です。
FriendlyName このリソースの、人間が読みやすい形式の説明です。64 文字まで設定できます。 デフォルトでは、FriendlyName はこの電話番号のわかりやすい表記になります。
Type The type of phone number (i.e., local, mobile, tollfree, shortcode, etc.)
Lifecycle The lifecycle the number is in (i.e., developer-preview, beta, generally-available, exhausted).
StatusCallback ステータス パラメーター (通話の終了など) をアプリケーションへ渡すために、Twilio がリクエストを送信する URL です。
StatusCallbackMethod StatusCallback URL へリクエストを送信する際に、Twilio が使用する HTTP のメソッドです。GET または POST のいずれかです。

Voice Capability Properties

Voice calling is provided by utilizing the Public Switch Telephone Network (PSTN) , the aggregate of the world's circuit-switched telephone networks that are operated by national, regional, or local telephony operators, providing infrastructure and services for public telecommunication.

プロパティ 概要
Capabilities.Voice.InboundConnectivity Indicates whether a number has inbound voice connectivity in to Twilio
Capabilities.Voice.OutboundConnectivity Indicates whether a number has outbound voice connectivity out of Twilio
Capabilities.Voice.E911 Emergency 911 connectivity capable number
Capabilities.Voice.Fax Fax capable number
Capabilities.Voice.SipTrunking Sip Trunking capable number
Capabilities.Voice.CallsPerSecond Integer stating how many calls can be initiated per second. Please refer to Twilio's CPS Support article for more information.
Capabilities.Voice.ConcurrentCallsLimit Integer stating how many calls can be active at one time
Capabilities.Voice.InboundCalledDtmf Dual-Tone Multi Frequency with inbound called party
Capabilities.Voice.InboundCallerDtmf Dual-Tone Multi Frequency with inbound caller party
Capabilities.Voice.InboundCallerIdPreservation Inbound voice Caller ID (+E.164 format) preservation of a number. Can be - International, Domestic, or None.
Capabilities.Voice.InboundReachability Inbound Voice reachability of a number. Can be - Domestic, Foreign, or Global
Capabilities.Voice.LongRecordLength The length in seconds that a number can record a voicemail

Sms Capability Properties

Short Messaging Service (SMS) is a text messaging service component of most telephone, World Wide Web, and mobile telephony systems.

プロパティ 概要
Capabilities.Sms.InboundConnectivity Indicates whether a number has inbound sms connectivity in to Twilio
Capabilities.Sms.OutboundConnectivity Indicates whether a number has outbound sms connectivity out of Twilio
Capabilities.Sms.Gsm7 GSM-7 is a character encoding standard which packs the most commonly used letters and symbols in many languages into 7 bits each for usage on GSM networks. See What is GSM-7 Character Encoding
Capabilities.Sms.Ucs2 UCS-2 is a character encoding standard in which characters are represented by a fixed-length 16 bits (2 bytes). See What is UCS-2 Character Encoding?
Capabilities.Sms.Gsm7Concatenation Concatenated short message service (or concatenated SMS) is used overcome the limitation on the number of characters that can be sent in a single SMS text message transmission (which is usually 160), and split the sms into smaller messages by the sending device and recombined at the receiving end.
Capabilities.Sms.Ucs2Concatenation Concatenated short message service (or concatenated SMS) is used overcome the limitation on the number of characters that can be sent in a single SMS text message transmission (which is usually 160), and split the sms into smaller messages by the sending device and recombined at the receiving end.
Capabilities.Sms.InboundSenderIdPreservation Inbound sms Sender ID (+E.164 format) preservation of a number. Can be - International, Domestic, or None
Capabilities.Sms.InboundReachability Inbound SMS reachability of a number. Can be - Domestic, Foreign, or Global.
Capabilities.Sms.InboundMps Integer showing the SMS inbound message per second limit. Please refer to Twilio's MPS Support article for more information.

Mms Capability Properties

Multimedia Messaging Service (MMS) is is a standard way to send messages that include multimedia content to and from a mobile phone over a cellular network.

プロパティ 概要
Capabilities.Mms.Inboundconnectivity Indicates whether a number has inbound MMS connectivity into Twilio
Capabilities.Mms.Outboundconnectivity Indicates whether a number has outbound MMS connectivity into Twilio
Capabilities.Mms.InboundReachability Inbound MMS reachability of a number. Can be - Domestic, Foreign, or Global.
Capabilities.Mms.InboundMps Integer showing the MMS inbound message per second limit. Please refer to Twilio's MPS Support article for more information.

Regulatory Properties

Regulations that pertain to this specific number that may deal with Addresses and/or Identities to be required and completed as a pre-request before purchasing.

プロパティ 概要
Regulatory.AddressRequirements This indicates whether the phone number requires you or your customer to have an Address registered with Twilio. Possible values are listed below.
アドレス要件値

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

Status 概要
none このアドレスは電話番号に必要ではありません。
any このアカウントは住所を必要としています。しかし、世界中のどこでもご利用いただけます。
local このアカウントは電話番号の国の住所が必要です。
foreign あなたのアカウントは電話番号の国ではない住所が必要です。

Geography Properties

A phone number's specific geography associated with a number. Some numbers are country level only, and others have specific latitude and longitude associated with them. To understand more, please visit List of Country Codes.

プロパティ 概要
Geography.IsoCountry この電話番号の ISO 国コード です。
Geography.Lata The LATA of this phone number. Only available for countries in the North American Numbering Plan (NANPA).
Geography.RateCenter The rate center of this phone number. Only available for countries in the North American Numbering Plan (NANPA).
Geography.Latitude この電話番号の緯度座標です。
Geography.Longitude この電話番号の経度座標です。
Geography.Region この電話番号の州名コード (2 文字) です。
Geography.Locality この電話番号の地域/都市です。
Geography.PostalCode この電話番号の郵便番号 (ZIP コード) です。

Voice Configuration Properties

A number's voice configuration for the capabilities enabled. These attributes are mutable and can be changed based on differing operations.

プロパティ 概要
Configurations.Voice.ApplicationSid The 34 character sid of the voice application Twilio should use to handle Voice sent to this number. If an VoiceApplicationSid is present, Twilio will ignore all of the VoiceUrls above and use those set on the application.
Configurations.Voice.TrunkSid トランクを示す34文字のSID,Twilioはこの番号に着信した時に通話をハンドリングします。TrunkSidが存在する場合、Twilioは上記のVoiceURLと Voiceアプリケーションを無視し、これらをトランクにセットします。TrunkSidが設定された場合、VoiceApplicationSidは自動的に削除されます。
Configurations.Voice.EmergencyStatus Status determining whether the number is enabled for emergency calling
Configurations.Voice.EmergencyAddressSid EmergencyAddress configuration to leverage emergency calling
Configurations.Voice.ReceiveMode 電話番号が音声通話またはFaxのどちらを受信するよう構成されているか、です。 voiceもしくはfaxです。
Configurations.Voice.Url この番号への通話を受けた時に、Twilio がリクエストを送信する URL です。VoiceURLは VoiceApplicationSidもしくはTrunkSidが設定されているときは使われません。
Configurations.Voice.Method The HTTP method Twilio will use when requesting the above Url. Either GET or POST.The URL that Twilio will request if an error occurs retrieving or executing the TwiML requested by Url.
Configurations.Voice.FallbackUrl VoiceUrl でリクエストされた TwiML の取得または実行時にエラーが発生した場合、Twilio がリクエストを送信する Url です。
Configurations.Voice.FallbackMethod VoiceFallbackUrl へリクエストを送信する際に、Twilio が使用する HTTP のメソッドです。GET または POST のいずれかです。
Configurations.Voice.CallerIdLookup 発信者の名前を CNAM データベースから検索し、アプリケーションへ通知します。true または false のいずれかです。

Sms Configuration Properties

A number's sms configuration for the capabilities enabled. These attributes are mutable and can be changed based on differing operations.

プロパティ 概要
Configurations.Sms.ApplicationSid The 34 character sid of the application Twilio should use to handle SMSs sent to this number. If an SmsApplicationSid is present, Twilio will ignore all of the SMS urls above and use those set on the application.
Configurations.Sms.Url The URL Twilio will request when this phone number receives a message. The SmsUrl will no longer be used if an SmsApplicationSid is set.
Configurations.Sms.Method SmsUrl へリクエストを送信する際に、Twilio が使用する HTTP のメソッドです。GET または POST のいずれかです。
Configurations.Sms.FallbackUrl The URL that Twilio will request if an error occurs retrieving or executing the TwiML from SmsUrl.The HTTP method Twilio will use when requesting the above URL. Either GET or POST.
Configurations.Sms.FallbackMethod The HTTP method Twilio will use when requesting the above URL. Either GET or POST
        
        
        
        

        ActiveNumbers Instance Resource

        An ActiveNumbers instance represents a Twilio phone number purchased from Twilio, ported to Twilio, or hosted on Twilio in your account.

        リソースURI

        https://preview.twilio.com/Numbers/ActiveNumbers/{ActiveNumberSid}
        

        HTTP GET

        Look up the capabilities on a specific number using the PhoneNumberSid in the URI.

              
              
              
              

              HTTP POST

              Configure your number using the post method on the phone number instance with the possible optional parameters.

              Basic Configuration Properties
              プロパティ 概要
              Configurations.StatusCallback ステータス パラメーター (通話の終了など) をアプリケーションへ渡すために、Twilio がリクエストを送信する URL です。
              Configurations.StatusCallbackMethod StatusCallback URL へリクエストを送信する際に、Twilio が使用する HTTP のメソッドです。GET または POST のいずれかです。
              Voice Configuration Properties
              プロパティ 概要
              Configurations.Voice.ApplicationSid The 34 character sid of the voice application Twilio should use to handle Voice sent to this number. If an VoiceApplicationSid is present, Twilio will ignore all of the VoiceUrls above and use those set on the application.
              Configurations.Voice.Url この番号への通話を受けた時に、Twilio がリクエストを送信する URL です。VoiceURLは VoiceApplicationSidもしくはTrunkSidが設定されているときは使われません。
              Configurations.Voice.Method The HTTP method Twilio will use when requesting the above Url. Either GET or POST.The URL that Twilio will request if an error occurs retrieving or executing the TwiML requested by Url.
              Configurations.Voice.FallbackUrl VoiceUrl でリクエストされた TwiML の取得または実行時にエラーが発生した場合、Twilio がリクエストを送信する Url です。
              Configurations.Voice.FallbackMethod VoiceFallbackUrl へリクエストを送信する際に、Twilio が使用する HTTP のメソッドです。GET または POST のいずれかです。
              Sms Configuration Properties
              プロパティ 概要
              Configurations.Sms.ApplicationSid The 34 character sid of the application Twilio should use to handle SMSs sent to this number. If an SmsApplicationSid is present, Twilio will ignore all of the SMS urls above and use those set on the application.
              Configurations.Sms.Url The URL Twilio will request when this phone number receives a message. The SmsUrl will no longer be used if an SmsApplicationSid is set.
              Configurations.Sms.Method SmsUrl へリクエストを送信する際に、Twilio が使用する HTTP のメソッドです。GET または POST のいずれかです。
              Configurations.Sms.FallbackUrl The URL that Twilio will request if an error occurs retrieving or executing the TwiML from SmsUrl.The HTTP method Twilio will use when requesting the above URL. Either GET or POST.
              Configurations.Sms.FallbackMethod The HTTP method Twilio will use when requesting the above URL. Either GET or POST
                    
                    
                    
                    
                    Example: Transfer number to subaccount

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

                    HTTP DELETE

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

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

                          
                          
                          
                          

                          ActiveNumbers List Resource

                          リソースURI

                          preview.twilio.com/Numbers/ActiveNumbers
                          

                          HTTP GET

                          Returns a list of ActiveNumber resource representations, each representing a phone number given to your account. The list includes paging information.

                          リストフィルター

                          The following parameters are accessible as GET filters. Note, parameters are case-sensitive:

                          プロパティ 概要
                          PhoneNumber The phone number you want to purchase. The number should be formatted starting with a '+' followed by the country code and the number in
                          Type The type of phone number (i.e., local, mobile, tollfree, shortcode, etc.)
                          Capabilities.Voice.InboundCallerIdPreservation Inbound Voice Caller ID [(+E.164 format)][e164] preservation of a number. Can be - International, Domestic, or None
                          Capabilities.Voice.InboundReachability Inbound Voice reachability of a number. Can be - Domestic, Foreign, or Global
                          Capabilities.Sms.InboundSenderIdPreservation Inbound SMS Sender ID [(+E.164 format)][e164] preservation of a number. Can be - International, Domestic, or None
                          Capabilities.Sms.InboundReachability Inbound SMS reachability of a number. Can be - Domestic, Foreign, or Global
                          Capabilities.Mms.InboundReachability Inbound MMS reachability of a number. Can be - Domestic, Foreign, or Global
                          Geography.IsoCountry The [ISO country code][iso-country] of this phone number.
                          Geography.Lata The [LATA][lata] of this phone number. Only available for countries in the [North American Numbering Plan (NANPA)][nanpa].
                          Geography.RateCenter The [rate center][rate-center] of this phone number. Only available for countries in the [North American Numbering Plan (NANPA)][nanpa].
                          Geography.Latitude この電話番号の緯度座標です。
                          Geography.Longitude この電話番号の経度座標です。
                          Geography.Region この電話番号の州名コード (2 文字) です。
                          Geography.Locality この電話番号の地域/都市です。
                          Geography.PostalCode この電話番号の郵便番号 (ZIP コード) です。
                          Example: List all Active Numbers

                          You can manage your numbers by creating a list of all numbers that meet your search criteria filters.

                          HTTP POST

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

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

                          To find an available phone number to POST, use the AvailableNumbers list resource.

                          Please note: You cannot request numbers via the API while you are using a Free Trial account. You must upgrade your account to purchase a Twilio phone number programmatically.

                          必須パラメーター

                          Your request must include the following parameter:

                          パラメーター 概要
                          PhoneNumber 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 this parameter to have your POST succeed.
                          オプションパラメーター

                          Your request may include the following parameters that are referenced as resource properties. If successful, Twilio responds with a representation of the new phone number that was assigned to your account.

                                
                                
                                
                                
                                Example: Purchase new phone number

                                The ActiveNumbers list resource represents an account's Twilio phone numbers. You can POST to the list resource to provision a new Twilio number. To find a new number to provision use the resources the AvailableNumbers resource.

                                HTTP PUT

                                サポートしません。

                                HTTP DELETE

                                サポートしません。

                                Rate this page:

                                ヘルプが必要ですか?

                                We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the Twilio tag on Stack Overflow.