REST API: Applications
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
.
The Applications list resource represents the set of an account's Twilio applications. You can POST to the list resource to create a new application. Note that accounts can contain at most 1000 applications.
Applications are useful for encapsulating configuration information that you need to distribute across multiple phone numbers. You can assign an ApplicationSid to an IncomingPhoneNumber to tell Twilio to use the application's URLs instead of the ones set directly on the IncomingPhoneNumber. So if you create an application with its VoiceUrl set to http://myapp.com/answer, you can assign that application to all of your phone numbers and Twilio will make a request to that URL whenever a call comes in.
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
|
La fecha y hora en GMT en que se creó el recurso, especificadas en formato RFC 2822. |
date_updated
|
La fecha y hora en GMT en que se actualizó el recurso por última vez, especificadas en el formato RFC 2822. |
friendly_name
|
La cadena que asignaste para describir el recurso. |
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
|
La URL del recurso, referente a “https://api.twilio.com”. |
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
|
El método HTTP que utilizamos para llamar a “voice_fallback_url”. Puede ser: “GET” o “POST”. |
voice_fallback_url
|
The URL that we call when an error occurs retrieving or executing the TwiML requested by |
voice_method
|
El método HTTP que utilizamos para llamar a “voice_url”. Puede ser: “GET” o “POST”. |
voice_url
|
The URL we call when the phone number assigned to this application receives a call. |
public_application_connect_enabled
|
Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can be: |
Create an Application resource
https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Applications.json
Creates a new application within your account.
If successful, Twilio responds with a representation of the new application.
Parameters
Parameters in REST API format | |
---|---|
account_sid
Path
|
El SID de la Account que creará el recurso. |
api_version
Optional
|
The API version to use to start a new TwiML session. Can be: |
voice_url
Optional
|
The URL we should call when the phone number assigned to this application receives a call. |
voice_method
Optional
|
El método HTTP que deberíamos usar para llamar a “voice_url”. Puede ser: “GET” o “POST”. |
voice_fallback_url
Optional
|
The URL that we should call when an error occurs retrieving or executing the TwiML requested by |
voice_fallback_method
Optional
|
El método HTTP que deberíamos usar para llamar a “voice_fallback_url”. Puede ser: “GET” o “POST”. |
status_callback
Optional
|
La URL que deberíamos llamar usando el “status_callback_method” para enviar información de estado a tu aplicación. |
status_callback_method
Optional
|
The HTTP method we should use to call |
voice_caller_id_lookup
Optional
|
Whether we should look up the caller's caller-ID name from the CNAM database (additional charges apply). Can be: |
sms_url
Optional
|
The URL we should call when the phone number receives an incoming SMS message. |
sms_method
Optional
|
The HTTP method we should use to call |
sms_fallback_url
Optional
|
The URL that we should call when an error occurs while retrieving or executing the TwiML from |
sms_fallback_method
Optional
|
The HTTP method we should use to call |
sms_status_callback
Optional
|
The URL we should call using a POST method to send status information about SMS messages sent by the application. |
message_status_callback
Optional
|
The URL we should call using a POST method to send message status information to your application. |
friendly_name
Optional
|
A descriptive string that you create to describe the new application. It can be up to 64 characters long. |
public_application_connect_enabled
Optional
|
Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can be: |
Example 1
Fetch an Application resource
https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Applications/{Sid}.json
Parameters
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. |
Example 1
Read multiple Application resources
https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Applications.json
Returns a list of Application resource representations, each representing an application within your account. The list includes paging information.
Parameters
Parameters in REST API format | |
---|---|
account_sid
Path
|
The SID of the Account that created the Application resources to read. |
friendly_name
Optional
|
The string that identifies the Application resources to read. |
Example 1
Example 2
Update an Application resource
https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Applications/{Sid}.json
Tries to update the application's properties, and returns the updated resource representation if successful. The returned response is identical to that returned above when making a GET request.
Parameters
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
Optional
|
Cadena descriptiva que se crea para describir el recurso. Puede tener hasta 64 caracteres de longitud. |
api_version
Optional
|
The API version to use to start a new TwiML session. Can be: |
voice_url
Optional
|
The URL we should call when the phone number assigned to this application receives a call. |
voice_method
Optional
|
El método HTTP que deberíamos usar para llamar a “voice_url”. Puede ser: “GET” o “POST”. |
voice_fallback_url
Optional
|
The URL that we should call when an error occurs retrieving or executing the TwiML requested by |
voice_fallback_method
Optional
|
El método HTTP que deberíamos usar para llamar a “voice_fallback_url”. Puede ser: “GET” o “POST”. |
status_callback
Optional
|
La URL que deberíamos llamar usando el “status_callback_method” para enviar información de estado a tu aplicación. |
status_callback_method
Optional
|
The HTTP method we should use to call |
voice_caller_id_lookup
Optional
|
Whether we should look up the caller's caller-ID name from the CNAM database (additional charges apply). Can be: |
sms_url
Optional
|
The URL we should call when the phone number receives an incoming SMS message. |
sms_method
Optional
|
The HTTP method we should use to call |
sms_fallback_url
Optional
|
The URL that we should call when an error occurs while retrieving or executing the TwiML from |
sms_fallback_method
Optional
|
The HTTP method we should use to call |
sms_status_callback
Optional
|
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
Optional
|
The URL we should call using a POST method to send message status information to your application. |
public_application_connect_enabled
Optional
|
Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can be: |
Example 1
Delete an Application resource
https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Applications/{Sid}.json
Delete this application. If this application's sid is assigned to any IncomingPhoneNumber resources as a VoiceApplicationSid or SmsApplicationSid it will be removed.
If successful, Twilio will return an HTTP 204 response with no body.
Parameters
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. |
Example 1
¿Necesitas ayuda?
Todos la necesitamos a veces; la programación es difícil. Obtén ayuda ahora de nuestro equipo de soporte, o recurre a la sabiduría de la multitud visitando Stack Overflow Collective de Twilio o navegando por la etiqueta de Twilio en Stack Overflow.