I'd like to place a link on a webpage which opens a whatsapp chat with a certain whatsapp contact. In other words: I want a "contact me by whatsapp" link to go next to the page's "Contact us my facebook/twitter/google+/etc" links. Something like:
href="whatsapp:contact=015555555555@s.whatsapp.com&message="I'd like to chat with you"
Phone Number will be a country code followed by WhatsApp mobile number without any symbol. Please refer below code.
You can use the following URL as per the WhatsApp FAQ:
https://wa.me/PHONENUMBERHERE
Add the country code in front of the number and don't add any plus (+) sign or any dashes (-) or any other characters in the number. Only integrers/numeric values.
You can also predefine a text message to start with:
https://wa.me/PHONENUMBERHERE/?text=urlencodedtext
I've tried this:
changing 'phonenumber' into a specific phonenumber. This doesn't work completely, but when they click on the link it does open whatsapp and if they click on a contact the message is filled in.
If you want to open a specific person in chat you can, but without text filled in.
You'll probably have to make a choice between the two.
some links to help you Sharing link on WhatsApp from mobile website (not application) for Android https://www.whatsapp.com/faq/nl/android/28000012
Hope this helps
(I tested this with google chrome on an android phone)
This approach only works on Android AND if you have the number on your contact list. If you don't have it, Android opens your SMS app, so you can invite the contact to use Whatsapp.
Google Chrome am targeting a blank window
I've tried many approaches and I have a winner (see Test 3), here is the result of each one:
(I think the Test 3 will also work for you because if the person visiting your site doesn't have you on their contact list, it's the only option that will allow it.)
In all tests the number had to be complete, with country and location code without any initial zeros. Example:
On tests 1 and 2 it only worked with a plus sign on country code: +5511999999999
Test 1:
This way you must have the phonenumber on your contact list. It doesn't worked for me because I wanted to be able to send a message to a number which I may not have on my contact list.
If you don't have the number on your contact list, it opens the Whatsapp listing all your registered contacts, so you can choose one.
It's a good option for sharing stuffs.
Test 2:
This approach only works on Android AND if you have the number on your contact list. If you don't have it, Android opens your SMS app, so you can invite the contact to use Whatsapp.
Test 3 (The Winner):
This was the only way that worked fully for me.
Worth notice:
The following link seems to work fine -
It opens the contact in WhatsApp app, along with the message 'Hello World!' prepopulated in the input text box.
(Tested this with google chrome on an android phone.)