List Phone Number Details

Use this endpoint to retrieve all of the information associated with any of the phone numbers in your account, including billing method, primary route, and failover route.

Endpoint

GET /tns/telephone_number/

Request Parameters

  • telephone_number
    string required

    Phone number to search for which must be a number that you own. Must be in 11-digit E.164 format; e.g. 12061231234.

Response Fields

  • routes

    The routes associated with your phone number. It is an object composed of the following attributes:

    • type: Indicates the type of route: HOST, PSTN, URI, or SIP-REG. SIP-REG is the default name assigned to the route if none is assigned. A route type can be created using Create an Inbound Route.

    • name: Name of the route. If no name was given to the route, sip-reg is the assigned default name. A name is assigned to a route when the route is created.

  • billing_method

    This will always be METERED.

Example Request

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

#Instantiate the Controller
tnc = TelephoneNumbersController()

#List Phone Number Details
response = tnc.telephone_number_details(12065554788)

                        

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 Phone Number details
$number = '12065554788';
$response = $tnc->telephoneNumberDetails($number);

                        

Example Request

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

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

#List Phone Number Details
response = tnc.telephone_number_details('12065554788')

                    

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');
//Define your callback function
var cb =  function(err, response){
  if(err){
   console.log(err);
   }
       console.log(util.inspect(response, false, null));
};

//List Phone Number Details
flowroute.PhoneNumbersController.telephoneNumberDetails("12065554788", cb);

                        

Example Response

200 OK

#Note: The following response is formatted for clarity only.
{
 "routes": [
  {
     "type": "SIP-REG",
     "name": "sip-reg"
   },
    {
     "type": "SIP-REG",
     "name": "sip-reg"
   }
 ],
  "billing_method": "METERED"
}