Home  »  ArticlesGuidesHow ToProgrammingTechnology   »   Create a Link to Send WhatsApp Message Through HTML

Create a Link to Send WhatsApp Message Through HTML

Every month at least two billion users use WhatsApp to send and receive text, audio, rich media, or video messages for personal or business purposes. To send WhatsApp message is pretty straightforward using the provided mobile app.

If you are a business then you might want to have a more convenient way to have your customers or users interact with you through WhatsApp. That is why businesses are adopting WhatsApp for their business use and why WhatsApp Business with some more features was released.

Back to the guide. Just like we showed you how to send an SMS text message through an HTML link, you can do the same with WhatsApp.

What you Should Have

  • Basic knowledge of HTML & CSS
  • A valid WhatsApp account
  • Your WhatsApp number’s country code

How to Send WhatsApp Message Through HTML Link

In this example we will be sending a WhatsApp message with the following details:

  1. Phone: +254777123456 Broken down to “+254” as country code and “777123456” as phone number
  2. Initial Message: “Hello

This is what our link looks like:

<a href="https://wa.me/254777123456?text=Hello">Send WhatsApp Message</a>

Let’s Break it Down:

  • https://wa.me/ – This is the short form API endpoint to send the link to.
  • 254 – country code with the ‘+’ omitted
  • 777123456 – phone number
  • Hello – initial text to post as your message

Though the above is the short and most user-friendly way to craft the WhatsApp link, you can even opt to use the long-form access point to the API in the following format:

<a href="https://api.whatsapp.com/send?phone=254777225366&text=Hello">Send WhatsApp Message</a>

Whichever format you choose, the result will be the same. You will be able to let your users click to send you a WhatsApp message on your website, web application, or even mobile app.

Conclusion

This is a custom way to craft a link that will send WhatsApp message through HTML. It is simple and straightforward and follows HTML standards.

Found this article interesting? Follow Brightwhiz on Facebook, Twitter, and YouTube to read and watch more content we post.