Thamizh Arasan

Thamizh Arasan

  • NA
  • 8
  • 14.8k

whatsapp Api login failed

Aug 26 2015 11:27 AM
Hello friends:
when i'm trying to send a message using c# with whatsApp API ,it shows login Failed. The error is not-authorized.
 
Can you please help anyone .
 
Below my code :
 
  private void button1_Click(object sender, EventArgs e)
{
string from = "mymobileno";
string TO = textBox1.Text;
string Message = textBox2.Text;
WhatsApp wa = new WhatsApp(from, "********", "Thamizh", false, false);

wa.OnConnectSuccess +=()=>
{
MessageBox.Show("Connected to Whatsapp");


wa.OnLoginSuccess += (PhoneNumber, data) =>
{
wa.SendMessage(TO, Message);
MessageBox.Show("Message send successfully");
};
wa.OnLoginFailed += (data) =>
{
MessageBox.Show("LoginFailed :{0}", data);
};
wa.Login();
};
wa.OnConnectFailed += (ex) =>
{
MessageBox.Show("Connection Failed");
};
wa.Connect();

}

Answers (7)