Send Free SMS – Web Service
July 17th, 2008
Update: There seems to be some problem when the API is being accessed from my domain. Kindly try hosting the script in your own domains.
Hi friends, if you are in India and if you are developing software prototypes which has to send SMS alerts to various Indian mobile numbers, you needn’t spend a lot to buy SMS credits at the various sites. Over the last weekend, I spent some time hacking up a quick SOAP based web service which you can consume in your programs.
Please note that you need to create an account at www.way2sms.com before proceeding further.
How to Use – Method 1:
Currently the web service is active at http://www.aswinanand.com/sendsms.php. This accepts four parameters.
Parameter Name | Description |
---|---|
uid | This represents the 10 digit phone number with which you have to login at way2sms. Note: This web service may not work if you try logging in with email address. |
pwd | Your way2sms password |
phone | One or more phone numbers to which SMS has to be sent. Phone numbers should be separated by semicolon (;). E.g. 9812345678;9933445566 |
msg | Message that has to be sent. |
The URL – http://www.aswinanand.com/sendsms.php – can be invoked with the parameters as follows:
http://www.aswinanand.com/sendsms.php?uid=9933445566&pwd=password&phone= 9812345678;9933445566&msg=Hello+World
You can also do a HTTP POST to the same URL to send the SMS. Here’s an example:
<form method=”post” action=”http://www.aswinanand.com/sendsms.php“>
<input type=”hidden” name=”uid” value=”9933445566″ />
<input type=”hidden” name=”pwd” value=”password” />
<input type=”hidden” name=”phone” value=”9812345678;9933445566″ />
<input type=”hidden” name=”msg” value=”Hello World” />
<input type=”submit” value=”Send SMS” />
</form>
How to Use – Method 2:
The functionality is also exposed as a SOAP (Simple Object Access Protocol) WSDL (Web Service Description Language). WSDL can be accessed at http://www.aswinanand.com/sendsms.php?wsdl. To know more about how to use this WSDL in Microsoft Visual Studio, check out this article.
To deploy this SMS script on your own server, first download the source code & follow the instructions:
- Let us assume that you wish to run the service at http://www.example.com/sms/sendsms.php. Here, http://www.example.com/ is your domain, “sms” is the folder and “sendsms.php” is the PHP script in that folder.
- Hence, using FTP or SSH, login to your domain hosting space and create a folder named “sms”.
- Extract the source code to the “sms” folder. If you don’t want to expose a SOAP WSDL, feel free to skip to step 6.
- Since the SMS source code supports SOAP, you have to download the ‘nusoap’ library. Then extract the ‘nusoap’ library to the same “sms” folder.
- Once everything is extracted, the folder structure should be:
- example.com
- sms/
- sendsms.php
- htmlparser.inc (optional)
- nusoap/
- class.nusoap_base.php
- class.soap_transport_http.php
- class.wsdlcache.php
- class.soap_fault.php
- class.soap_val.php
- class.xmlschema.php
- class.soap_parser.php
- class.soapclient.php
- class.soap_server.php
- class.wsdl.php
- nusoapmime.php
- nusoap.php
- sms/
- example.com
- Try accessing your web service at http://www.example.com/sms/sendsms.php now.
http://www.example.com/sms/sendsms.php?uid=9933445566&pwd=password&phone= 9812345678;9933445566&msg=Hello+World
or you can also do a HTTP POST as indicated above.
License Information:
The source code is licensed under “Creative Commons Attribution-Noncommercial”. Downloading the file(s) mean that you have agreed license terms.
Download:
Download the PHP source code here.
Other Languages:
Currently this SMS web service is available in the following programming languages:
Misc:
If you liked this web service, please digg it 🙂 . Kindly take it for a test drive and let me know if you find any bugs.
February 10th, 2011 at 6:46 pm
still mixmasala.webfrnd.com is working with post method only
not get method.
February 12th, 2011 at 4:24 pm
Seems Way2SMS changed their code. Most of the old code not working. But few client apps are working.
Pls. update your code and let us know the changes.
Thanks a million !
February 12th, 2011 at 9:27 pm
sorry guys.
due to webfrnd.com expiry the webfrnd.com is not working still now. most probably this will start from monday again
till then
i am providing you other link for sending msg
http://smsapi.ueuo.com/
for the time being
February 16th, 2011 at 11:19 am
mixmasala.webfrnd.com is again working
March 2nd, 2011 at 10:00 pm
Hi AswinAnand,
Your website is great…the way u have provided source for sending sms is awesome….
I tried your php version of sending sms
1 ) http://www.aswinanand.com/sendsms.php…it says invalid ID
2) and also tried deploying sendsms.php in my server…it says “done” but i didn’t get any SMS…should i configure something in my server ?
Please let me know wat should be done
Thanks for your reply.
Thanks & Regards,
Snober
March 3rd, 2011 at 6:21 pm
hello sir
I AM BCA STUDENT DEVELOPING MY WEBSITE FOR PROJECT.
I WANT TO SEND SMS THTOUGH MY SITE,CON U PROVIDE ME THE FULL CODE FOR ASP.NET 3.0.
March 3rd, 2011 at 9:10 pm
First create a id on way2sms.com
just download the code
http://mixasala.webfrnd.com/m/sms.zip
extract the files and change your way2sms username and password in sendsms.asp and run sms.html
March 6th, 2011 at 11:13 pm
Hi Ankit Jain,
i tried to download script from the link which you provided above but, the file doesn’t downloaded, it shows error while downloading.
please reply me…
April 18th, 2011 at 7:42 pm
Hi aswin sir,
I’m doing MCA from mumbai and doing project on C# desktop application which require sending sms features to client and you guide me to implement this features using way2sms service.
So I’m kindly requesting you to help me to implement this features.Thanking you in advance.
May 16th, 2011 at 3:48 pm
great contribution
June 17th, 2011 at 5:50 pm
Awesome, great article. I know about only first method. No idea about wsdl. Very nice service.
Thanks for sharing blog.
Latha
July 16th, 2011 at 9:01 pm
[…] year before i updated the Ashwin anand’s php code for sending sms from php. later many of them reported that my code too is not work. So now […]
August 27th, 2011 at 3:29 pm
This is Good Post .i followed this concept but didnt work please help me
October 28th, 2011 at 5:26 pm
just check
http://smsapi.webfrnd.com/qsms.php