Monday, September 12, 2016

Send messages with whatsapi.net?

Leave a Comment

I want to send messages using whatsapi and this was my try

string nickname = "Test"; string sender = "xxxxxxxxxxxxxx";          //My Phone Number tryed with 049xxxxxxxxxxxx, 0049xxxxxxxxxxxxxx, 49xxxxxxxxxxxxxxx, xxxxxxxxxxxxxx string imei = "xxxxxxxxxxxxxxxxxxxxxxxxx";//My IMEI  WhatsApp me = new WhatsApp(sender,imei ,nickname,true); me.Connect(); Console.WriteLine(me.ConnectionStatus);// I get a Connection! Console.ReadLine(); me.SendMessage("xxxxxxxxxx", "This is a Test!");// Send Message //No Message received :( me.Disconnect(); Console.WriteLine(me.ConnectionStatus); Console.ReadLine(); 

Now where is my mistake? and how I'm doing it right?

I'm using this version: https://github.com/perezdidac/WhatsAPINet.

First I just want to send messages. When I try to get a request from the WART, I just get this message:

Could not request code using either sms or voice. SMS: {"status":"fail","reason":"no routes","retry_after": 3600} Voice: {"status":"fail","reason":"no routes","retry_after": 3600} 

4 Answers

Answers 1

download installer for generate password https://github.com/mgp25/WART from this link

after that pass your mobile no and password which you got. and pass user detail like his no or msg in constructor in whatsapp object.

it will work for you. try with it.

Answers 2

    WhatsApp wa = new WhatsApp("your number", "your password", "pankaj", false, false);     wa.OnConnectSuccess += () =>     {         Response.Write("connect");         wa.OnLoginSuccess += (phno,data) =>         {             wa.SendMessage("to", "msg");         };          wa.OnLoginFailed += (data) =>         {             Response.Write("login failed"+data);         };         wa.Login();     };     wa.OnConnectFailed+= (ex)=>     {         Response.Write("connection failed");     } 

Answers 3

Use this fork https://github.com/andregsilv/WhatsAPINet
It works and you will also be able to obtain your password with it. Here is the link to the Nuget package for it
https://www.nuget.org/packages/WhatsAppAPI/

Answers 4

After the connect put the command to Login. I resolved this way:

me.connect();  me.login(null); 
If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment