문제

I'm trying to understand if it's possible to create a web service that can send and answer to WhatsApp messages. I searched on the web and I found the WhatsAPI,

I guess this solution work fine, but with the actual version of WhatsApp it's not possible to get the nickname, the sender, the imei and the password.

To get them I set up a Linux PC in which I installed mitmproxy to sniff the web traffic of a Samsung Galaxy S4. By using mitmproxy I can see the web traffic generated by the phone, so I tried to register to WhatsApp (with an another SIM), but in mitmproxy I can't see the data I need for WhatsAPI.

Does anyone knows if it's possible to get the password by using another way?

If it exist can you suggest me a way? Do you think it's possible to do that or it's better to use Telegram or Wechat (they have public API)?

도움이 되었습니까?

해결책

For Java, you can try WhatsUp

For Python, see YowsUp.

Beware that WhatsApp threatens legal action against many of these library developers and does not officially support using the service this way.

I have also spoken directly with WhatsApp representatives who have said no commercial API use of WhatsApp is acceptable.

Also note that bulk messaging is against the WhatsApp terms of service.

There used to be a PHP implementation at WhatsAPI, and another Java implementation, WhatsApi4J. Both are no longer available due to legal threats.

다른 팁

For .NET you use https://github.com/mgp25/Chat-API-NET

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

string nickname = "Nickname";
/* Your number in the format CCAANNNNNNNNN
    *   C - Country Code
    *   A - Area Code
    *   N - Phone number */
string sender = "***************"; //phone number
string password = "*****************"; // Obtain it with WART or Yowsup
WhatsApp wa = new WhatsApp(sender, password, nickname, true);
wa.OnConnectSuccess += () =>
{
    Console.WriteLine("Connected");
    wa.OnLoginSuccess += (phoneNumber, data) =>
    {
        Console.WriteLine("Connection success!");
        wa.SendMessage("**************"/* Number */, "Hello World!");
        Console.WriteLine("Message sent!");
    };
    wa.OnLoginFailed += (data) => {
        Console.WriteLine("Login failed: {0}", data);
    };
    wa.Login();
};
wa.OnConnectFailed += (ex) =>
{
    Console.WriteLine("Connect failed: {0}", ex.StackTrace);
};
wa.Connect();

Console.WriteLine("END");
Console.ReadLine();

wart app maybe works good for you.

WART

WhatsApp Registration Tool

Uses token generator created by Jake

Uses WhatsApiNet fork by me

Requires .NET Framework 4 or Mono Framework (mono-complete on Linux)

This tool is used to register new phonenumbers and can also be used to retrieve a new password for already registered numbers.

The registration identity is auto-generated by the program based on the phone number.

The optional (and highly recommended) password field is used as salt when generating the identity. This will generate a unique identity hash which cannot be replicated unless you know the password.

Leaving the password field blank will generate an identity hash of just the phone number, which can be easily replicated and is highly insecure.

If these answers were helpful to you, please consider saying thank you in a more constructive way

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top