Flowroute Sending SMS API using PHP
In this Post We Will Explain About is Flowroute Sending SMS API using PHP With Example and Demo(Add SMS using flowroute on Yii 1.1).Welcome on infinityknow.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to Flowroute Send SMS With API Gateway‎ using PHPExample
In this post we will show you Best way to implement Flowroute Sending SMS using PHP, hear for Flowroute messaging SDK in PHPwith Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.
Steps
Step 1 : First of all Sign up and retrieve your simple API credentials
Step 2 : and then Purchase a phone number
Purchase a phone number
Step 3 : Send your message
Send your message
In this POST, we will show you simple two methods of creating an PHP HTTP POST request to the Flowroute simple Messaging API:
Request via cURL using PHP
Open a simple command shell session using PHP.
If you haven’t any installed cURL using PHP previously,
Copy the following example POST request.
[php]
curl https://api.flowroute.com/v2/messages \
-u accessKey:secretKey -X POST \
-H “Content-Type: application/json” \
-d ‘{“to”:”12061231234″,”from”:”12065551234″, “body”:”hello world”}’
[/php]
Send Your First SMS
[php]
‘+919999999999’, ‘from’ => ‘Your Purchase Number’, ‘body’ => ‘Testing For infinityknow.com Example’);
$data_string = json_encode($data);
$ch = curl_init($URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, “POST”);
curl_setopt($ch, CURLOPT_USERPWD, $accessKey . “:” . $secretKey);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
‘Content-Type: application/json’, ‘Content-Length: ‘ . strlen($data_string))
);
$result = curl_exec($ch);
print_r($result);
?>
[/php]
Replace simple accessKey:secretKey with your and set PHP API credentials.
In the -d (data) all the option of your PHP cURL request, creating the following Points:
- First Replace the from value with your (purchased)Flowroute phone number.
- Second Replace the to simple value with the simple recipient your phone number.
- Third Replace the Messaging body with your simple text send message.
Example Response
[php]
{
“data”: {
“id”: “mdr1-c102bbd7b662446eb64d4744c115bb60”
}
}
[/php]
Example
This code will create a Flowroute messages client object, set up the message parameters, and use the client object to send the SMS message. The response from the Flowroute API will be printed to the console.
Note that to use Flowroute SMS, you will need to sign up for a Flowroute account and obtain API credentials. You can then use these credentials to authenticate your requests and send SMS messages using the Flowroute API.
I hope you have Got What is Flowroute Send SMS With API Gateway‎ using PHP And how it works.I would Like to have FeadBack From My Blog(infinityknow.com) readers.Your Valuable FeadBack,Any Question,or any Comments abaout This Article(infinityknow.com) Are Most Always Welcome.