Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sending message to WhatsApp using java

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??

like image 438
Niraj Thakar Avatar asked Oct 02 '13 10:10

Niraj Thakar


1 Answers

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.

like image 195
Henno Vermeulen Avatar answered Oct 04 '22 02:10

Henno Vermeulen