Create an Inbound Route

Use this endpoint to create a new inbound route. Routes can then be associated with phone numbers using the Update Phone Number Routes endpoint.

Endpoint

PUT /routes/route_name

Request Parameters

  • route_name
    string required

    Name of the route to be created. Alphanumeric characters are supported.

  • type
    string required

    The type of route to be created. Route type can be HOST, PSTN, or URI. Note: In a Python or PHP request using the SDK, mtype must be used instead of type.

  • value
    string required

    Value of the route, dependent on the type:

    • If HOST, the value must be an IP address or URL
      with an optional port number. For example, an IP address could be 24.239.23.40:5060 or a URL could be myphone.com. If no port is specified, the server will attempt to use DNS SRV records.

    • If PSTN, the value must be in E.164 format. e.g.,16476998778.

    • IfURI, the value must be formatted as protocol:user@domain[:port][;transport=<tcp/udp>.

      For example, sip:alice@atlanta.com, sip:16476998778@215.122.69.152:5060;transport=tcp, or sips:securecall@securedserver.com.

Example Request

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

#Instantiate the Controller
irc = InboundRoutesController()

#Create an Inbound Route
response = irc.create_new_route(route_name='PSTNRoute1',mtype='PSTN',value='18002364455')  
print (response)
response = irc.create_new_route(route_name='HOSTRoute1',mtype='HOST',value='24.239.23.40:5060')
print (response)
response = irc.create_new_route(route_name='URIRoute1',mtype='URI',value='sip:120664480000@215.122.69.152:5060')
print (response)

                    

Example Request

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

#Instantiate the Controller
use FlowrouteNumbersLib\Controllers\InboundRoutesController;
use FlowrouteNumbersLib\APIException;

$irc = new InboundRoutesController();

use FlowrouteNumbersLib\Models\Route;

#Create the Route
$response = $irc->createNewRoute('PSTNRoute1','PSTN','18002364455');
$response = $irc->createNewRoute('HOSTRoute1','HOST','24.239.23.40:5060');
$response = $irc->createNewRoute('URIRoute1','URI','sip:120664480000@215.122.69.152:5060');

                    

Example Request

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

#Instantiate the Controller
irc = FlowrouteNumbers::InboundRoutesController.new()

#Create a New Route
response = irc.create_new_route(route_name='PSTNRoute1',type='PSTN',value='12065551212')
response = irc.create_new_route(route_name='HOSTRoute1',type='HOST',value='24.239.23.40:5060')
response = irc.create_new_route(route_name='URIRoute1',type='URI',value='sip:12065551212@215.122.69.152:5060')

                

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));
 // console.log(response);
};

//Create a New Route
flowroute.InboundRoutesController.createNewRoute("PSTNRoute1", "PSTN", "18002364455", cb);
flowroute.InboundRoutesController.createNewRoute("HOSTRoute1", "HOST", "24.239.23.40:5060", cb);
flowroute.InboundRoutesController.createNewRoute("URIRoute1", "URI", "sip:120664480000@215.122.69.152:5060", cb);

                   

Example Response

201 Created

' '