List Available Area Codes

This endpoint returns a list of all Numbering Plan Area (NPA) codes containing purchasable phone numbers. All request parameters are optional. If you don't specify a limit, results are limited to the first 10 items.

Endpoint

GET /available-tns/npas/

Request Parameters

  • limit
    integer

    Limits the number of items to retrieve. A maximum of 200 items can be retrieved.

  • page
    integer

    Displays the page set by the number in this field. For example, if 2 were entered, page 2 would display in the response.

Example Request

This assumes that you have the Python API Wrapper installed and set up.


#Instantiate the Controller
pnc = PurchasablePhoneNumbersController()

#List Available NPAs
response = pnc.list_available_np_as(limit=3)

                        

Example Request

This assumes that you have the PHP API Wrapper installed and set up.

#Instantiate the Controller
$pnc = new PurchasablePhoneNumbersController();

#Retrieve Available NPAs
$response = $pnc->listAvailableNPAs(3);

                        

Example Request

This assumes that you have the Ruby API Wrapper installed and set up.

#Instantiate the Controller
pnc = FlowrouteNumbers::PurchasablePhoneNumbersController.new()

#List Available NPAs
response = pnc.list_available_np_as(limit:3)

                    

Example Request

This assumes that you have the Node.js API Wrapper installed and set up.

/*
1. Load the Numbers v1 SDK and Node.js util module
2. Declare flowroutenumberslib path relative to your JS file
*/
var flowroute = require('./flowroutenumberslib'); 
var util = require('util');

//Set up your callback function
var cb =  function(err, response){
  if(err){
    console.log(err);
  }
  console.log(util.inspect(response, false, null));
};

//List Available NPAs
flowroute.PurchasablePhoneNumbersController.listAvailableNPAs(3,cb)

                    

Example Response

200 OK

{
  "data": [
    {
      "201": {
        "nxxs": "/v1/available-tns/npanxxs/?npa=201",
        "tns": "/v1/available-tns/tns/?npa=201"
      },
      "203": {
        "nxxs": "/v1/available-tns/npanxxs/?npa=203",
        "tns": "/v1/available-tns/tns/?npa=203"
      },
      "202": {
        "nxxs": "/v1/available-tns/npanxxs/?npa=202",
        "tns": "/v1/available-tns/tns/?npa=202"
      }
    },
    {
      "next": "/v1/available-tns/npas/?limit=3&page=2"
    }
  ]
}