2017-07-08 68 views
0

我從NuGet包管理器安裝WhatsappAPI並試圖執行代碼,但無法通過WART(WhatsApp Registration Tool)。其給錯誤LIKE {Status:"Failed",Reason:"Bad_Request"}所有的時間註冊我的手機號碼。 我已經搜索了很多。但是這個問題沒有任何解決方案。 只有工具,即WART進行註冊。 是否有any new updatesWART is still working .. ??發送WhatsApp的使用WhatsappAPI消息在C#

我的代碼如下。

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); 
    } 

在上面的代碼m不能通過WART工具生成密碼或不通過使用API​​ CodeRequest方法。

讓我知道是否有更新。

回答

0

畢竟,你應該準備一個未在whatsapp中註冊的新號碼,然後按照以下步驟獲取密碼。

string password ; 
string number = "xxxx"; 
WhatsAppApi.Register.WhatsRegisterV2.RequestCode(number , out password); 
//you will recieve a sms, use it to get password 
string password =WhatsAppApi.Register.WhatsRegisterV2.RegisterCode(number ,"code from sms"); 

而庫的配置是舊的,你應該做一個新的配置。

相關問題