21

I have a web application and in that, I am trying to share a link to WhatsApp web application and but not in mobile app.

I have gone through Sharing link for WhatsApp Web version? but no solution is provided.

Is it feasible?

What have I tried till now

<a href="whatsapp://send?text=www.google.com" data-action="share/whatsapp/share">Share via Whatsapp</a>

This code helps me to share it via WhatsApp mobile application. Is there a way to do the same in WhatsApp web application?

Andrew T.
  • 4,637
  • 8
  • 40
  • 60
Raja Dhasan
  • 563
  • 1
  • 5
  • 16

2 Answers2

45

This link - will always open a browser, even if you're in mobile.

<a href="https://web.whatsapp.com/send?text=www.google.com" data-action="share/whatsapp/share">Share via Whatsapp web</a>

But when using the api.whatsapp.com - it will try to first, open the whatsapp mobile application OR whatsapp web on desktops if exists, if not - it will open other suitable app.

<a href="https://api.whatsapp.com/send?text=www.google.com" data-action="share/whatsapp/share">Share via Whatsapp web</a>

So the api worked best for me

Ricky Levi
  • 6,168
  • 1
  • 54
  • 58
  • 1
    Perfect! Thank you – Remco Bravenboer Mar 26 '20 at 15:34
  • As of 2021 October, https://api.whatsapp.com/send?text=www.example.com does not seem to be working anymore? UPDATE: ah there's just no styles so the offer to send the message via web is ¾ down the page, and it doesn't automatically do web. Can anyone confirm it does work automatically on mobile? – mlncn Oct 17 '21 at 01:01
  • How can I share the images as a photo on whats app from the link instead of text or image along with text message – kantsverma Feb 11 '22 at 20:25
  • 1
    @mlncn yes it is working on mobile. – Deep Kakkar Feb 16 '22 at 06:35
21

this work for me

<a href="https://web.whatsapp.com/send?text=www.google.com" data-action="share/whatsapp/share">Share via Whatsapp web</a>
mahmud
  • 241
  • 2
  • 6