Available Phone Numbers
AvailablePhoneNumbers
The AvailablePhoneNumbers subresources lets you search for incoming local and toll-free phone numbers that are available for you to purchase. AvailablePhoneNumbers List Resource URI. /2012-04-24/Accounts/{AccountSid}/AvailablePhoneNumbers/US/Local Searching For Numbers. When using Restcomm the way to search for new phone numbers is by searching the AvailablePhoneNumbers list resource and providing the desired area code as a filter.
Resource Properties
The following properties are available for phone numbers from the US and Canada:
Property | Description |
---|---|
FriendlyName |
A nicely-formatted version of the phone number. |
PhoneNumber |
The phone number, in E.164 (i.e. "+1") format. |
Lata |
The LATA of this phone number. |
RateCenter |
The rate center of this phone number. |
Latitude |
The latitude coordinate of this phone number. |
Longitude |
The longitude coordinate of this phone number. |
Region |
The two-letter state or province abbreviation of this phone number. |
PostalCode |
The postal (zip) code of this phone number. |
IsoCountry |
The ISO country code of this phone number. |
Capabilities |
This is a set of boolean properties that indicate whether a phone number can receive calls or messages. Possible capabilities are |
The following properties are available for phone numbers outside the US and Canada:
Property | Description |
---|---|
FriendlyName |
A nicely-formatted version of the phone number. |
PhoneNumber |
The phone number, in [E.164] (i.e. "+44") format. |
IsoCountry |
The ISO country code of this phone number. |
Capabilities |
This is a set of boolean properties that indicate whether a phone number can receive calls or messages. Possible capabilities are |
Address Requirement Values
The following are the possible values for the address_required
property.
Status | Description |
---|---|
none |
An Address is not required for this phone number. |
any |
Your account must have an Address, but it can be anywhere in the world. |
local |
Your account must have an Address within the phone number’s country. |
foreign |
Your account must have an Address outside the phone number’s country. |
AvailablePhoneNumber Toll-Free Instance Resource
Some DID providers allow toll-free numbers from the US, Canada, and the UK.
Resource URI
An AvailablePhoneNumber toll-free instance resource has no URI. You cannot make requests directly to AvailablePhoneNumber instance resources. Instead, make a request to the toll-free list subresource and then choose a number from the list.
AvailablePhoneNumber Toll-Free Instance Attributes
Property | Description |
---|---|
FriendlyName |
A nicely-formatted version of the phone number. |
PhoneNumber |
The phone number, in E.164 (i.e. "+1") format. |
IsoCountry |
The ISO country code of this phone number. |
Capabilities |
This is a set of boolean properties that indicate whether a phone number can receive calls or messages. Possible capabilities are |
AddressRequirements |
This indicates whether the phone number requires you or your customer to have an Address registered with Restcomm. Possible values are |
AvailablePhoneNumber Mobile Instance Resource
Resource URI
An AvailablePhoneNumber mobile instance resource has no URI. You cannot make requests directly to AvailablePhoneNumber instance resources. Instead, make a request to the mobile list subresource and then choose a number from the list.
AvailablePhoneNumber Mobile Instance Attributes
Property | Description |
---|---|
FriendlyName |
A nicely-formatted version of the phone number. |
PhoneNumber |
The phone number, in E.164 (i.e. "+1") format. |
IsoCountry |
The ISO country code of this phone number. |
Capabilities |
This is a set of boolean properties that indicate whether a phone number can receive calls or messages. Possible capabilities are |
AddressRequirements |
This indicates whether the phone number requires you or your customer to have an Address registered with Restcomm. Possible values are |
AvailablePhoneNumbers Local List Subresource
Resource URI
/2012-04-24//Accounts/\{AccountSid}/AvailablePhoneNumbers/{IsoCountryCode}/Local
{IsoCountryCode} is a country code in ISO 3166-1 alpha-2 format. For example, the IsoCountryCode for Canada is CA
. See Supported Countries for a full list of countries and IsoCountryCodes supported by Restcomm.
HTTP GET
Returns a list of local AvailablePhoneNumber resource representations that match the specified filters, each representing a phone number that is currently available for provisioning within your account.
Basic List Filters
The following basic GET query string parameters allow you to filter the list of numbers returned by Restcomm. Note, parameters are case-sensitive.
Parameter | Description |
---|---|
AreaCode |
Find phone numbers in the specified area code. (US and Canada only) |
Contains |
A pattern to match phone numbers on. Valid characters are |
SmsEnabled |
This indicates whether the phone numbers can receive text messages. Possible values are |
MmsEnabled |
This indicates whether the phone numbers can receive MMS messages. Possible values are |
VoiceEnabled |
This indicates whether the phone numbers can receive calls. Possible values are |
ExcludeAllAddressRequired |
Indicates whether the response includes phone numbers which require any Address. Possible values are |
ExcludeLocalAddressRequired |
Indicates whether the response includes phone numbers which require a local Address. Possible values are |
ExcludeForeignAddressRequired |
Indicates whether the response includes phone numbers which require a foreign Address. Possible values are |
Beta |
Include phone numbers new to the Restcomm platform. Possible values are either |
Querying Available Phone Numbers
You need to be using Restcomm Cloud or setup the DID Provider in Restcomm in order to be able to use this feature. See the Tutorial section. |
Here is an example, the AreaCode is any valid United States Code
curl -X GET https://mycompany.restcomm.com/restcomm/2012-04-24/Accounts/ACCOUNT_SID/AvailablePhoneNumbers/US/Local.json?AreaCode=305 \
-u 'YourAccountSid:YourAuthToken'
The AvailablePhoneNumbers subresources let you search for incoming local and toll-free phone numbers that are available for you to purchase.
-
AvailablePhoneNumbers List Resource URI. /2012-04-24/Accounts/{AccountSid}/AvailablePhoneNumbers/US/Local
Searching For Numbers. When using Restcomm the way to search for new phone numbers is by searching the AvailablePhoneNumbers list resource and providing the desired area code as a filter.