Hi i just implemented a little ruby wrapper around ApiWha API http://www.apiwha.com. Take a look at:
APiWha allow you to manage whatsapp via API.
Send text messages or media
Allows you to send messages to any destination that wrote to you. You can send parameters by GET or POST method (POST parameters as form-data).
Allows you to pull the messages you received and sent.