API Codes
The API works on GET and POST METHOD, and the url to be used is
http://www.msg2sms.net/pushsms.php
The variables to be used are:
username
msg2sms
password
your_password
sender
Alphanumeric/Number SenderID for GSM Recipients
to
Recipient Number (one at a time)
message
Actual Message to be sent
Messaging API's
A sample HTTP API Call for Single Recipient would be: (Normal Route)
http://www.msg2sms.net/pushsms.php?username=msg2sms&password=your_password
&sender=mysenderid&to=myrecipient&message=Hello
A sample HTTP API Call for Single Recipient with Scheduling (4th January 2009 at 3:30 PM) would be: (Normal Route)
http://www.msg2sms.net/pushsms.php?username=msg2sms&password=your_password
&sender=mysenderid&to=myrecipient&message=Hello&shtime=04-01-2009-15-30
A sample HTTP API Call for Multiple Recipients would be: (Normal Route)
http://www.msg2sms.net/pushsms.php?username=msg2sms&password=your_password
&sender=mysenderid
&to=myrecipient1,myrecipient2,myrecipient3&message=Hello
A sample HTTP API Call for Single Recipient would be: (Priority Route)
http://www.msg2sms.net/pushsms.php?username=msg2sms&password=your_password
&sender=mysenderid&to=myrecipient&message=Hello&priority=2
A sample HTTP API Call for Multiple Recipients would be: (Priority Route)
http://www.msg2sms.net/pushsms.php?username=msg2sms&password=your_password
&sender=mysenderid
&to=myrecipient1,myrecipient2,myrecipient3&message=Hello&priority=2
A sample HTTP API Call for Sending UNICODE message would be:
http://www.msg2sms.net/pushsms.php?username=msg2sms&password=your_password
&sender=mysenderid
&to=myrecipient1,myrecipient2,myrecipient3&message=unicode message&unicode=1
A sample HTTP API Call for Sending FLASH message would be:
http://www.msg2sms.net/pushsms.php?username=msg2sms&password=your_password
&sender=mysenderid
&to=myrecipient1,myrecipient2,myrecipient3&message=message&flash=1
A sample HTTP API Call for Picture Messagese:
http://www.msg2sms.net/pushsms.php?username=msg2sms&password=your_password
&sender=mysenderid
&to=myrecipient&message=message&picture=1
Message would the hexcode of otb file (You should convert normal image file to otb file).
Example: http://domain/pushsms.php?username=username&password=password&sender=sender&to=mobile_number&message= 3000000002010000481c0100000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000002200e0000000000008ee0060007e0000001866046000130001001844
0c40001300030038441e4c30320c678028440cdc583c168300484408ec902224c2007c4408c9e02378e2008
ccc18d980236066010cee1c9d90666527039ecc1998e0fc38c6000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000&picture=1
The reply will be a message id, seperated by comma.
Other API's
To fetch DLR use (Only one recipient DLR at a time):
http://www.msg2sms.net/fetchdlr.php?msgid=message_id
To fetch Multiple DLR's
http://www.msg2sms.net/fetchdlr.php?msgid=message_id1,message_id2,message_id3
Result will be in the form "message_id:DLR" seperated by commas.
A sample HTTP API Call for Balance Check:
http://www.msg2sms.net/balancecheck.php?username=msg2sms&password=your_password
A sample HTTP API Call to Request Sender id:
http://www.msg2sms.net/addsender.php?username=msg2sms&password=your_password&sender=your_sender&type=(gsm or cdma)
Example: http://www.msg2sms.net/addsender.php?username=msg2sms&password=your_password&sender=mysender&type=gsm
A sample HTTP API Call to delete scheduled messages:
http://www.msg2sms.net/deleteshedule.php?username=msg2sms&password=your_password&msgid=MyId1,MyId2,MyId3
*MyId1,MyId2,MyId3.... are the message id's.
A sample HTTP API Call to get your Senderids:
http://www.msg2sms.net/getsenderids.php?username=msg2sms&password=your_password
XML API For Sending Single SMS
$data=
"<?xml version='1.0' encoding='utf-8'?>
<MESSAGE>
<USER USERNAME='username' PASSWORD='password'/>
<SMS TEXT='Hi, this is a test message.' MESGTYPE='' ID='1'>
<ADDRESS FROM='XXXXXXXXXX' TO='XXXXXXXXXX' SEQ='1'/>
</SMS>
</MESSAGE>";
$data=urlencode($data);
http://www.msg2sms.net/xmlapi.php?data=$data
XML API For Sending Multiple SMS
$data=
<?xml version='1.0' encoding='utf-8'?>
<MESSAGE>
<USER USERNAME='username' PASSWORD='password'/>
<SMS TEXT='Hi, this is a test message.' MESGTYPE='' ID='1'>
<ADDRESS FROM='XXXXXXXXXX' TO='XXXXXXXXXX' SEQ='1'/>
<ADDRESS FROM='XXXXXXXXXX' TO='XXXXXXXXXX' SEQ='2'/>
<ADDRESS FROM='XXXXXXXXXX' TO='XXXXXXXXXX' SEQ='3'/>
<ADDRESS FROM='XXXXXXXXXX' TO='XXXXXXXXXX' SEQ='4'/>
<ADDRESS FROM='XXXXXXXXXX' TO='XXXXXXXXXX' SEQ='5'/>
</SMS>
</MESSAGE>
$data=urlencode($data);
http://www.msg2sms.net/xmlapi.php?data=$data
To fetch DLR use (Only one recipient DLR at a time):
http://www.msg2sms.net/fetchdlr.php?msgid=message_id