Skip to content

Clickatell services

Israel

Asked Dec 16, 2016, 4:01 PM EST6 answers
Share
LinkedInX
Hi!
 
There is anyone here who use the clickatell service.I have a little question please.
 
Thank you in advance,
Israel. 

5 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • Dr.Ajay Kashyap
    0
    yes sir.... i am using clicktatell service what happen tell me
    0
  • 0
    Thank you Sir Dr Ajay
    I am using this service and I do send SMS through my Windows Application as you can see below some example code. But I am still looking for a long time how can I send and receive SMS from and send to my web server. Can I have a good help on it from some practice code please. I will appreciate.
     
    C#
    try
                {
                    WebClient client1 = new WebClient();
                    string to, msg;
                    to = txtSMS.Text;
                    msg = txtReceive.Text;
                    string baseurl = "http://api.clickatell.com/http/sendmsg?user=xxx&password=xxx&api_id=xxx&to='" + to + "'&text='" + msg + "'";
                    client1.OpenRead(baseurl);
                    MessageBox.Show("SMS sent...");
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
     
    Thank you in advance. 
    0
  • Dr.Ajay Kashyap
    0
    I Don't understand what exactly You Want say ... You want to receive Sms In Your Browser and You also Want to send sms Using browser right ..
     
    See How I Use for One Time Password:- 
     
    Java
     String result;
                    string userName = "xxxxxxxx";
                    string hash = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
                    string numbers = "91" + sud.ContactNo; // in a comma seperated list
                    string message = "You Are Registered Successfully!";
                    string sender = "Kashyap And Company";
                    String url = "http://api.textlocal.in/send/?username=" + userName + "&hash=" + hash + "&numbers=" + numbers + "&message=" + message + "&sender=" + sender;
                    //refer to parameters to complete correct url string
    
                    StreamWriter myWriter = null;
                    HttpWebRequest objRequest = (HttpWebRequest)WebRequest.Create(url);
    
                    objRequest.Method = "POST";
                    objRequest.ContentLength = Encoding.UTF8.GetByteCount(url);
                    objRequest.ContentType = "application/x-www-form-urlencoded";
                    try
                    {
                        myWriter = new StreamWriter(objRequest.GetRequestStream());
                        myWriter.Write(url);
                    }
                    catch (Exception e)
                    {
                        return null;
                    }
                    finally
                    {
                        myWriter.Close();
                    }
    
                    HttpWebResponse objResponse = (HttpWebResponse)objRequest.GetResponse();
                    using (StreamReader sr = new StreamReader(objResponse.GetResponseStream()))
                    {
                        result = sr.ReadToEnd();
                        // Close and clean up the StreamReader
                        sr.Close();
                    }
     
    0
  • 0
    Sir. Dr. Ajay,
     
    Thanx to respond me.
    My first target is to receive SMS from my web application form.
    Please have a look of my whole code on what I tryed but I have some errors.
     
    TypeScript
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Net;
    using System.IO;
    
    
    public partial class frmSMS : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
    
        }
    
        protected void btnSMS_Click(object sender, EventArgs e)
        {
            String result;
            string userName = txtUserName.Text;
            string hash = txtHash.Text;
            string numbers = txtNumbers.Text; // in a comma seperated list
            string message = txtMessage.Text;
            string sender = "Kashyap And Company";
            String url = "http://api.clickatell.com/http/sendmsg?userName=Me&password=123&api_id=1234&to=" + userName + "&hash=" + hash + "&numbers=" + numbers + "&message=" + message + "&sender=" + sender;
            //refer to parameters to complete correct url string
            StreamWriter myWriter = null;
            HttpWebRequest objRequest = (HttpWebRequest)WebRequest.Create(url);
            objRequest.Method = "POST";
            objRequest.ContentLength = Encoding.UTF8.GetByteCount(url);
            objRequest.ContentType = "application/x-www-form-urlencoded";
            try
            {
                myWriter = new StreamWriter(objRequest.GetRequestStream());
                myWriter.Write(url);
            }
            catch (Exception e)
            {
                return null;
            }
            finally
            {
                myWriter.Close();
            }
            HttpWebResponse objResponse = (HttpWebResponse)objRequest.GetResponse();
            using (StreamReader sr = new StreamReader(objResponse.GetResponseStream()))
            {
                result = sr.ReadToEnd();
                // Close and clean up the StreamReader
                sr.Close();
            }
        }
    }
     
     
    1)  A local or parameter name 'sender' cannot be decalred in this scope because that name is used in an enclosing local scope to define a local or parameter
    2) The name 'Encoding' does not exist in the current context
    3) Represents errors that occur during application execution
    4) Since 'frmSMS.btnSMS_Click(objrct, EventArgs)' return void, a return keyword must not be followes by an object expression
    0
  • Dr.Ajay Kashyap
    0
    I dont Know Why Are U getting Error .....I think U Just Try......
     
     
     1).... string numbers = "91" + sud.ContactNo;
     
    In Which Number U Want To send Msg spacify 91..
     
    2).... try Following namespace
    PowerShell
    using System.Web.Mvc;
    using System.Web.Security;
    using System.Text;
    using System.Net.Mime;
    using Microsoft.Ajax.Utilities;
     
    0
  • 1 short reply
    • 0
      Any help Sir. Dr. Ajay!!!
      0