Sep.06

Run Sparrow sms API from PHP

 

SMS Gateway API

Sparrow SMS is a leading Bulk SMS Service Provider and VAS provider in Nepal. We are a trusted name for delivering SMS and bulk messaging covering major mobile operators (Ncell, NTC, SmartTel) providing greatest reach for customer communication with an easy-to-use messaging platform along with reliable connectivity.

 

Sparrow Sms is implemented for the business purpose to send SMS from programming. Here i have shared the implemented Sms API code from the Php file.   Before implementation the curl  

Implementation of Post Post API

  $args = http_build_query(array( ‘token’ => ‘9DM16QEFbzEpXPnfV0D6’, ‘from’ => ‘Demo’, ‘to’ => ‘9849074553’, ‘text’ => ‘HELO MIKE TESTING TESTING’));

$url = “http://api.sparrowsms.com/v2/sms/”;

# Make the call using API.

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);

curl_setopt($ch, CURLOPT_POST, 1);

curl_setopt($ch, CURLOPT_POSTFIELDS,$args);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// Response $response = curl_exec($ch);

$status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);

curl_close($ch);  

++++++++++++++++++++++++++++++

Details

++++++++++++++++++++++++++++++

token:  is given by the api we can create it in management section of sparrow sms system.

from : is the identifier which is given by sparrow sms

to : receivers mobile number. [we can add multiple mobile by comma separation ex. 9849074553,9841700769]

text : message body which we have to sent to the user  

Share this Story:
  • facebook
  • twitter
  • gplus

Comments(1)

  1. Bimal Man Shrestha
    583 days ago

    Very usefull. Thanks Prakash ji.

Leave a comment

Facebook Comment