Sending message to WhatsApp using java

Niraj Thakar picture Niraj Thakar · Oct 2, 2013 · Viewed 30.7k times · Source

Since I found some older posts, that tell that whatsapp doesn't support this, I was wondering if something had changed and if there is a way to open a whatsapp 'chat' with a number that I'm sending. so which api will be useful to me??

Answer

Henno Vermeulen picture Henno Vermeulen · Oct 30, 2013

I have exactly the same question. I found out that it is not officially supported.

Some people are reverse engineering how whatsapp works and they created an open source php library and an open source python library called yowsup used by the openwhatsapp application.

You will need a phone to use it and cannot use whatsapp on this phone anymore (may be solved by registering a whatsapp account on a cheap prepaid SIM).

Unless you want to port the PHP code to Java or reverse engineer yourself, I think the easiest way for Java is to make a private webserver that runs the PHP library. You could create a very small PHP script that simply calls the library with the receiver and text message as parameters and let Java call that library by posting to that private webpage.

I would like to know if others have better ideas and if there is a danger that Whatsapp decides to change how it works so that the open source libraries cannot be used anymore.