Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have installed WhatsApp API from nuGet package manager and tried to implement code but could not register my mobile number through WART(WhatsApp Registration Tool).Its giving error LIKE {Status:"Failed",Reason:"Bad_Request"} all the time. I have searched a lot.But there is no any solution to this issue. There is only tool i.e. WART for registration.

Is there any new updates OR WART is still working?

What I have tried:

public JsonResult SendMessage(string sendTo,string message)
    {
        var response = false;
        string from = "91XXXXXXXXXX"; //(Enter Your Mobile Number)
        String password;
        var res = WhatsAppApi.Register.WhatsRegisterV2.RequestCode(from, out password);
        WhatsApp wa = new WhatsApp(from, password, "abc.com", false, false);
        wa.OnConnectSuccess += () =>
        {
            wa.OnLoginSuccess += (phonenumber, data) =>
            {
                wa.SendMessage(sendTo, message);
                response = true;
            };
            wa.OnLoginFailed += (data) =>
            {
                response = false;
            };

            wa.Login();
        };
        wa.OnConnectFailed += (Exception) =>
        {
            response = false;
        };
        return Json(response);
    }
Posted
Updated 11-Aug-22 19:16pm
v2
Comments
Richard MacCutchan 8-Jul-17 8:38am    
You should be asking this question in the Whatsapp support forum.
mohammad sabzaligol 18-Dec-21 12:59pm    
hihow i give password when generate pasword whatsapp?
Member 15734840 12-Aug-22 3:07am    
please use GetToken instead of Request code,it will generate password ,which you are storing in var res than use this variable in the plase of password.Thanku

The video/site you are referring is very old. Around 2015 WhatsApp supports WART but now it is outdated. You can refer WhatsApp API or other libraries like Twilio or IMImobile etc.
 
Share this answer
 
String password;
var res = WhatsAppApi.Register.WhatsRegisterV2.RequestCode(from, out password,string out error)
it may work in your case
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900