Resource URL

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

Sample code: VB.NET
Method: POST


  1. Imports System.Web
  2. Imports System.IO
  3. Imports System.Net
  4. Imports System.Text
  5. Imports System.Resources
  6. Public Class sendSMS
  7. Public Function sendSMS()
  8. Dim uname = "youremail@address.com"
  9. Dim hash = "Your API hash"
  10. Dim message = "This is your message"
  11. Dim numbers = "917735838811"
  12. Dim strPost As String
  13. Dim sender = "WEBADD"
  14. Dim url As String = "http://sms.webadd/api2/send/?"
  15. Dim strPost As String
  16. strPost = url + "username=" + uname _
  17. + "&hash=" + hash _
  18. + "&numbers=" + numbers _
  19. + "&message=" + WebUtility.UrlEncode(message) _
  20. + "&sender=" + sender
  21. Dim request As WebRequest = WebRequest.Create(strPost)
  22. request.Method = "POST"
  23. Dim byteArray As Byte() = Encoding.UTF8.GetBytes(strPost)
  24. request.ContentType = "application/x-www-form-urlencoded"
  25. request.ContentLength = byteArray.Length
  26. Dim dataStream As Stream = request.GetRequestStream()
  27. dataStream.Write(byteArray, 0, byteArray.Length)
  28. dataStream.Close()
  29. Dim response As WebResponse = request.GetResponse()
  30. dataStream = response.GetResponseStream()
  31. Dim reader As New StreamReader(dataStream)
  32. Dim responseFromServer As String = reader.ReadToEnd()
  33. Console.WriteLine(responseFromServer)
  34. Console.ReadLine()
  35. reader.Close()
  36. dataStream.Close()
  37. response.Close()
  38. If responseFromServer.Length > 0 Then
  39. Return responseFromServer
  40. Else
  41. Return CType(response, HttpWebResponse).StatusDescription
  42. End If
  43. End Function
  44. End Class