Send SMS PHP Script / API Through Mobile

Don’t want to spend (much) money on sending SMS through different APIs?

If you have unlimited SMS plan on your mobile, or a good amount of SMS plan, you can use php script to send SMS from pushbullet API. Its 500 SMS a month, for free users (as of now, dated 23 Jan, 2021).

Through a simple PHP Script, with curl enabled, you can send SMS to your users, clients etc. You can have a query from database, or an array where you can grab / put user’s details with their mobile number and text message to send through.

Here are the steps which will let you send SMS through PHP script:

Signup With Pushbullet

First step is to signup with Push Bullet and get the access token and iden.

  • Access Token should be easily created through Pushbullet API documents
  • For iden, you need to log into pushbullet web, and click on the Devices on the left, and then click on the mobile name to which you are using Pushbullet for your mobile, and get the iden from the URL as highlighted below:
How to get iden for Pushbullet

PHP Script For Sending SMS

Once you have the access token and iden, you just need to write the PHP script, or any other relevant script to get the thing done. Make sure curl is enabled, just in case if you need help in how to enable or install curl, this post might be helpful. Following is the sample code of PHP for sending SMS through Pushbullet API:


$mobile_iden = "xxxxxxxxxxxx"; // as you have copied from the url, explained above
$mobile_token = "o.xxxxxxxxxxx"; // as per your creation of token

$addresses = '0411111111'; // mobile number to send text to
$sms = 'Hi, its me texting from Pushbullet API';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.pushbullet.com/v2/texts');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "{\"data\":{\"addresses\":[\"$addresses\"],\"message\":\"$sms\",\"target_device_iden\":\"$mobile_iden\"}}");

$headers = [];
$headers[] = 'Access-Token: '.$mobile_token;
$headers[] = 'Content-Type: application/json';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
}

I think thats it for a dev to start writing the script and send SMS through Pushbullet API.

Not A Developer? Get This Script Done By One Of The Developer

If you dont really know how you can develop this script, and want things to be done by a developer, please fill in the contact form and explain your needs so we may get the things done for you, or follow the video below:

If you think something might have been missed, or not properly explained, please post your comment so I may rectify anything, if needed.

Leave a Reply

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