List Account Phone Numbers

This endpoint returns a list of all phone numbers currently on your Flowroute account.

Endpoint

GET /tns/

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.

  • pattern
    integer

    Indicates a pattern of integers to match against. This field supports partial matches. For example, if you enter 12066, all numbers that include 12066 are returned. There is no minimum number of integers on which you can search.

Documentation

  • tns
    integer

    The phone number retrieved from the request; it is composed of the following phone number object.

    • phone number - The phone number you own. This object is further composed of routes:

      • routes - Defines the parameters of the route. Composed of the following:

        • type - Indicates the type of route: HOST, PSTN, or URI. If no route is assigned, SIP-REG is the default name assigned to the route.

        • name - Name of the route. If no name was given to the route, sip-reg is the assigned default name.

    • billing_method - This will always be METERED.

    • detail Passes the URL of the phone number.

Example Request

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

#Instantiate the Controller
tnc = TelephoneNumbersController()

#List Account Phone Numbers
response = tnc.list_account_telephone_numbers(limit=2,page=None,pattern=None)

                        

Example Request

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

#Instantiate the Controller
$tnc = new TelephoneNumbersController();

#Pass the BillingMethod
use FlowrouteNumbersLib\Models\BillingMethod;

#List Account Phone Numbers
$response = $tnc->listAccountTelephoneNumbers(5,2,206);

                        

Example Request

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

#Instantiate the Controller
tnc = FlowrouteNumbers::TelephoneNumbersController.new()

#List Account Phone Numbers
response = tnc.list_account_phone_numbers(limit:5, page:2, pattern:206)

                    

Example Request

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

//Instantiate the Flowroute Numbers Library
var flowroute = require('./flowroutenumberslib');

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

//List Account Phone Numbers
wroute.TelephoneNumbersController.listAccountTelephoneNumbers(2, null, null, cb);

                        

Example Response

200 OK

#Note: The following response is formatted for clarity only.
{
  "data": [
    {
      "next": "/v1/tns/?limit=2&page=2"
    },
    {
      "12064621860": {
        "routes": [
          {
            "type": "SIP-REG",
            "name": "sip-reg"
          },
          {
            "type": "SIP-REG",
            "name": "sip-reg"
          }
        ],
        "billing_method": "METERED",
        "detail": "/v1/tns/12064621860"
      },
      "12014845220": {
        "routes": [
          {
            "type": "HOST",
            "name": "MyHost",
            "value": "24.239.23.40:5060"
          },
          {
            "type": "HOST",
            "name": "cg2ui",
            "value": "cg2ui.kevgriffin.com"
          }
        ],
        "billing_method": "METERED",
        "detail": "/v1/tns/12014845220"
      }
    }
  ]
}