23

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,701
  • 8
  • 43
  • 62
Raja Dhasan
  • 583
  • 1
  • 5
  • 16

2 Answers2

51

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
  • 7,298
  • 1
  • 57
  • 65
  • 1
    Perfect! Thank you – Remco Bravenboer Mar 26 '20 at 15:34
  • 1
    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
  • https://api.whatsapp.com/send?text=www.google.com does not work and the url whatsapp://send?text=Hello%2C%20World! open the app if it is installed. Is there any link to open the web app in case the mobile app not installed? – Slim Jul 04 '22 at 13:32
  • @Slim have you found any way to open the web app if the mobile app is not installed yet? – Destiny Franks Jul 25 '22 at 11:34
  • @DestinyFranks I just use this url https://api.whatsapp.com/send?text which will redirect to a page where to choose to download the app to continue or use the web app – Slim Jul 25 '22 at 13:05
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
  • 261
  • 2
  • 6
  • 1
    `web.whatsapp.com` will alway try to open the web. vs `api.whatsapp.com` which finds what's available. if there's an app ( desktop/mobile ) - it will open it instead ... just note. – Ricky Levi Jul 25 '22 at 17:57