Twilio. IncomingPhoneNumbers
(twilio v0.2.0)
Copy Markdown
API calls: create, delete, list, retrieve, update.
Summary
Functions
Purchase a phone-number for the account.
Like create/2, but returns the result or raises Infusion.Runtime.Error.
Delete a phone-numbers belonging to the account used to make the request.
Like delete/2, but returns the result or raises Infusion.Runtime.Error.
Retrieve a list of incoming-phone-numbers belonging to the account used to make the request.
Like list/2, but returns the result or raises Infusion.Runtime.Error.
Like list/2, but returns every item, from every page: a lazy stream of Twilio.Schemas.IncomingPhoneNumber.t() that fetches pages as it is read.
Like list_all/2, but returns the stream or raises Infusion.Runtime.Error.
Fetch an incoming-phone-number belonging to the account used to make the request.
Like retrieve/2, but returns the result or raises Infusion.Runtime.Error.
Update an incoming-phone-number instance.
Like update/3, but returns the result or raises Infusion.Runtime.Error.
Functions
@spec create(map() | keyword(), keyword()) :: {:ok, Twilio.Schemas.IncomingPhoneNumber.t()} | {:error, Infusion.Runtime.Error.t()}
Purchase a phone-number for the account.
POST /2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers.json
{AccountSid} in the path is the :account_sid setting; pass account_sid: "..." as an option to use another.
Parameters
address_sid- The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations.api_version- The API version to use for incoming calls made to the new phone number. The default is2010-04-01.area_code- 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 anarea_codeor aphone_number. (US and Canada only).bundle_sid- The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations.emergency_address_sid- The SID of the emergency address configuration to use for emergency calling from the new phone number.emergency_statusfriendly_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.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.phone_number- 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.sms_application_sid- The SID of the application that should handle SMS messages sent to the new phone number. If ansms_application_sidis present, we ignore all of thesms_*_urlurls and use those set on the application.sms_fallback_method- The HTTP method that we should use to callsms_fallback_url. Can be:GETorPOSTand defaults toPOST.sms_fallback_url- The URL that we should call when an error occurs while requesting or executing the TwiML defined bysms_url.sms_method- The HTTP method that we should use to callsms_url. Can be:GETorPOSTand defaults toPOST.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 thestatus_callback_methodto send status information to your application.status_callback_method- The HTTP method we should use to callstatus_callback. Can be:GETorPOSTand defaults toPOST.trunk_sid- The SID of the Trunk we should use to handle calls to the new phone number. If atrunk_sidis present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting atrunk_sidwill automatically delete yourvoice_application_sidand vice versa.voice_application_sid- The SID of the application we should use to handle calls to the new phone number. If avoice_application_sidis present, we ignore all of the voice urls and use only those set on the application. Setting avoice_application_sidwill automatically delete yourtrunk_sidand vice versa.voice_caller_id_lookup- Whether to lookup the caller's name from the CNAM database and post it to your app. Can be:trueorfalseand defaults tofalse.voice_fallback_method- The HTTP method that we should use to callvoice_fallback_url. Can be:GETorPOSTand defaults toPOST.voice_fallback_url- The URL that we should call when an error occurs retrieving or executing the TwiML requested byurl.voice_method- The HTTP method that we should use to callvoice_url. Can be:GETorPOSTand defaults toPOST.voice_receive_modevoice_url- The URL that we should call to answer a call to the new phone number. Thevoice_urlwill not be called if avoice_application_sidor atrunk_sidis set.
@spec create!(map() | keyword(), keyword()) :: Twilio.Schemas.IncomingPhoneNumber.t()
Like create/2, but returns the result or raises Infusion.Runtime.Error.
@spec delete(String.t(), keyword()) :: {:ok, nil} | {:error, Infusion.Runtime.Error.t()}
Delete a phone-numbers belonging to the account used to make the request.
DELETE /2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{Sid}.json
Path parameters
sid(required) - The Twilio-provided string that uniquely identifies the IncomingPhoneNumber resource to delete.
{AccountSid} in the path is the :account_sid setting; pass account_sid: "..." as an option to use another.
Like delete/2, but returns the result or raises Infusion.Runtime.Error.
@spec list(map() | keyword(), keyword()) :: {:ok, Twilio.Schemas.IncomingPhoneNumbersListResponse.t()} | {:error, Infusion.Runtime.Error.t()}
Retrieve a list of incoming-phone-numbers belonging to the account used to make the request.
GET /2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers.json
{AccountSid} in the path is the :account_sid setting; pass account_sid: "..." as an option to use another.
Parameters
beta- Whether to include phone numbers new to the Twilio platform. Can be:trueorfalseand the default istrue.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:twilioorhosted. By default, phone numbers of all origin are included.page_size- How many resources to return in each list page. The default is 50, and the maximum is 1000.page- The page index. This value is simply for client state.page_token- The page token. This is provided by the API.
To read every item across all pages, use list_all.
@spec list!(map() | keyword(), keyword()) :: Twilio.Schemas.IncomingPhoneNumbersListResponse.t()
Like list/2, but returns the result or raises Infusion.Runtime.Error.
@spec list_all(map() | keyword(), keyword()) :: {:ok, Enumerable.t()} | {:error, Infusion.Runtime.Error.t()}
Like list/2, but returns every item, from every page: a lazy stream of Twilio.Schemas.IncomingPhoneNumber.t() that fetches pages as it is read.
The first page is fetched right away, so its errors are returned; a later page that fails raises Infusion.Runtime.Error. Stopping early (Enum.take/2) fetches no more pages.
@spec list_all!(map() | keyword(), keyword()) :: Enumerable.t()
Like list_all/2, but returns the stream or raises Infusion.Runtime.Error.
@spec retrieve(String.t(), keyword()) :: {:ok, Twilio.Schemas.IncomingPhoneNumber.t()} | {:error, Infusion.Runtime.Error.t()}
Fetch an incoming-phone-number belonging to the account used to make the request.
GET /2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{Sid}.json
Path parameters
sid(required) - The Twilio-provided string that uniquely identifies the IncomingPhoneNumber resource to fetch.
{AccountSid} in the path is the :account_sid setting; pass account_sid: "..." as an option to use another.
@spec retrieve!(String.t(), keyword()) :: Twilio.Schemas.IncomingPhoneNumber.t()
Like retrieve/2, but returns the result or raises Infusion.Runtime.Error.
@spec update(String.t(), map() | keyword(), keyword()) :: {:ok, Twilio.Schemas.IncomingPhoneNumber.t()} | {:error, Infusion.Runtime.Error.t()}
Update an incoming-phone-number instance.
POST /2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{Sid}.json
Path parameters
sid(required) - The Twilio-provided string that uniquely identifies the IncomingPhoneNumber resource to update.
{AccountSid} in the path is the :account_sid setting; pass account_sid: "..." as an option to use another.
Parameters
account_sid- The SID of the Account that created the IncomingPhoneNumber resource to update. For more information, see Exchanging Numbers Between Subaccounts.address_sid- The SID of the Address resource we should associate with the phone number. Some regions require addresses to meet local regulations.api_version- The API version to use for incoming calls made to the phone number. The default is2010-04-01.bundle_sid- The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations.emergency_address_sid- The SID of the emergency address configuration to use for emergency calling from this phone number.emergency_statusfriendly_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.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.sms_application_sid- The SID of the application that should handle SMS messages sent to the number. If ansms_application_sidis present, we ignore all of thesms_*_urlurls and use those set on the application.sms_fallback_method- The HTTP method that we should use to callsms_fallback_url. Can be:GETorPOSTand defaults toPOST.sms_fallback_url- The URL that we should call when an error occurs while requesting or executing the TwiML defined bysms_url.sms_method- The HTTP method that we should use to callsms_url. Can be:GETorPOSTand defaults toPOST.sms_url- The URL we should call when the phone number receives an incoming SMS message.status_callback- The URL we should call using thestatus_callback_methodto send status information to your application.status_callback_method- The HTTP method we should use to callstatus_callback. Can be:GETorPOSTand defaults toPOST.trunk_sid- The SID of the Trunk we should use to handle phone calls to the phone number. If atrunk_sidis present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting atrunk_sidwill automatically delete yourvoice_application_sidand vice versa.voice_application_sid- The SID of the application we should use to handle phone calls to the phone number. If avoice_application_sidis present, we ignore all of the voice urls and use only those set on the application. Setting avoice_application_sidwill automatically delete yourtrunk_sidand vice versa.voice_caller_id_lookup- Whether to lookup the caller's name from the CNAM database and post it to your app. Can be:trueorfalseand defaults tofalse.voice_fallback_method- The HTTP method that we should use to callvoice_fallback_url. Can be:GETorPOSTand defaults toPOST.voice_fallback_url- The URL that we should call when an error occurs retrieving or executing the TwiML requested byurl.voice_method- The HTTP method that we should use to callvoice_url. Can be:GETorPOSTand defaults toPOST.voice_receive_modevoice_url- The URL that we should call to answer a call to the phone number. Thevoice_urlwill not be called if avoice_application_sidor atrunk_sidis set.
@spec update!(String.t(), map() | keyword(), keyword()) :: Twilio.Schemas.IncomingPhoneNumber.t()
Like update/3, but returns the result or raises Infusion.Runtime.Error.