Get list of available virtual numbers
Overview
Virtual (international) numbers are SIP identifiers consisting of numbers; they are treated by Apifonica API as conventional telephone numbers. Virtual numbers do not have the regional identity.
To get a list of available virtual numbers, make the GET request to /accounts/{accountSID}/availableNumbers/virtual.
All other requests work the same way as with conventional phone numbers.
Request example
The following cURL request demonstrates getting a list of available virtual numbers.
curl –X GET https://api.apifonica.com/v2/accounts/{accountSID}/availableNumbers/virtual \
-u {accountSID}:{authToken}
Response example
{
"country_code": "virtual",
"country_name": "virtual",
"available_numbers": [
{
"number": "883140777092718",
"type": "sip",
"voice": true,
"messaging": false
}, … ]
}
Response parameters
Parameter | Description |
---|---|
country_code | Either country code according to ISO 3166-1 alpha-2 or “international”. |
country_name | Full name of the country. |
available_numbers | List of numbers available for rent in specified country for specified account. |
available_numbers/number | Phone number in E.164 format. |
available_numbers/type | Number type. Can be local, mobile,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 filter the response you can specify parameter values in your GET request.
Request example
curl –X GET https://api.apifonica.com/v2/accounts/{accountSID}/availableNumbers/virtual?number=883140347007075 \
-u {accountSID}:{authToken}
Filtering parameters
Parameter | Description |
---|---|
number | Phone number in E.164 format. |