Hi Alejandro,
There are some examples available on our FTP site at ftp://ftp.multitech.com/engineering/sample-code/sms-finder/ which may be some help. Your code looks close to my example (see below), so it isn’t obvious why it’s failing.
Make sure that “HTTP API Status” is enabled in the “SMS API” menu and that the port is set to the correct value.
Try the example code at ftp://ftp.multitech.com/engineering/sample-code/sms-finder/c-sharp/iSMSHTTPQuerymsg/iSMSHTTPQuerymsg.zip and see if that works for you. I tested it this morning and it worked using Visual Studio Express 2015.
String sendmsg = “http://192.168.2.1:81/querymsg?user=admin&passwd=admin&apimsgid=0″;
// Next section sends the sendmsg request to iSMS and gets the response.
try
{
// prepare the web page we will be asking for
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(sendmsg);
// execute the request
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
// Create a new stream to read from a response
StreamReader sr = new StreamReader(response.GetResponseStream());
// Read contents of response into a string
String responseMsg = sr.ReadToEnd();
// Close StreamReader
sr.Close();
}
catch (System.Exception e)
{
// Exception sending HTTP request, or getting response.
Console.WriteLine(“Error sending request to iSMS:”);
Console.WriteLine(e.ToString());
}