WhatsApp RESTAPI
Introducing WhatsApp RESTAPI ( UnOfficial ). In this Tutorial, you will see How to use PHPHive’s UnOfficial WhatsApp RESTAPI.
You can Easily Send & Receive WhatsApp Messages from your Free Web Hosts without Installing any Custom Extension’s.
Introducing WhatsApp RESTAPI
Prerequisite :-
- PHPHive WhatsApp RESTAPI Token , Get it From http://wapi.phphive.info/console/
- WhatsApp Password , Refer : https://www.phphive.info/255/get-whatsapp-password/
! WhatsApp RESTAPI DISCONTINUED !
Q : How can i use it?
Ans : You Just need to Fire a Simple HTTP POST Request on our API Url with Your PHPHive WhatsApp RESTAPI Token.
API Token can be Obtained from http://wapi.phphive.info/console/ For Free.
PHP Snippet for Sending Messages
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
<?PHP $token = ""; // PHPHive WhatsAPI Token, Get it from http://wapi.phphive.info $wa_uid = ""; // WhatsApp Username $wa_pwd = ""; // WhatsApp Password $wa_recp = ""; // Recipient $wa_msg = ""; // Message You want to Send $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,"http://wapi.phphive.info/api/message/send.php"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS,"token=".$token."&wa_uid=".$wa_uid."&wa_pwd=".$wa_pwd."&wa_recp=".$wa_recp."&wa_msg=".urlencode($wa_msg)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $server_output = curl_exec ($ch); curl_close ($ch); echo $server_output; ?> |
Sample Output :
1 2 3 4 5 6 |
{ "request": true, "response": true, "output": "Message Sent", "msg_sent_today": 1 } |
PHP Snippet for Receiving Messages
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
<?PHP $token = ""; // PHPHive WhatsAPI Token, Get it from http://wapi.phphive.info $wa_uid = ""; // WhatsApp Username $wa_pwd = ""; // WhatsApp Password $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,"http://wapi.phphive.info/api/message/receive.php"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS,"token=".$token."&wa_uid=".$wa_uid."&wa_pwd=".$wa_pwd); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $server_output = curl_exec ($ch); curl_close ($ch); echo $server_output; ?> |
Sample Output :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
{ "request": true, "response": [ { "mynumber": "WhatsApp Username", "fromNo": "XXXXXXXXXX", "fromName": "Puneet Mehta", "msgId": "D799FF10BED49CD9F9", "msgType": "text", "msgTime": "1469001844", "msg": "Hey" }, { "mynumber": "WhatsApp Username", "fromNo": "XXXXXXXXX", "fromName": "Puneet Mehta", "msgId": "3510107294D97960F0", "msgType": "text", "msgTime": "1469001844", "msg": "Hi" } ] } |
Q : Is There any Daily Limit for Using this API ?
Ans : No! There’s No Daily Limit. But Spamming is Obviously Not allowed. We are keeping records of IP’s, if we find someone Spamming our Service then that IP will be Banned.
Note : We are Just Trying to Implement Security Measures to prevent WhatsApp Account Block. But there’s no Surety for Same. Accounts may get Blocked ! Use at Your Own Risk.
Enjoy 🙂
worked very well, but i am getting the response:
Bad Mac! Bad Mac! Bad Mac! Bad Mac! Bad Mac! { “request”: true, “response”: true, “output”: “Message Sent”, “msg_sent_today”: 2 }
the message is sent, but should i be worried about this output?
Nop! No Issue’s 🙂
Thanks !
Amazing what you got there, really spared me lots of time 🙂
how can i recive media file from whatsapp device to my personal website
Media Recieve & Send Support will be Added Soon!
Can we use this for account activation on our website as well instead of email activation? Any restrictions or changes to script to do account activation?
Thanks
Yes you can Use it for Sending OTP or Verification Code.
Just Change the Verification Code Sending Algo in Your System / Script.
Hi, I am commenting here just to get notified when the Media sending and receiving feature will be available. Also can we also use whatsapp in normal way after generating username and password ? ( I dont think so )
No You can Use WhatsApp Only at One Instance !
Media Sending & Receiving Support will be Added Soon 🙂
Excelent!!!! Great job..
Can I send the message to the group?
If so what should be the recipient number?
Group Sending & Receiving Support will be Added Soon !
Good Morning. I am interested to try the API but i cant get the token from http://wapi.phphive.info the page doesnt work
WhatsAPI Server is Up & Running Again 🙂
Great Job. Thanks a lot. I was using the old method to send messages but i want to try the REST API but i cant get the token. The page its not working
WhatsAPI Server is Up & Running Again 🙂
Hi… Any problem with api? I try send messages, but rest don’t response… I try login to get new token, url fails ..
Fixed ! WhatsAPI Server is Up & Running Again 🙂
The API is still working?
Theres no function to sendmedia and receiving isnot working?
Thanks
WhatsAPI Server is Working Again.
Send & Receive Media Option will be Added in Next Update.