17

I placed a button on my website with a link for people to share articles on Whatsapp. The code is this and works fine:

<a href="whatsapp://send?text=Hello%20World!">Hello, world!</a>

But this doesn't work on the desktop version. Does anybody know the url to share text/link on the Whatsapp Web? This here: https://web.whatsapp.com

Dan Cortazio
  • 171
  • 1
  • 1
  • 5

4 Answers4

26

Note: To create a link with a pre-filled message, use this link (works only for the Whatsapp web version!)

Example:

<a href="https://web.whatsapp.com/send?text=textToshare" target="_blank">Share via Whatsapp</a>

Note: you can use this link which includes a pre-filled message which will automatically appear in a chat text field (works for all platforms!)

Example:

<a href="https://api.whatsapp.com/send?text=textToshare" target="_blank">Share via Whatsapp API</a>

https://api.whatsapp.com/send?text=textToshare

brasofilo
  • 25,496
  • 15
  • 91
  • 179
h3t1
  • 1,126
  • 2
  • 18
  • 29
4

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.

Example: https://wa.me/15551234567?text=I%27m+interested+in+your+car+for+sale

To create a link with just a pre-filled message, use https://wa.me/?text=urlencodedtext

Example: https://wa.me/?text=I%27m+inquiring+about+the+apartment+listing After clicking on the link, you will be shown a list of contacts you can send your message to.

h3t1
  • 1,126
  • 2
  • 18
  • 29
Mr B
  • 109
  • 1
  • 5
0
<a href="whatsapp://send?text=The text to share!" data-action="share/whatsapp/share">Share via Whatsapp</a>

Try this..

Shobhit
  • 1,096
  • 11
  • 30
  • 1
    I think your solution is ok in mobile view. For desktop I think you must use the @The Bib Boss solution. For me that solution works fine. – Adrian Apr 16 '18 at 09:26
0

Try this

<a href="https://api.whatsapp.com/send?text=textToshare" target="_blank">Share via Whatsapp</a>

This is new updated API link to share web pages or links to your whatsapp contacts.

Tamizh
  • 3
  • 3