IncomingPhoneNumber resource
An IncomingPhoneNumber instance resource represents a Twilio phone number provisioned from Twilio, ported or hosted to Twilio.
IncomingPhoneNumber リスト リソースは、アカウントの Twilio 電話番号を表現します。 新しい Twilio 番号をプロビジョニングするには、このリスト リソースに POST します。 プロビジョニングする新しい番号を検索するには、 AvailablePhoneNumber リソースのサブリソースを使用します。
サブアカウントを使用している場合は、2 つの Twilio アカウントの間で電話番号を移動することができます。 詳細は、 サブアカウント間で番号を交換するを参照してください。
電話番号のプロビジョニングには、2 つのステップがあります。 まず、 AvailablePhoneNumber リソースのサブリソースを使って、プロビジョニングを行う使用可能な番号を検索します。 次に、必ず IncomingPhoneNumbers リスト リソースに POSTします。 次のセクションで詳細を説明します。
IncomingPhoneNumber properties
Names in REST API format | |
---|---|
account_sid
|
The SID of the Account that created this IncomingPhoneNumber resource. |
address_sid
|
The SID of the Address resource associated with the phone number. |
address_requirements
|
Whether the phone number requires an Address registered with Twilio. Can be: |
api_version
|
The API version used to start a new TwiML session. |
beta
|
Whether the phone number is new to the Twilio platform. Can be: |
capabilities
|
The set of Boolean properties that indicate whether a phone number can receive calls or messages. Capabilities are |
date_created
|
The date and time in GMT that the resource was created specified in RFC 2822 format. |
date_updated
|
The date and time in GMT that the resource was last updated specified in RFC 2822 format. |
friendly_name
|
The string that you assigned to describe the resource. |
identity_sid
|
The SID of the Identity resource that we associate with the phone number. Some regions require an Identity to meet local regulations. |
phone_number
|
The phone number in E.164 format, which consists of a + followed by the country code and subscriber number. |
origin
|
The phone number's origin. |
sid
|
The unique string that that we created to identify this IncomingPhoneNumber resource. |
sms_application_sid
|
The SID of the application that handles SMS messages sent to the phone number. If an |
sms_fallback_method
|
The HTTP method we use to call |
sms_fallback_url
|
The URL that we call when an error occurs while retrieving or executing the TwiML from |
sms_method
|
The HTTP method we use to call |
sms_url
|
The URL we call when the phone number receives an incoming SMS message. |
status_callback
|
The URL we call using the |
status_callback_method
|
The HTTP method we use to call |
trunk_sid
|
The SID of the Trunk that handles calls to the phone number. If a |
uri
|
The URI of the resource, relative to |
voice_application_sid
|
The SID of the application that handles calls to the phone number. If a |
voice_caller_id_lookup
|
Whether we look up the caller's caller-ID name from the CNAM database ($0.01 per look up). Can be: |
voice_fallback_method
|
The HTTP method we use to call |
voice_fallback_url
|
The URL that we call when an error occurs retrieving or executing the TwiML requested by |
voice_method
|
The HTTP method we use to call |
voice_url
|
The URL we call when the phone number receives a call. The |
emergency_status
|
The configuration status parameter that determines whether the phone number is enabled for emergency calling. |
emergency_address_sid
|
The SID of the emergency address configuration that we use for emergency calling from this phone number. |
bundle_sid
|
The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. |
Create an IncomingPhoneNumber resource
https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers.json
パラメーター
Names in REST API format | |
---|---|
account_sid
Path
|
The SID of the Account that will create the resource. |
api_version
オプション
|
The API version to use for incoming calls made to the new phone number. The default is |
friendly_name
オプション
|
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
オプション
|
The SID of the application that should handle SMS messages sent to the new phone number. If an |
sms_fallback_method
オプション
|
The HTTP method that we should use to call |
sms_fallback_url
オプション
|
The URL that we should call when an error occurs while requesting or executing the TwiML defined by |
sms_method
オプション
|
The HTTP method that we should use to call |
sms_url
オプション
|
The URL we should call when the new phone number receives an incoming SMS message. |
status_callback
オプション
|
The URL we should call using the |
status_callback_method
オプション
|
The HTTP method we should use to call |
voice_application_sid
オプション
|
The SID of the application we should use to handle calls to the new phone number. If a |
voice_caller_id_lookup
オプション
|
Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: |
voice_fallback_method
オプション
|
The HTTP method that we should use to call |
voice_fallback_url
オプション
|
The URL that we should call when an error occurs retrieving or executing the TwiML requested by |
voice_method
オプション
|
The HTTP method that we should use to call |
voice_url
オプション
|
The URL that we should call to answer a call to the new phone number. The |
emergency_status
オプション
|
The configuration status parameter that determines whether the new phone number is enabled for emergency calling. |
emergency_address_sid
オプション
|
The SID of the emergency address configuration to use for emergency calling from the new phone number. |
trunk_sid
オプション
|
The SID of the Trunk we should use to handle calls to the new phone number. If a |
identity_sid
オプション
|
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
オプション
|
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
オプション
|
The configuration parameter for the new phone number to receive incoming voice calls or faxes. Can be: |
bundle_sid
オプション
|
The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. |
phone_number
Required if area_code is not passed
|
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
|
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 |
例 1
例 2
Fetch an IncomingPhoneNumber resource
https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{Sid}.json
パラメーター
Names in REST API format | |
---|---|
account_sid
Path
|
The SID of the Account that created the IncomingPhoneNumber resource to fetch. |
sid
Path
|
The Twilio-provided string that uniquely identifies the IncomingPhoneNumber resource to fetch. |
例
Read multiple IncomingPhoneNumber resources
https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers.json
パラメーター
Names in REST API format | |
---|---|
account_sid
Path
|
The SID of the Account that created the IncomingPhoneNumber resources to read. |
beta
オプション
|
Whether to include phone numbers new to the Twilio platform. Can be: |
friendly_name
オプション
|
A string that identifies the IncomingPhoneNumber resources to read. |
phone_number
オプション
|
The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. |
origin
オプション
|
Whether to include phone numbers based on their origin. Can be: |
例 1
例 2
例 3
Update an IncomingPhoneNumber resource
https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{Sid}.json
パラメーター
Names in REST API format | |
---|---|
account_sid
オプション
|
The SID of the Account that created the IncomingPhoneNumber resource to update. For more information, see Exchanging Numbers Between Subaccounts. |
sid
Path
|
The Twilio-provided string that uniquely identifies the IncomingPhoneNumber resource to update. |
api_version
オプション
|
The API version to use for incoming calls made to the phone number. The default is |
friendly_name
オプション
|
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
オプション
|
The SID of the application that should handle SMS messages sent to the number. If an |
sms_fallback_method
オプション
|
The HTTP method that we should use to call |
sms_fallback_url
オプション
|
The URL that we should call when an error occurs while requesting or executing the TwiML defined by |
sms_method
オプション
|
The HTTP method that we should use to call |
sms_url
オプション
|
The URL we should call when the phone number receives an incoming SMS message. |
status_callback
オプション
|
The URL we should call using the |
status_callback_method
オプション
|
The HTTP method we should use to call |
voice_application_sid
オプション
|
The SID of the application we should use to handle phone calls to the phone number. If a |
voice_caller_id_lookup
オプション
|
Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: |
voice_fallback_method
オプション
|
The HTTP method that we should use to call |
voice_fallback_url
オプション
|
The URL that we should call when an error occurs retrieving or executing the TwiML requested by |
voice_method
オプション
|
The HTTP method that we should use to call |
voice_url
オプション
|
The URL that we should call to answer a call to the phone number. The |
emergency_status
オプション
|
The configuration status parameter that determines whether the phone number is enabled for emergency calling. |
emergency_address_sid
オプション
|
The SID of the emergency address configuration to use for emergency calling from this phone number. |
trunk_sid
オプション
|
The SID of the Trunk we should use to handle phone calls to the phone number. If a |
voice_receive_mode
オプション
|
The configuration parameter for the phone number to receive incoming voice calls or faxes. Can be: |
identity_sid
オプション
|
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
オプション
|
The SID of the Address resource we should associate with the phone number. Some regions require addresses to meet local regulations. |
bundle_sid
オプション
|
The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. |
例 1
Delete an IncomingPhoneNumber resource
https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{Sid}.json
この電話番号をアカウントから開放します。 Twilio は今後、この電話番号への通話に応答しません。毎月の電話番号使用料の課金は停止されます。電話番号は再利用されます。将来他のユーザーに付与される可能性がありますので、注意してください。 誤って開放してしまった場合は、Twilio へお問い合わせください。 番号を復元できる場合があります。
パラメーター
Names in REST API format | |
---|---|
account_sid
Path
|
The SID of the Account that created the IncomingPhoneNumber resources to delete. |
sid
Path
|
The Twilio-provided string that uniquely identifies the IncomingPhoneNumber resource to delete. |
例
ヘルプが必要ですか?
誰しもが一度は考える「コーディングって難しい」。そんな時は、お問い合わせフォームから質問してください。 または、Stack Overflow でTwilioタグのついた情報から欲しいものを探してみましょう。