Officially Send WhatsApp message using webpage (html)

If you are an Android App developer you can make use of implicit Intents to share a message via WhatsApp Application.

WhatsApp share Snippet
Intent sendToWhatsAppIntent = new Intent();
sendToWhatsAppIntent.putExtra(Intent.EXTRA_TEXT, "This message would be shared via WhatsApp.");

But if you are not an Android Java Native App developer and still want to integrate WhatsApp with your App or Website, it is now officially possible to share a message using HTML code to WhatsApp contacts, i.e. with your Website.

WhatsApp provides a custom URL (whatsapp://send?text=) to send a message with WhatsApp :

Any website can now send text messages to the WhatsApp chat application. One has to send a pre-filled text message to the custom URL scheme using an anchor tag. Opening Whatsapp://send?text= followed by the text to send, will open WhatsApp. The user can now choose a contact, and pre-fill the input field with the specified text.

Example: How to achieve this :
<title>Send Message from Wesite to WhatsApp</title>
<a href="whatsapp://send?text=Message!">
Send Message to a Contact Via WhatsApp.</a>

Note: As the text message is sent as a Query String, do not forget to make the text URL encoded (example text="hello%20there!"). Also, note that this functionality may not work on webpages accessed from desktops (the page has to be accessed through an Android device having WhatsApp application installed on it)

Hope you find this information useful: read more on WhatsApp official page:

Hashtags : #Android #WhatsApp #Integration
Try Out Code2care Dev Tools:


Code2care is an initiative to publish and share varied knowledge in programming and technical areas gathered during day-to-day learnings and development activities.

Students and software developers can leverage this portal to find solutions to their various queries without re-inventing the wheel by referring to our easy to understand posts. Technical posts might include learnings, tutorials, trouble-shooting steps, video tutorials, code snippets, how-to, blogs, articles, etc.

🎉 We are celebrating the 10th years of Code2care! Thank you for all your support!

We strongly support Gender Equality & Diversity.