Docs

Get List of Rented Numbers

https://api.apifonica.com/v2/accounts/{accountSID}/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,
            "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

Authentication token (if number type is sip and null for other types)

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;
sip_phone - enables mode to link Apifonica voice numbers with soft/hard phones;
xml - enables default mode to request XML instructions.

Description

A parameter describing how many records are returned at once.

The default and maximum value is 20.

Description

URI to the next part of the list.

Description

URI to the previous part of the list.

Description

List of rented numbers.

Description

Account identifier.

Description

Number identifier.

Description

Phone number in E.164 format.

Description

Either country code according to ISO 3166-1 alpha-2 (for conventional numbers) or international (for virtual numbers).

Description

Full name of the country, or international.

Description

Number type.

One of the following: localmobiletoll_free or sip.

Description

URL which will be used to make a request for an XML controller file for incoming calls.

Description

Method which will be used to make a request.

Description

URL which will be used to send the events about the status change.

Description

Method which will be used to make a request.

Description

Unique ID of the calling application.

Description

Unique ID of the messaging application.

Description

Endpoint unique identifier.

Description

Rental date.

Description

Phone number details last updated date.

Description

Availability of voice communications for this number.

Either true or false.

Description

Availability of messaging for this number.

Either true or false.

Description

Parameter which regulates the phone number mode.

Modes can be as following:

end_point - enables sip-trunking mode;
sip_phone - enables mode to link Apifonica voice numbers with soft/hard phones;
xml - enables default mode to request XML instructions.

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.

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.

Description

A parameter describing how many records you want to return all at once.

The default and maximum value is 20.

Description

Phone number in E.164 format.

Description

Either country code according to ISO 3166-1 alpha-2 (for conventional numbers) or international (for virtual numbers).

Description

Number type.

One of the following: localmobiletoll_free or sip.

Description

Availability of voice communications for the number.

Either true or false.

Description

Availability of messaging for the number.

Either true or false.