Get List of Available Numbers for Specified Country
Overview
The phone numbers are picked out from the whole pool of available numbers for the country in a random manner. If the filtering parameters are specified, the numbers are selected after filtration is applied.
The maximum number of suggested numbers is 10.
To get the list of available numbers for specified country, make the GET request to /accounts/{accountSID}/availableNumbers/{countryCode}.
Request example
The following example demonstrates getting a list of available numbers for the country.
curl –X GET ‘https://api.apico.net/v2/accounts/{accountSID}/availableNumbers/ru’ \ -u {accountSID}:{authToken}
Response example
{ "account_sid": "{accountSID}", "country_code": "ie", "country_name": "Ireland", "available_numbers": [ { "number": "+35315313424", "voice": true, "messaging": true, "type": "mobile" }, ... ] }
Response parameters
Parameter |
Description |
account_sid |
Account identifier. |
country_code |
Either country code according to ISO 3166-1 alpha-2 (for conventional numbers), or international (for virtual numbers). |
country_name |
Full name of the country, or international (for virtual numbers). |
available_numbers |
List of numbers available for rent in the specified country for specified account. |
available_numbers/number |
Phone number in E.164 format. |
available_numbers/type |
Number type. One of the following: local, mobile, toll_free or sip. |
available_numbers/voice |
Availability of voice communications for this number. Either true or false. |
available_numbers/messaging |
Availability of messaging for this number. Either true or false. |
Response filtering
To narrow the response results, specify filtering parameters in the GET request to /accounts/{accountSID}/availableNumbers/{countryCode}.
Request example (with filtering)
The following cURL request demonstrates getting a list of available mobile numbers with enabled messaging feature.
curl –X GET ‘https://api.apico.net/v2/accounts/{accountSID}/availableNumbers/ru?type=mobile&messaging=true’ \ -u {accountSID}:{authToken}
Filtering parameters
Parameter |
Description |
number |
Phone number in E.164 format. |
type |
Number type. One of the following: local, mobile, toll_free or sip. |
voice |
Availability of voice communications for this number. Either true or false. |
messaging |
Availability of messaging for this number. Either true or false. |