Here’s a working example of Grameen Phone’s AloAshbei Platform.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
<?php /* * Demo of the SMS API * Author: maSnun * URL: https://masnun.com */ // I hosted the WSDL on my own host $soap = new SoapClient("https://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:
1 2 3 4 5 6 7 8 9 10 11 12 |
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$ |
6 replies on “Sending SMS With AloAshbei Platform (GP APIs) and PHP”
Jhakkas hoise…..!
Very simple I think. Thanks for the post.
[…] you'll enjoy it and thanks goes to Abu Ashraf Masnun for his work. // 0 // […]
[…] to run this script; let me know in the comment.Hope you’ll enjoy it and thanks goes to Abu Ashraf Masnun for his work. […]
Can you please tell me how can i get this api? I have an application, where i want to integrate this api. I will be happy if you give me some information.
How should I edit the line $soap=new SoapClient(“SMS WSDL.wsdl”); ….. my website smsala