I have a website that a lot of people view on mobile. I have link for : Call and SMS and I want to add one for Whatsapp, so a user can click the whatsapp link I create and start a conversation with me.
If this is possible can someone point me in the right direction on how?
This is possible by creating the following link:
whatsapp://send?text=Hello this has been opened from the browser&phone=+PHONENUMBER&abid=+PHONENUMBER
Thanks to:
https://forum.ionicframework.com/t/open-whatsapp-intent-with-msg-specific-contact/73903/4
I have tested this on iOS, Windows Phone and Android
Check this link out Launching Your iPhone App Via Custom URL Scheme
and more on the whats up url scheme document
I did a quick mock up and tried it on my iphone with a link like this from a webpage and it opened the app on my iphone.
I could not try to send a message as I don't have a current Whatsapp account sorry.
Add user name using abid parameter
let's say your whatsapp username was username then it would be
once again sorry I can't test this. Also I have no idea what would happen if the username is the actual user of the current mobile device. eg. You try to whatsapp yourself.
I just posted an answer on a thread similiar to this here https://stackoverflow.com/a/43357241/3958617
The approach with:
and with
Only works if the person who clicked on your link have your number on their contact list.
Since not everybody will have it, the other solution is to use Whatsapp API like this:
More details on this API here: https://www.whatsapp.com/faq/en/general/26000030
And observations on how to use it here: https://stackoverflow.com/a/43357241/3958617
Here is the solution to your problem! You just need to use this format:
In the place of "urlencodedtext" you need to keep the content in Url-encode format.
UPDATE-- Use this from now(Nov-2018)
For more information, see https://www.whatsapp.com/faq/en/general/26000030
Use:
https://wa.me/YOURNUMBER
where
YOURNUMBER
is without the two leading00
.For instance for +37061204312 you write:
https://wa.me/37061204312
This link seems to work on mobiles and on desktop computers.
To prefill the message with text you can use:
https://wa.me/YOURNUMBER/?text=urlencodedtext
More in the Whatsapp FAQ: https://faq.whatsapp.com/en/android/26000030/
Rahul's answer gives me an error: You seem to be trying to send a WhatsApp message to a phone number that is not registered with WhatsApp..., even though I'm sending it to a registered WhatsApp number.
This, however works: