Sending SMS With AloAshbei Platform (GP APIs) and PHP

Thursday, February 4th, 2010

Tags:

Here’s a working example of Grameen Phone’s AloAshbei Platform.

 
<?php
/*
* Demo of the SMS API
* Author: maSnun
* URL: http://masnun.com
*/
 
 
// I hosted the WSDL on my own host
$soap = new SoapClient("http://masnun.com/wsdl/wsdl.php");
 
// Set the parameters in an array
 
$a['registrationID'] = "masnun";
$a['password'] = "******";
$a['sourceMsisdn'] = '8801711960803';
$a['destinationMsisdn'] = '88017********';
$a['smsPort'] = 7424;
$a['msgType'] = 4;
$a['charge'] = 2.00 ;
$a['chargedParty'] = '8801711960803';
$a['contentArea'] = 'gpgp_psms';
$a['msgContent'] = 'Hello GP API!';
 
 
try {
    var_dump( $soap->sendSMS( array ("SendSMSRequest" => $a) ) );
} catch (Exception $e) {
 
    var_dump($e->getMessage());
 
}
 
?>

Example Response:

 
masnun@ubuntu:~$ cd random
masnun@ubuntu:~/random$ php gpsoap.php
object(stdClass)#2 (1) {
  ["SendSMSResponse"]=>
  object(stdClass)#3 (2) {
    ["status"]=>
    string(2) "OK"
    ["msgID"]=>
    string(17) "20100204183047653"
  }
}
masnun@ubuntu:~/random$

2 Responses to “Sending SMS With AloAshbei Platform (GP APIs) and PHP”

  1. Shuvo says:

    Jhakkas hoise…..!

  2. Very simple I think. Thanks for the post.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">