/README.md

https://github.com/abdullaheldeep/WhatsAPI · Markdown · 134 lines · 78 code · 56 blank · 0 comment · 0 complexity · ca3151582df69f3c581c1b366f3920fe MD5 · raw file

  1. # WhatsAPI
  2. Interface to WhatsApp Messenger
  3. ----------
  4. ### Update March 15th, 2014
  5. Sources are back after brief downtime due to [DCMA takedown](https://github.com/github/dmca/blob/master/2014-02-12-WhatsApp.md).
  6. ### Note July 30th, 2013
  7. *New policy:*
  8. *I no longer provide support to users who are trying to send bulk messages using this API (i.e. a large amount of messages and not the built-in bulk message functionality).*
  9. *Sending advertisments on WhatsApp goes directly against their EULA and I have no way of determining whether the user is trying to send spam, advertising or sending mass messages to "opt-in users".*
  10. *And I also don't want to waste the little spare time that I have on trying to figure out ways to fuck up this beautiful ad-free platform called WhatsApp by enabling people to send spam.*
  11. *Everyone is free to use this API but there will be no more issue reports about being blocked after sending messages to semi-random users.*
  12. *In the famous words of Heath Ledger as the Joker (taken completely out of context by me):*
  13. **It's not about the money, it's about sending a message.**
  14. *\- [shirioko](https://github.com/shirioko)*
  15. ----------
  16. ### Note July 14th, 2013
  17. *Events renamed:*
  18. - *A large number of events have been renamed in the event handling system to better match the recent method names.*
  19. - *All event names and parameters have been listed in the EVENTS.md file*
  20. ----------
  21. ### Note July 10th, 2013
  22. *Another massive overhaul in the code:*
  23. - *MAJOR RENAMING OF MOST METHODS!! Old legacy code will break, we are sorry but it is necessary to provide a cleaner interface. Please check the new code.*
  24. - *Methods renamed to give a more consistent feel to the API - all methods are now camelCase watch out for typo's!*
  25. - *Initial movement towards bringing the code into alignment with PSR-2 (http://www.php-fig.org/psr/2/)*
  26. - *There is absolutely NO, NONE, NADA, ZIP, 100% FREE of any need to use/enter a MAC address or IMEI in this code. DO NOT TRY!*
  27. - *[New Android token used](https://github.com/karolsarnacki/whatsapp/commit/55d8233b852ecd9f6a6f845586e91e6fadbd0c44#L1L20) as WP7 one appears to no longer work. Long live the WP7 token?*
  28. ----------
  29. ### Note June 18th, 2013
  30. *Big overhaul in the code. Big thanks to:*
  31. - *[Ali Hubail](https://github.com/hubail) and*
  32. - *[Ahmed Moh'd](http://fb.com/ahmed.mhd) for making this project happen (and adding me as a member)*
  33. - *[Jannik Vogel](https://github.com/JayFoxRox) for helping me retrieve the latest WhatsApp token, someone should write a book about it some day..*
  34. - *[Tarek Galal](https://github.com/tgalal) for providing the latest WhatsApp functionality in yowsup*
  35. - *[Atans](https://github.com/atans) and*
  36. - *[Jonathan Williamson](https://github.com/jonnywilliamson) for additional fixes*
  37. *\- [shirioko](https://github.com/shirioko)*
  38. ----------
  39. ### What is WhatsApp?
  40. According to [the company](http://www.whatsapp.com/):
  41. > WhatsApp Messenger is a cross-platform mobile messenger that replaces SMS and works through the existing internet data plan of your device. WhatsApp is available for iPhone, BlackBerry, Android, Windows Phone, Nokia Symbian60 & S40 phones. Because WhatsApp Messenger uses the same internet data plan that you use for email and web browsing, there is no cost to message and stay in touch with your friends.
  42. Late 2011 numbers: 1 billion messages per day, ~20 million users.
  43. ### Modified XMPP
  44. WhatsApp uses some sort of customized XMPP server, named internally as FunXMPP, which is basically some extended proprietary version.
  45. ### Login procedure
  46. Much like XMPP, WhatsApp uses JID (jabber id) and password to successfully login to the service. The password is generated by the server and received upon registration.
  47. The JID is a concatenation between your countrys code and mobile number.
  48. Initial login uses Digest Access Authentication.
  49. ### Message sending
  50. Messages are basically sent as TCP packets, following WhatsApps own format (unlike whats defined in XMPP RFCs).
  51. Messages are application level encrypted using RC4 keystreams
  52. ### Multimedia Message sending
  53. Photos, Videos and Audio files shared with WhatsApp contacts are HTTP-uploaded to a server before being sent to the recipient(s) along with Base64 thumbnail of media file (if applicable) along with the generated HTTP link as the message body.
  54. ### Event system
  55. WhatsApi uses an event manager (created by [facine](https://github.com/facine)) which allows you to respond to certain events.
  56. List of events and example code on how to bind an event handler:
  57. https://github.com/shirioko/WhatsAPI/wiki/WhatsApi-events
  58. # FAQ
  59. - **Whats with the hex chars floating all over the code?**
  60. Mostly WhatsApps proprietary control chars/commands, or formatted data according to their servers specifications, stored in predefined dictionaries within the clients.
  61. - **Whats your future development plans?**
  62. We dont have any.
  63. - **Would it run over the web?**
  64. Weve tested a slightly-modified version on top of Tornado Web Server and worked like a charm, however, building a chat client is a bit tricky, do your research.
  65. - **Can I receive chats?**
  66. Indeed, using the same socket-receiving mechanism. But you have to parse the incoming data. Parsing functions arent included in this release, maybe in the next one?
  67. - **I think the code is messy.**
  68. Its working.
  69. - **How can I obtain my password?**
  70. Register a number using WhatsAPI or intercept your phone's password using MissVenom
  71. # NOTES
  72. - This proof of concept is extensible to contain every feature that make a fully-fledged client, similar to the official ones, actually could be even better.
  73. - During the two weeks of analysis of service mechanisms, we stumbled upon serious design and security flaws (they fixed some of them since 2011). For a company with such massive user base, we expected better practises and engineering.
  74. # License
  75. MIT - refer to the source code for the extra line.
  76. # Venomous
  77. Team of Bahraini Developers.
  78. Ahmed Moh'd ([fb.com/ahmed.mhd](https://www.facebook.com/ahmed.mhd)) and Ali Hubail ([@hubail](https://twitter.com/hubail)) contributed to this release.