Docs

Get List of Rented Numbers

/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.apico.net/v2/accounts/{accountSID}/numbers’ \
-u {accountSID}:{authToken}

Response example

{
    "page": 0, 
    "limit": 20,
    "next": "https://api.apico.net/v2/accounts/{accountSID}/numbers?limit=20&page=1",
    "prev": null,
           "total": 50,
    "numbers": [
        {
            "number_sid": "{numberSID}",
            "account_sid": "{accountSID}",
            "number": "+447860041755",
            "country_code": "uk",
            "country_name": "United Kingdom",
            "type": "mobile",
            "controller": "http://myapp.apico.net/incom.php",
            "method": "GET",
            "created": "Wed, 27 May 2015 08:11:11 +0000",
            "updated": "Wed, 27 May 2015 08:12:11 +0000",
            "voice": true,
            "messaging": true
        },
        ...
    ]
}

Response parameters

Parameter

Description

page

The current page number. Numbering starts with 0.

limit

A parameter describing how many records are returned at once.

The default and maximum value is 20.

next

URI to the next part of the list.

prev

URI to the previous part of the list.

total

The total number of entries in the returned list.

numbers

List of rented numbers.

numbers/account_sid

Account identifier.

numbers/number_sid

Number identifier.

numbers/number

Phone number in E.164 format.

numbers/country_code

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

numbers/country_name

Full name of the country, or international.

numbers/type

Number type.

One of the following: local, mobile, toll_free or sip.

numbers/controller

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

numbers/method

Method to make a request.

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/created

Rental date.

numbers/updated

Phone number details last updated date.

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.apico.net/v2/accounts/{accountSID}/numbers?type=mobile&messaging=true’ \
-u {accountSID}:{authToken}

Filtering parameters

Parameter

Description

page

The current page number.

Numbering starts with 0.

limit

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

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 (for conventional numbers) or international (for virtual numbers).

type

Number type.

One of the following: local, mobile, toll_free or sip.

voice

Availability of voice communications for the number.

Either true or false.

messaging

Availability of messaging for the number.

Either true or false.