1
votes

I am looking for a way to open whatsapp chat through a webpage opened in mobile browser. Like if a user opens my webpage using a smart device and clicks on a link, it should open the whatsapp chat application on the smart device.

I did some research and found that using <a href="whatsapp://send?abid=&text="></a> does exactly that, but I am unclear about abid. Its an address book ID, but how to get that id, like if the user has my number in its contact list, how to get the id?

And I also want to give an option to the user to add my number to its contact list if its not already there, how can I do that?

2
I don't think you can get the abid with javascript in a website, if you are using PhoneGap or something like that you can search for a plugin.InvisibleUn1corn

2 Answers

1
votes

It is now possible. WhatsApp's click to chat feature allows you to begin a chat with someone without having their phone number saved in your phone's address book. To use this feature, create your own link.

Basic Usage: https://wa.me/whatsappphonenumber
Example: <a href="https://wa.me/1XXXXXXXXXX">Click to chat</a>

Link with a pre-filled message: https://wa.me/whatsappphonenumber?text=urlencodedtext
Example: https://wa.me/1XXXXXXXXXX?text=I'm%20interested%20in%20your%20car%20for%20sale

Click here (WhatsApp official website) for details.

-1
votes

if you are using WordPress CMS then its very easy. You need to install a WP plugin https://wordpress.org/plugins/whatsapp-button/. This WP plugin will allow you to add a share button on posts, pages and products(in case of ecommerce website). Then you can use this same share button any where you want and it will open the Whatsapp contacts list in mobile and you can send custom messages. If you want to customize this you need to make some changes in the whatsapp-button.php file of the plugin.

If you have knowledge of PHP then you can use this code in other websites also that are not using WordPress CMS.

Hope this helps!!