Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
Hi All,

I have a htpp api for sending sms through a bulk sms sending website.
But i dont know how to use the api in my vb .net application. I have some code which i found as sample from sms website.
VB
Imports System.IO
Imports System.Net
 Dim client As WebClient = New WebClient
        ' Add a user agent header in case the requested URI contains a query.
        client.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)")
        client.QueryString.Add("user", "[username]")
        client.QueryString.Add("password", "[password]")
        client.QueryString.Add("api_id", "[api_id]")
        client.QueryString.Add("to", "1234567890")
        client.QueryString.Add("text", "This is an example message")
        Dim baseurl As String = "http://api.clickatell.com/http/sendmsg"
        Dim data As Stream = client.OpenRead(baseurl)
        Dim reader As StreamReader = New StreamReader(data)
        Dim s As String = reader.ReadToEnd()
        data.Close()
        reader.Close()
        MessageBox.Show(s)
        Return


But i am getting an error connot route the massage. Please help me in this and thanks in advance.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900