Resource URL

http://sms.webadd.in/api2/send/?

Sample code: C#
Method: GET

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Net;
  4. using System.Collections.Specialized;
  5. using System.IO;
  6. namespace sendSMS
  7. {
  8. class sendSMS
  9. {
  10. public string sendSMS()
  11. {
  12. String result;
  13. string userName = "youremail@address.com";
  14. string hash = "Your API hash";
  15. string numbers = "917735838811"; // in a comma seperated list
  16. string message = "This is your message";
  17. string sender = "WEBADD";
  18. String url = "http://sms.webadd.in/api2/send/?username=" + userName + "&hash=" + hash + "&numbers=" + numbers +
    "&message=" + message + "&sender=" + sender;
  19. //refer to parameters to complete correct url string
  20. StreamWriter myWriter = null;
  21. HttpWebRequest objRequest = (HttpWebRequest)WebRequest.Create(url);
  22. objRequest.Method = "POST";
  23. objRequest.ContentLength = Encoding.UTF8.GetByteCount(url);
  24. objRequest.ContentType = "application/x-www-form-urlencoded";
  25. try
  26. {
  27. myWriter = new StreamWriter(objRequest.GetRequestStream());
  28. myWriter.Write(url);
  29. }
  30. catch (Exception e)
  31. {
  32. return e.Message;
  33. }
  34. finally
  35. {
  36. myWriter.Close();
  37. }
  38. HttpWebResponse objResponse = (HttpWebResponse)objRequest.GetResponse();
  39. using (StreamReader sr = new StreamReader(objResponse.GetResponseStream()))
  40. {
  41. result = sr.ReadToEnd();
  42. // Close and clean up the StreamReader
  43. sr.Close();
  44. }
  45. return result;
  46. }
  47. }
  48. }