REST API: Application
An Application instance resource represents an application that you have created with Twilio. An application inside of Twilio is a set of URLs and other configuration data that tells Twilio how to behave when one of your Twilio numbers receives a call or SMS message. This configuration data is the same configuration data that exists on IncomingPhoneNumber resources: VoiceUrl
, VoiceMethod
, VoiceFallbackUrl
, VoiceFallbackMethod
, StatusCallback
, StatusCallbackMethod
, VoiceCallerIdLookup
, SmsUrl
, SmsMethod
, SmsFallbackUrl
, SmsFallbackMethod
, and SmsStatusCallback
.
Application のリスト リソースは、あるアカウントの Twilio アプリケーションのセットを表現します。 新しいアプリケーションを作成するには、このリスト リソースに POST します。アカウントには最大 1000 個のアプリケーションを作成できます。
アプリケーションは、複数の電話番号にまたがって使用するコンフィグレーション情報をカプセル化する際に使えます。 ApplicationSid を IncomingPhoneNumber に割り当てることで、Twilio に対して、IncomingPhoneNumber に設定された URL の代わりに、アプリケーションの URL を使用するよう指示できます。 アプリケーションを作成し、VoiceUrl をhttp://myapp.com/answer にセットします。このアプリケーションをすべての自分の電話番号に割り当てると、通話が着信するたびに、Twilio は この URL へリクエストを送信します。
Application properties
Resource Properties in REST API format | |
---|---|
account_sid
|
The SID of the Account that created the Application resource. |
api_version
|
The API version used to start a new TwiML session. |
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. |
message_status_callback
|
The URL we call using a POST method to send message status information to your application. |
sid
|
The unique string that that we created to identify the Application resource. |
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_status_callback
|
The URL we call using a POST method to send status information to your application about SMS messages that refer to the application. |
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 |
uri
|
The URI of the resource, relative to |
voice_caller_id_lookup
|
Whether we look up the caller's caller-ID name from the CNAM database (additional charges apply). 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 assigned to this application receives a call. |
Create an Application resource
https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Applications.json
アカウント内で新しいアプリケーションを作成します。
リクエストが成功すると、Twilio は新しいアプリケーションの表現を返します。
パラメーター
Parameters in REST API format | |
---|---|
account_sid
Path
|
The SID of the Account that will create the resource. |
api_version
オプション
|
The API version to use to start a new TwiML session. Can be: |
voice_url
オプション
|
The URL we should call when the phone number assigned to this application receives a call. |
voice_method
オプション
|
The HTTP method 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_fallback_method
オプション
|
The HTTP method we should use to call |
status_callback
オプション
|
The URL we should call using the |
status_callback_method
オプション
|
The HTTP method we should use to call |
voice_caller_id_lookup
オプション
|
Whether we should look up the caller's caller-ID name from the CNAM database (additional charges apply). Can be: |
sms_url
オプション
|
The URL we should call when the phone number receives an incoming SMS message. |
sms_method
オプション
|
The HTTP method we should use to call |
sms_fallback_url
オプション
|
The URL that we should call when an error occurs while retrieving or executing the TwiML from |
sms_fallback_method
オプション
|
The HTTP method we should use to call |
sms_status_callback
オプション
|
The URL we should call using a POST method to send status information about SMS messages sent by the application. |
message_status_callback
オプション
|
The URL we should call using a POST method to send message status information to your application. |
friendly_name
オプション
|
A descriptive string that you create to describe the new application. It can be up to 64 characters long. |
例 1
Fetch an Application resource
https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Applications/{Sid}.json
パラメーター
Parameters in REST API format | |
---|---|
account_sid
Path
|
The SID of the Account that created the Application resource to fetch. |
sid
Path
|
The Twilio-provided string that uniquely identifies the Application resource to fetch. |
例 1
Read multiple Application resources
https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Applications.json
Application リソース表現のリストを返します。各項目は、アカウント内のアプリケーションを表現します。 このリストは ページ情報を含みます。
パラメーター
Parameters in REST API format | |
---|---|
account_sid
Path
|
The SID of the Account that created the Application resources to read. |
friendly_name
オプション
|
The string that identifies the Application resources to read. |
例 1
例 2
Update an Application resource
https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Applications/{Sid}.json
アプリケーションのプロパティを更新します。更新に成功すると、更新されたリソース表現を返します。 返却されるレスポンスは、GET リクエストを送信した場合と同じです。
パラメーター
Parameters in REST API format | |
---|---|
account_sid
Path
|
The SID of the Account that created the Application resources to update. |
sid
Path
|
The Twilio-provided string that uniquely identifies the Application resource to update. |
friendly_name
オプション
|
A descriptive string that you create to describe the resource. It can be up to 64 characters long. |
api_version
オプション
|
The API version to use to start a new TwiML session. Can be: |
voice_url
オプション
|
The URL we should call when the phone number assigned to this application receives a call. |
voice_method
オプション
|
The HTTP method 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_fallback_method
オプション
|
The HTTP method we should use to call |
status_callback
オプション
|
The URL we should call using the |
status_callback_method
オプション
|
The HTTP method we should use to call |
voice_caller_id_lookup
オプション
|
Whether we should look up the caller's caller-ID name from the CNAM database (additional charges apply). Can be: |
sms_url
オプション
|
The URL we should call when the phone number receives an incoming SMS message. |
sms_method
オプション
|
The HTTP method we should use to call |
sms_fallback_url
オプション
|
The URL that we should call when an error occurs while retrieving or executing the TwiML from |
sms_fallback_method
オプション
|
The HTTP method we should use to call |
sms_status_callback
オプション
|
Same as message_status_callback: The URL we should call using a POST method to send status information about SMS messages sent by the application. Deprecated, included for backwards compatibility. |
message_status_callback
オプション
|
The URL we should call using a POST method to send message status information to your application. |
例 1
Delete an Application resource
https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Applications/{Sid}.json
このアプリケーションを削除します。 IncoimngPhoneNumber リソースに、このアプリケーションの sid を VoiceApplicationSid または SmsApplicatonSid として割り当てている場合、このアプリケーションの sid は削除されます。
削除に成功すると、ボディーのない HTTP 204 レスポンスを返します。
パラメーター
Parameters in REST API format | |
---|---|
account_sid
Path
|
The SID of the Account that created the Application resources to delete. |
sid
Path
|
The Twilio-provided string that uniquely identifies the Application resource to delete. |
例 1
ヘルプが必要ですか?
誰しもが一度は考える「コーディングって難しい」。そんな時は、お問い合わせフォームから質問してください。 または、Stack Overflow でTwilioタグのついた情報から欲しいものを探してみましょう。