SMS API - Send SMS to many numbers at a time - AARON SMITH TECH

Latest

Programming PHP tutorials for beginners. Technology and product reviews. Aaron Smith video tutorials for beginners.

sponsor

Wednesday, May 3, 2017

SMS API - Send SMS to many numbers at a time

bulk sms

Send SMS to many numbers at a time

For Bulk sms (sms sending to many numbers at a time), better to use SMS API with http connection. In this example you will see how to use SMS API with PHP script for Bulk sms sending.
For bulk sms sending with PHP you can use curl. Just send php array or JSON data to SMS API link. How to prepare this array data?

If you try to insert all numbers to 'to' => "+125352352,+32324234,+234234" Nothing happens:
https://www.proovl.com/api/send.php?user=******&token=******&from=********&to=125352352,32324234,234234&text=hi

It's working only with 1 number:
https://www.proovl.com/api/send.php?user=******&token=******&from=********&to=125352352&text=hi
WRONG sample:


$postfields = array(
'user' => "user",
'token' => "token",
'to' => "+125352352,+32324234,+234234", // WRONG, Nothing happens
'text' => "$text $created"
);

Bulk SMS with API php

How to send BULK sms to many numbers at a time?
You can use foreach php function.


$to = array("4444139833", "+4444255324", "+4444366244" );

foreach ($to as $to_x => $to_y){

$text = "Hello $to_x";

$postfields = array(
'user' => "user",
'token' => "token",
'to' => "$to_y",
'text' => "$text"
);
print_r($postfields);
}


You will see this:


personalized bulk sms sending

If you want make personalized bulk sms sending. You can include names to each sms.



$to = array("Andy" => "4444139833", "Jhon" => "4444255324", "Mike" => "4444366244" );

foreach ($to as $to_x => $to_y){

$text = "Hello $to_x!";

$postfields = array(
'user' => "user",
'token' => "token",
'to' => "$to_y",
'text' => "$text"
);

print_r($postfields);
}
sms api

bulk sms

Done. Now you can send ARRAY data to SMS API link with CURL request.

Bulk SMS php SCRIPT with curl request


$user = "*****"; // SMS API USER ID
$token = "*******"; // SMS API TOKEN
$from = "******"; // SMS API number (sender ID)

$to = array("Andy" => "4444139833", "Jhon" => "4444255324", "Mike" => "4444366244" );

foreach ($to as $to_x => $to_y){

$url = "https://www.proovl.com/api/send.php";

$text = "Hello $to_x!";

$postfields = array(
'user' => "user",
'token' => "token",
'from' => "$from",
'to' => "$to_y",
'text' => "$text"
);

if (!$curld = curl_init()) {
exit;
}

curl_setopt($curld, CURLOPT_POST, true);
curl_setopt($curld, CURLOPT_POSTFIELDS, $postfields);
curl_setopt($curld, CURLOPT_URL,$url);
curl_setopt($curld, CURLOPT_RETURNTRANSFER, true);

$output = curl_exec($curld);

curl_close ($curld);

print_r($postfields);
}


bulk sms

You can use Bulk SMS with form for easy usage: https://sourceforge.net/projects/bulk-sms-script/


https://www.facebook.com/chakabiz
https://www.youtube.com/channel/UCYuMRNb_SRZ4FMsZjnHRZUA

4 comments:

  1. Thanks for sharing the post which was very informative. Bulk SMS in India and marketing is one of the most effective marketing strategies now a days.

    ReplyDelete

  2. This article is very much helpful and i hope this will be an useful information for

    the needed one. Keep on updating these kinds of informative things...
    Digital Mobile

    Marketing

    SMS API
    SMS Marketing

    ReplyDelete
  3. Nice it seems to be good post... It will get readers engagement on the article since readers engagement plays an vital role in every blog.i am expecting more updated posts from your hands.
    iOS App Development Company
    Android App Development Company

    ReplyDelete
  4. This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
    Mobile Marketing Service
    Mobile Marketing Companies
    Texting API
    Sms API
    Sms marketing

    ReplyDelete