メニュー

Expand
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?

IncomingPhoneNumber resource

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

Names in PHP format
accountSid
sid<AC> Not PII

The SID of the Account that created this IncomingPhoneNumber resource.

addressSid
sid<AD> Not PII

The SID of the Address resource associated with the phone number.

addressRequirements
enum:address_requirement Not PII

Whether the phone number requires an Address registered with Twilio. Can be: none, any, local, or foreign.

apiVersion
文字列 Not PII

The API version used to start a new TwiML session.

beta
boolean Not PII

Whether the phone number is new to the Twilio platform. Can be: true or false.

capabilities
phone_number_capabilities Not PII

The set of Boolean properties that indicate whether a phone number can receive calls or messages. Capabilities are Voice, SMS, and MMS and each capability can be: true or false.

dateCreated
date_time<rfc2822> Not PII

The date and time in GMT that the resource was created specified in RFC 2822 format.

dateUpdated
date_time<rfc2822> Not PII

The date and time in GMT that the resource was last updated specified in RFC 2822 format.

friendlyName
文字列 PII MTL: 30 DAYS

The string that you assigned to describe the resource.

identitySid
sid<RI> Not PII

The SID of the Identity resource that we associate with the phone number. Some regions require an Identity to meet local regulations.

phoneNumber
phone_number Not PII

The phone number in E.164 format, which consists of a + followed by the country code and subscriber number.

origin
文字列 Not PII

The phone number's origin. twilio identifies Twilio-owned phone numbers and hosted identifies hosted phone numbers.

sid
sid<PN> Not PII

The unique string that that we created to identify this IncomingPhoneNumber resource.

smsApplicationSid
sid<AP> Not PII

The SID of the application that handles SMS messages sent to the phone number. If an sms_application_sid is present, we ignore all sms_*_url values and use those of the application.

smsFallbackMethod
http_method Not PII

The HTTP method we use to call sms_fallback_url. Can be: GET or POST.

smsFallbackUrl
url Not PII

The URL that we call when an error occurs while retrieving or executing the TwiML from sms_url.

smsMethod
http_method Not PII

The HTTP method we use to call sms_url. Can be: GET or POST.

smsUrl
url Not PII

The URL we call when the phone number receives an incoming SMS message.

statusCallback
url Not PII

The URL we call using the status_callback_method to send status information to your application.

statusCallbackMethod
http_method Not PII

The HTTP method we use to call status_callback. Can be: GET or POST.

trunkSid
sid<TR> Not PII

The SID of the Trunk that handles calls to the phone number. If a trunk_sid is present, we ignore all of the voice urls and voice applications and use those set on the Trunk. Setting a trunk_sid will automatically delete your voice_application_sid and vice versa.

uri
uri Not PII

The URI of the resource, relative to https://api.twilio.com.

voiceApplicationSid
sid<AP> Not PII

The SID of the application that handles calls to the phone number. If a voice_application_sid is present, we ignore all of the voice urls and use those set on the application. Setting a voice_application_sid will automatically delete your trunk_sid and vice versa.

voiceCallerIdLookup
boolean Not PII

Whether we look up the caller's caller-ID name from the CNAM database ($0.01 per look up). Can be: true or false.

voiceFallbackMethod
http_method Not PII

The HTTP method we use to call voice_fallback_url. Can be: GET or POST.

voiceFallbackUrl
url Not PII

The URL that we call when an error occurs retrieving or executing the TwiML requested by url.

voiceMethod
http_method Not PII

The HTTP method we use to call voice_url. Can be: GET or POST.

voiceUrl
url Not PII

The URL we call when the phone number receives a call. The voice_url will not be used if a voice_application_sid or a trunk_sid is set.

emergencyStatus
enum:emergency_status Not PII

The configuration status parameter that determines whether the phone number is enabled for emergency calling.

emergencyAddressSid
sid<AD> Not PII

The SID of the emergency address configuration that we use for emergency calling from this phone number.

Create an IncomingPhoneNumber resource

post
https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers.json
パラメーター
Names in None format
account_sid
必須
post sid<AC> Not PII

The SID of the Account that will create the resource.

phone_number
Required if area_code is not passed
post phone_number Not PII

The phone number to purchase specified in E.164 format. E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234.

area_code
Required if phone_number is not passed
post 文字列 Not PII

The desired area code for your new incoming phone number. Can be any three-digit, US or Canada area code. We will provision an available phone number within this area code for you. You must provide an area_code or a phone_number. (US and Canada only).

api_version
オプション
post 文字列 Not PII

The API version to use for incoming calls made to the new phone number. The default is 2010-04-01.

friendly_name
オプション
post 文字列 PII MTL: 30 DAYS

A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, this is a formatted version of the new phone number.

sms_application_sid
オプション
post sid<AP> Not PII

The SID of the application that should handle SMS messages sent to the new phone number. If an sms_application_sid is present, we ignore all of the sms_*_url urls and use those set on the application.

sms_fallback_method
オプション
post http_method Not PII

The HTTP method that we should use to call sms_fallback_url. Can be: GET or POST and defaults to POST.

sms_fallback_url
オプション
post url Not PII

The URL that we should call when an error occurs while requesting or executing the TwiML defined by sms_url.

sms_method
オプション
post http_method Not PII

The HTTP method that we should use to call sms_url. Can be: GET or POST and defaults to POST.

sms_url
オプション
post url Not PII

The URL we should call when the new phone number receives an incoming SMS message.

status_callback
オプション
post url Not PII

The URL we should call using the status_callback_method to send status information to your application.

status_callback_method
オプション
post http_method Not PII

The HTTP method we should use to call status_callback. Can be: GET or POST and defaults to POST.

voice_application_sid
オプション
post sid<AP> Not PII

The SID of the application we should use to handle calls to the new phone number. If a voice_application_sid is present, we ignore all of the voice urls and use only those set on the application. Setting a voice_application_sid will automatically delete your trunk_sid and vice versa.

voice_caller_id_lookup
オプション
post boolean Not PII

Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: true or false and defaults to false.

voice_fallback_method
オプション
post http_method Not PII

The HTTP method that we should use to call voice_fallback_url. Can be: GET or POST and defaults to POST.

voice_fallback_url
オプション
post url Not PII

The URL that we should call when an error occurs retrieving or executing the TwiML requested by url.

voice_method
オプション
post http_method Not PII

The HTTP method that we should use to call voice_url. Can be: GET or POST and defaults to POST.

voice_url
オプション
post url Not PII

The URL that we should call to answer a call to the new phone number. The voice_url will not be called if a voice_application_sid or a trunk_sid is set.

emergency_status
オプション
post enum:emergency_status Not PII

The configuration status parameter that determines whether the new phone number is enabled for emergency calling.

emergency_address_sid
オプション
post sid<AD> Not PII

The SID of the emergency address configuration to use for emergency calling from the new phone number.

trunk_sid
オプション
post sid<TR> Not PII

The SID of the Trunk we should use to handle calls to the new phone number. If a trunk_sid is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a trunk_sid will automatically delete your voice_application_sid and vice versa.

identity_sid
オプション
post sid<RI> Not PII

The SID of the Identity resource that we should associate with the new phone number. Some regions require an identity to meet local regulations.

address_sid
オプション
post sid<AD> Not PII

The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations.

voice_receive_mode
オプション
post enum:voice_receive_mode Not PII

The configuration parameter for the new phone number to receive incoming voice calls or faxes. Can be: fax or voice and defaults to voice.

        
        
        
        

        Fetch an IncomingPhoneNumber resource

        GET
        https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{Sid}.json
        パラメーター
        Names in None format
        account_sid
        必須
        GET sid<AC> Not PII

        The SID of the Account that created the IncomingPhoneNumber resource to fetch.

        sid
        必須
        GET sid<PN> Not PII

        The Twilio-provided string that uniquely identifies the IncomingPhoneNumber resource to fetch.

              
              
              
              

              Read multiple IncomingPhoneNumber resources

              GET
              https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers.json
              パラメーター
              Names in None format
              account_sid
              必須
              GET sid<AC> Not PII

              The SID of the Account that created the IncomingPhoneNumber resources to read.

              beta
              オプション
              GET boolean Not PII

              Whether to include phone numbers new to the Twilio platform. Can be: true or false and the default is true.

              friendly_name
              オプション
              GET 文字列 PII MTL: 30 DAYS

              A string that identifies the IncomingPhoneNumber resources to read.

              phone_number
              オプション
              GET phone_number Not PII

              The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit.

              origin
              オプション
              GET 文字列 Not PII

              Whether to include phone numbers based on their origin. Can be: twilio or hosted. By default, phone numbers of all origin are included.

              例 1
                    
                    
                    
                    
                    例 2
                          
                          
                          
                          
                          Return the set of phone numbers that match exactly (415) 867-5310

                          完全一致による IncomingPhoneNumbers のフィルタリング

                          Return the set of phone numbers that match exactly (415) 867-5310
                          例 3
                                
                                
                                
                                
                                Return the set of all phone numbers containing the digits 867

                                部分一致による IncomingPhoneNumbers のフィルタリング

                                Return the set of all phone numbers containing the digits 867

                                Update an IncomingPhoneNumber resource

                                post
                                https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{Sid}.json
                                パラメーター
                                Names in None format
                                account_sid
                                オプション
                                post sid<AC> Not PII

                                The SID of the Account that created the IncomingPhoneNumber resource to update. For more information, see Exchanging Numbers Between Subaccounts.

                                sid
                                必須
                                post sid<PN> Not PII

                                The Twilio-provided string that uniquely identifies the IncomingPhoneNumber resource to update.

                                api_version
                                オプション
                                post 文字列 Not PII

                                The API version to use for incoming calls made to the phone number. The default is 2010-04-01.

                                friendly_name
                                オプション
                                post 文字列 PII MTL: 30 DAYS

                                A descriptive string that you created to describe this phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number.

                                sms_application_sid
                                オプション
                                post sid<AP> Not PII

                                The SID of the application that should handle SMS messages sent to the number. If an sms_application_sid is present, we ignore all of the sms_*_url urls and use those set on the application.

                                sms_fallback_method
                                オプション
                                post http_method Not PII

                                The HTTP method that we should use to call sms_fallback_url. Can be: GET or POST and defaults to POST.

                                sms_fallback_url
                                オプション
                                post url Not PII

                                The URL that we should call when an error occurs while requesting or executing the TwiML defined by sms_url.

                                sms_method
                                オプション
                                post http_method Not PII

                                The HTTP method that we should use to call sms_url. Can be: GET or POST and defaults to POST.

                                sms_url
                                オプション
                                post url Not PII

                                The URL we should call when the phone number receives an incoming SMS message.

                                status_callback
                                オプション
                                post url Not PII

                                The URL we should call using the status_callback_method to send status information to your application.

                                status_callback_method
                                オプション
                                post http_method Not PII

                                The HTTP method we should use to call status_callback. Can be: GET or POST and defaults to POST.

                                voice_application_sid
                                オプション
                                post sid<AP> Not PII

                                The SID of the application we should use to handle phone calls to the phone number. If a voice_application_sid is present, we ignore all of the voice urls and use only those set on the application. Setting a voice_application_sid will automatically delete your trunk_sid and vice versa.

                                voice_caller_id_lookup
                                オプション
                                post boolean Not PII

                                Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: true or false and defaults to false.

                                voice_fallback_method
                                オプション
                                post http_method Not PII

                                The HTTP method that we should use to call voice_fallback_url. Can be: GET or POST and defaults to POST.

                                voice_fallback_url
                                オプション
                                post url Not PII

                                The URL that we should call when an error occurs retrieving or executing the TwiML requested by url.

                                voice_method
                                オプション
                                post http_method Not PII

                                The HTTP method that we should use to call voice_url. Can be: GET or POST and defaults to POST.

                                voice_url
                                オプション
                                post url Not PII

                                The URL that we should call to answer a call to the phone number. The voice_url will not be called if a voice_application_sid or a trunk_sid is set.

                                emergency_status
                                オプション
                                post enum:emergency_status Not PII

                                The configuration status parameter that determines whether the phone number is enabled for emergency calling.

                                emergency_address_sid
                                オプション
                                post sid<AD> Not PII

                                The SID of the emergency address configuration to use for emergency calling from this phone number.

                                trunk_sid
                                オプション
                                post sid<TR> Not PII

                                The SID of the Trunk we should use to handle phone calls to the phone number. If a trunk_sid is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a trunk_sid will automatically delete your voice_application_sid and vice versa.

                                voice_receive_mode
                                オプション
                                post enum:voice_receive_mode Not PII

                                The configuration parameter for the phone number to receive incoming voice calls or faxes. Can be: fax or voice and defaults to voice.

                                identity_sid
                                オプション
                                post sid<RI> Not PII

                                The SID of the Identity resource that we should associate with the phone number. Some regions require an identity to meet local regulations.

                                address_sid
                                オプション
                                post sid<AD> Not PII

                                The SID of the Address resource we should associate with the phone number. Some regions require addresses to meet local regulations.

                                      
                                      
                                      
                                      

                                      Delete an IncomingPhoneNumber resource

                                      削除する
                                      https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{Sid}.json

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

                                      パラメーター
                                      Names in None format
                                      account_sid
                                      必須
                                      削除する sid<AC> Not PII

                                      The SID of the Account that created the IncomingPhoneNumber resources to delete.

                                      sid
                                      必須
                                      削除する sid<PN> Not PII

                                      The Twilio-provided string that uniquely identifies the IncomingPhoneNumber resource to delete.

                                            
                                            
                                            
                                            
                                            Rate this page:

                                            ヘルプが必要ですか?

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