Flowroute numbers SMS API using php

Flowroute numbers SMS API using php

In this post we will show you Flowroute numbers SMS API using php, hear for Flowroute numbers SMS API using php we will give you demo and example for implement.

Read More

NOTE : after download git package random “src” to “FlowrouteMessagingLib”

Flowroute numbers SMS API using php

code for Flowroute numbers SMS API using php

ini_set('display_errors', 'On');
error_reporting(E_ALL);
require_once('vendor/autoload.php');
foreach (glob('src/*.php') as $filename){require_once $filename;}
foreach (glob('src/Controllers/*.php') as $filename){require_once $filename;}
foreach (glob('src/Models/*.php') as $filename){require_once $filename;}
use FlowrouteNumbersLib\Controllers\InboundRoutesController;
use FlowrouteNumbersLib\Controllers\PurchasablePhoneNumbersController;
use FlowrouteNumbersLib\Controllers\TelephoneNumbersController;
use FlowrouteNumbersLib\APIException;
use FlowrouteNumbersLib\Models\BillingMethod;
print "Number Control Demo." . PHP_EOL;
//--- Purchasable Phone Numbers
// Create our controller
$pnc = new PurchasablePhoneNumbersController();
// Retrieve Available NPAs
print("--Retrieve Available NPAs\n");
$response = $pnc->listAvailableNPAs(10);
print_r($response);
// Retrieve Available NPA NXXs
print("--Retrieve Available NPA NXXs\n");
$response = $pnc->listAreaAndExchange();
print_r($response);
// Search for purchasable Numbers
print("--Search for numbers in Seattle Washington\n");
$response = $pnc->search(10,206,641,null,'seattle','wa',null);
print_r($response);
//--- Telephone Numbers
// Create our controller
$tnc = new TelephoneNumbersController();
// Purchase a Phone Number
print("--Purchase a Phone Number\n");
$billing = new BillingMethod('METERED');
$number = '12066417661';
try {
$response = $tnc->purchase($billing, $number);
print_r($response);
} catch(APIException $e) {
print("Error - " . strval($e->getResponseCode()) . ' ' . $e->getMessage() . PHP_EOL);
}
// List Account Phone Numbers
print("--List Account Phone Numbers\n");
try {
$response = $tnc->listAccountTelephoneNumbers();
print_r($response);
} catch(APIException $e) {
print("Error - " . strval($e->getResponseCode()) . ' ' . $e->getMessage() . PHP_EOL);
}
// Retrieve Phone Number Details
print("--Retrieve Number Details\n");
try {
$response = $tnc->telephoneNumberDetails($number);
print_r($response);
} catch(APIException $e) {
print("Error - " . strval($e->getResponseCode()) . ' ' . $e->getMessage() . PHP_EOL);
}
//--- Inbound Routes
// Create our controller
$inbound = new InboundRoutesController();
// Retrieve Routes
print("--Retrieve Inbound Routes\n");
try {
$response = $inbound->mlist();
print_r($response);
} catch(APIException $e) {
print("Error - " . strval($e->getResponseCode()) . ' ' . $e->getMessage() . PHP_EOL);
}
// Create Route
print("--Create New Inbound Route\n");
try {
$routename = 'PSTNroute1';
$routetype = 'PSTN';
$routevalue = '12065551212';
$response = $inbound->createNewRoute($routename, $routetype, $routevalue);
print_r("New Inbound Route Successfully Created\n");
} catch(APIException $e) {
print("Error - " . strval($e->getResponseCode()) . ' ' . $e->getMessage() . PHP_EOL);
}
//update routes
print("--Update TN's Primary and Failover Route\n");
try {
$rtes = '{"routes": [{"name": "PSTNroute1"}, {"name": "PSTNroute1"}]}';
$tn = "19515551212";
$response = $tnc->update($tn, $rtes);
print_r($response);
} catch(APIException $e) {
print("Error - " . strval($e->getResponseCode()) . ' ' . $e->getMessage() . PHP_EOL);
}

Flowroute numbers SMS API using php SDK

flowroute-numbers-php is a PHP API Wrapper that furnishes techniques for associating with v1 of the Flowroute API. These strategies can be utilized to achieve the accompanying:

  • Make new inbound courses
  • Scan for available telephone numbers
  • Buy telephone numbers
  • Refresh the essential and failover course on a telephone number
  • View your claimed telephone numbers and their related subtle elements

Documentation of Flowroute Numbers PHP SDK

To work with the SDK, please read and take after the means here.

Read More

Hope this code and post will helped you for implement Flowroute numbers SMS API using php. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve onlincode. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs onlincode.org

Leave a Comment

Your email address will not be published. Required fields are marked *

1  +  6  =  

We're accepting well-written guest posts and this is a great opportunity to collaborate : Contact US