As I need to send message on user's whatsapp number so I have downloaded WhatsApp API from nuget packages. and also I implemented code according to that. But after so many search I found that I need to register mobile number to get password...using WART but I think this application is not working and not able to get password from WhatsApp.
So if anyone implement this feature of sending message on whatsapp number in Asp.net c# then please update me how to do this using WhatsApp Api.. even I don't know whatsapp is provide any API or not.
I have tried with below code...but I need password before that..
string fromMob = "919xxxxxxxxx";
string toMob = txtMobileNo.Text.Trim();
string msg = "This is first WhatsApp Message Whatsapp API";
WhatsApp wa = new WhatsApp(fromMob, "RequiredPassword", "SD", false, false);
try
{
wa.OnConnectSuccess += () =>
{
wa.OnLoginSuccess += (phoneNumber, data) =>
{
wa.SendMessage(toMob, msg);
};
wa.OnLoginFailed += (data) =>
{
msg = "Login Failed" + data;
};
};
wa.OnConnectFailed += (ex) =>
{
msg = "Connection Failed" + ex;
};
wa.Connect();
}
catch { }
WhatsApp Business API is live now. Please refer this link for detailed information.
The WhatsApp Business API Client supports a subset of the features provided by the WhatsApp applications you already know from Android, iOS, Web and other platforms including end-to-end encryption. The difference is that this application can be deployed on a server, providing a local API that allows you to programmatically send and receive messages and integrate this workflow with your own systems (CRMs, customer care, etc.).
Please note that if you use anything other than the official WhatsApp Business API or other official WhatsApp tools, we reserve the right to limit or remove your access to WhatsApp as this violates our policies. Please do not use any non-WhatsApp authorized third-party tools to communicate on WhatsApp.