Resource URL

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

Sample code: ASP.NET
Method: POST

  1. <%@ Import Namespace="System.Net" %>
  2. <%@ Import Namespace="System.IO" %>
  3. <script runat="server" language="VB">
  4. Sub Page_Load(sender As Object, e As EventArgs)
  5. Dim Username As String = "YourEmail@Domain.com"
  6. Dim Hash As String = "YourHash"
  7. Dim SenderName As String = "WEBADD"
  8. Dim Number As String = "917735838811"
  9. Dim Message As String = "This is an API message"
  10. Dim URL As String = "http://sms.webadd.in/api2/send/?"
  11. Dim PostData As String = "username=" & Username & "&hash=" & Hash & "&sender=" & SenderName & "&numbers=" & Number & "&message=" & Message
  12. Dim req As HttpWebRequest = WebRequest.Create(URL)
  13. req.Method = "POST"
  14. Dim encoding As New ASCIIEncoding()
  15. Dim byte1 As Byte() = encoding.GetBytes(PostData)
  16. req.ContentType = "application/x-www-form-urlencoded"
  17. req.ContentLength = byte1.Length
  18. Dim newStream As Stream = req.GetRequestStream()
  19. newStream.Write(byte1, 0, byte1.Length)
  20. Try
  21. Dim resp As HttpWebResponse = req.GetResponse()
  22. Dim sr As New StreamReader(resp.GetResponseStream())
  23. Dim results As String = sr.ReadToEnd()
  24. sr.Close()
  25. html.Text = results
  26. Catch wex As WebException
  27. Response.Write("SOMETHING WENT AWRY!Status: " & wex.Status & "Message: " & wex.Message & "")
  28. End Try
  29. End Sub
  30. </script>