Get list of rented numbers
Overview
To get the list of rented numbers, make the GET request to /accounts/{accountSID}/numbers.
Request example
The following example demonstrates getting a list of rented numbers.
curl –X GET https://api.apifonica.com/v2/accounts/{accountSID}/numbers \
-u {accountSID}:{authToken}
Response example
{
"limit": 20,
"prev": null,
"next": "https://api.apifonica.com/v2/accounts/{accountSID}/numbers?next=57e4f04a0c9b2dfe504f27e2",
"numbers": [
{
"number_sid": "{numberSID}",
"account_sid": "{accountSID}",
"number": "447480600503",
"token": null,
"name": "NumberPool_1",
"country_code": "GB",
"country_name": "United Kingdom",
"type": "local",
"call_controller": "",
"call_method": "GET",
"msg_controller": "http://172.16.102.175:8082/messages/events",
"msg_method": "GET",
"msg_app_sid": "app61de164b-8e62-35d9-92d0-c6df5f0956ec",
"call_app_sid": "default_call_app_sid",
"endpoint_sid": null,
"created": "Thu, 31 Mar 2016 11:16:59 +0300",
"updated": "Thu, 31 Mar 2016 11:17:21 +0300",
"voice": false,
"messaging": true,
"mode": "xml"
},
...
]
}
Response parameters
Parameter | Description |
---|---|
limit | Number of returned entries per page The default and maximum value is 20. |
prev | URI to the previous part of the list. |
next | URI to the next part of the list. |
numbers | List of rented numbers. |
numbers/number_sid | Number identifier. |
numbers/account_sid | Account identifier. |
numbers/number | Phone number in E.164 format. |
numbers/token | UAuthentication token (if number type is sip and null for other types) |
numbers/name | Text description of the number |
numbers/country_code | Either country code according to ISO 3166-1 alpha-2 or “international”. |
numbers/country_name | Full name of the country. |
numbers/type | Number type. One of the following: local, mobile or sip. |
numbers/call_controller | URL which will be used to make a request for an XML controller file for incoming calls. |
numbers/call_method | Method which will be used to make a request. |
numbers/msg_controller | URL which will be used to send the events about the status change. |
numbers/msg_method | Method which will be used to make a request. |
numbers/call_app_sid | Unique ID of the calling application. |
numbers/msg_app_sid | Unique ID of the messaging application. |
numbers/endpoint_sid | Endpoint unique identifier. |
numbers/created | Rental date. |
numbers/updated | Phone number details last updated date. |
numbers/voice | Availability of voice communications for this number. Either true or false. |
numbers/messaging | Availability of messaging for this number. Either true or false. |
numbers/mode | Parameter which regulates the phone number mode. Modes can be as following: end_point - enables sip-trunking mode; |
Response filtering
To narrow the response results, specify filtering parameters in the GET request to /accounts/{accountSID}/numbers.
Request example (with filtering)
The following curl request demonstrates getting a list of rented mobile numbers with enabled messaging.
curl –X GET https://api.apifonica.com/v2/accounts/{accountSID}/numbers?type=mobile&messaging=true \
-u {accountSID}:{authToken}
Filtering parameters
Parameter | Description |
---|---|
limit | Number of returned entries per page. The default and maximum value is 20. |
number | Phone number in E.164 format. |
name | Text description of the number |
country_code | Either country code according to ISO 3166-1 alpha-2 or 'international'. |
country_name | Full name of the country. |
type | Number type. One of the following: local, mobile 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. |