I have developed a website which is mainly used in mobile phones.
I want to allow users to share information directly from the web page into WhatsApp.

Using UserAgent detection I can distinguish between Android and iOS.
I was able to discover that in order to implement the above in iOS I can use the URL:

href="whatsapp://send?text=http://www.example.com"

I'm still looking for the solution to be used when the OS is Android (as the above doesn't work).
I guess it is somehow related to using "intent" in Android, but I couldn't figure out how to do it as parameter for href.

To create your own link with a pre-filled message that will
automatically appear in the text field of a chat, use
https://wa.me/whatsappphonenumber/?text=urlencodedtext where
whatsappphonenumber is a full phone number in international format and
URL-encodedtext is the URL-encoded pre-filled message.

I tested this in all devices. All it does is open the whatsapp application. Nothing happens afteward. Tested multiple devices (iOS, Android, Windows).
– HoldOffHungerMar 27 at 13:11

@HoldOffHunger yes it will open whatsapp application and the user have to select the contact to which he desires to share the link/content.
– ad08Apr 4 at 12:25

@ad08: That is how Threema and the other 40 services I tested worked. Viber and WhatsApp, however, do nothing, I contacted their developers, and they both admitted the API does nothing. I've kept track of their correspondence and the other 40 api's (which work) here: github.com/bradvin/social-share-urls/blob/master/README.md
– HoldOffHungerApr 4 at 12:30

I've been playing with it for a while, and I couldn't make it to work. The most I got was to open the WhatsApp application from Chrome, but I couldn't figure out a way to set the message content and recipient.

Since it is not documented by the WhatsApp team, I think this is still work in progress. It looks like in the future WhatsApp will handle SMS too.

The only way to get more information is by reaching the WhatsApp dev team, what I tried, but I'm still waiting for a response.

Just tested the whatsapp:// scheme on my super old Android 2.3.3 with Whats App 2.11.301, works like a charm. It seems to be just the Whats App version. Since Whats App is forcing everyone to update, it should be safe to use it.

What did not work? The link was displayed on a non-mobile device? On the mobile device the link did not work?
– WeidenrindeMar 29 at 14:50

The WhatsApp application opens. But neither a text nor a message displayed. Tested on several OS's and devices. I e-mailed the developers. They officially do not support this behavior "Unfortunately, that is not supported at the moment. We are always working to improve our app and will take your suggestion into consideration." (ticket #172349248330585) I have tested ~40 other services, only WhatsApp and Viber do not support their own documentation.
– HoldOffHungerMar 29 at 15:08

I tested this on several devices (Android, iOS, and Windows), and it simply does not work. This was one out of 40 different services I tested personally, and the only one out of two that did not work (the other being Viber). See the list here..

https://github.com/bradvin/social-share-urls#whatsapp

In frustration, I e-mailed the developers at WhatsApp. I showed them their own source :

https://faq.whatsapp.com/en/android/26000030/?category=5245251

I was told, very specifically, THIS FEATURE IS NOT IMPLEMENTED.

"Unfortunately, that is not supported at the moment.
We are always working to improve our app and will take your suggestion into consideration.
request #172349248330585"

In order to test this: (1) Register for a Whatsapp account, (2) Install Whatsapp on your desktop, (3) Install Whatsapp an your phone, (4) Sync your phone and computer, (5) Build and upload a whatsapp share link on your private host, (6) click it in devices mentioned in 2 and 3. (7) Click the link, see that Whatsapp opens, see also that it completely ignores all parameters given to it.

All of these produced failure for Viber and Whatsapp, and positive results for 38 other services (from Google to Skype to Line.me to Facebook, Digg, StumbleUpon, Douban, you name it).

Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).