10

Is it possible to create link to chat for whatsapp on desktop and specify number which doesn't exist in contact list?

<a href="whatsapp://send?phone=phoneNumber=">whatsapp</a>

This implementation works fine for mobile(doesn't matter number exists in your contact list or not), but for desktop in doesn't work if there are no such contact in your contact list and as a result I got a pop-up window with message 'Phone number shared via url is invalid'

Vlad
  • 279
  • 1
  • 3
  • 12

8 Answers8

10

yes, this is possible, but you need to :

  1. Specify the text or/and link For opening contact list, on zap, just set the content as text . whatsapp://send?text=http://www.yoursite.com

  2. Specify the zapzap telenumber for sending directly to contact . whatsapp://send?phone=5531920095096&text=http://www.yoursite.com

  3. You can also use the zapzap oficial page. This takes 2 steps : https://api.whatsapp.com/send?phone=5531920095096&text=Hello

Remember that, all content on text variable must be a encoded string, and also that phone number have no spaces, or characters, also country code have not +

This is a nice feature, works very well. You can use (3) option and create a "goo.gl" url, and for options (1) and (2) you can trigger on a website, or app .

Actually, i'm trying to find some way to make whatsapp:// open in whatsapp desktop instead of asking for choose app from microsoft appstore, because now, its not opening it anymore, i dont know why, this used to work .

By the way, if you are a spammer .. don't even try anything, or we will catch you and all your fake numbers or profiles .

This is not for spamming. You have to use broadcast lists .

You can send the phone number so i can check if its correct, or, if you like, i can show you how this can be used, in our classifieds, included one buton for contact each seller, so users have an omnichannel experience .

Contacting advertisers from our site very fast, instead of saving, refreshing and contacting, can click and open zapzap chat .

implementation

If you have a website a customer service phone line, and a zapzap number, you are already a multi-channel business, so this is for seamless cross channel, so users can change from site to zapzap .

Remember that, best soluction for this issue is to use the API Page (3), and that you need to specify text variable all times, because IF you are going to send, you need to send something, and also, there is a "=" character after the phone number variable (at your example) that must be removed .

Please vote this up, because it took a long time to do .

Comment if you have anything to add .

Remember also that this is 2017-2018, and the zap implementation had started some months ago. Please whatsapp, let us opening whatsapp:// protocol from chrome to whatsapp desktop, it was working so nice .. please, it save us so much time, to start a conversation with a number not on contact list, and its working on mobile, just on desktop, that was nice, but since December update, its not running,.. whatsapp pleeeeeeeeeaseeeeee .

UPDATE: As i changed my phone number, i updated the post, because many people arround world contact me saying "thank you" or asking help on something .

David Augustus
  • 420
  • 3
  • 9
  • @mirage, i think its a kind of more related to the operacional system, i think they changed something on the desktop app, so the windows started to look for the windows app to use, as when you open a www link, but canot find the web app of whatsapp. i am using another method, to open it, but that shit stopped working one week after i could do it for first time ............... seems like facebook have pleasure on breaking developers work. I understand that thing maybe could be used to make a huge spam.... but,...... its the same of stop the existence of the internet because of hackers . – David Augustus Jan 22 '19 at 02:12
  • also, it still working on mobile browser, so, seems like a change (and there was a web app of whatsapp some days after i did that for the first time)... also, i changed the updated files with old files of that app, and it worked for about 2 or 3 weeks, then it had again been changed, and today i think............ (need to test) but i think it still buggy. I would be better, if facebook finds methods to block the spam, without breaking the funcionality that developers finds for thieir software demands .. check how Skype deal with skype:// protocol, opening skype .. (i dont use it... no way!) – David Augustus Jan 22 '19 at 02:19
3

Try this:

<body class="" onload="myWhatsappFunction()">

  <a id="whatsapp-btn" class="" target="_blank"> Whatsapp</a>

  <script src="https://cdnjs.cloudflare.com/ajax/libs/mobile-detect/1.4.3/mobile-detect.min.js"></script>

  <script>
    var whatsapp_number = YOUR_PHONE_NUMBER_HERE;

    function myWhatsappFunction() {
      var md = new MobileDetect(window.navigator.userAgent);
      if (md.mobile()) {
        // mobile link
        document.getElementById("whatsapp-btn").href = "https://wa.me/" + whatsapp_number;
      } else {
        // desktop link
        document.getElementById("whatsapp-btn").href = "https://web.whatsapp.com/send?phone=" + whatsapp_number;
      }
    };
  </script>

References:

double-beep
  • 5,031
  • 17
  • 33
  • 41
2

To create your own link to your whatsapp number with a pre-filled message that will automatically appear in the text field of a Whatsapp WEB-chat, you can use: (Dont work on Firefox web browser)

<a href="https://api.whatsapp.com/send?phone=yourwhatsappnumberwithcountrycode&text=hello"</a>

this API promises work on all browsers check it out: https://www.forblink.com/

Sergio Guerjik
  • 476
  • 1
  • 4
  • 12
2

Try to use such link - https://wa.me/"number" where the "number" is a phone number in international format without + or - or dots. So it must look like that: https://wa.me/89273546633

Denis
  • 21
  • 1
2

A possible cause of this error 'Phone number shared via URL is invalid' is that the phone number that you are trying to invoke is not on Whatsapp list, i.e. the number does not receive WhatsApp messages since it might not be registered on WhatsApp. I tried that using several of my phone numbers and the ones not on WhatsApp were throwing this error but those on WhatsApp worked. Guess will save someone from debugging.

Jose Mhlanga
  • 805
  • 12
  • 14
1

I had the same problem in the past week, only links like wa.me/number were working fine on desktop for the past few years.

It seems that WhatsApp’s policy changed. I read advice about updating or accepting the privacy policy "which I don't" but all not correct. I tried different account on new installation and it didn't work.

It does not require the phone to be in your contact list, if you chatted with the number it will work. If there is no previous chat it stopped working a week ago.

kimbo
  • 2,513
  • 1
  • 15
  • 24
Hamed
  • 11
  • 2
0

A very simple solution. I added my country's area code (+44) in-front of the mobile number.

It works for both mobile and desktop.

Sambuxc
  • 425
  • 2
  • 11
  • 26
0

Alternate solution If you have specific numbers to send You cane upload the numbers on Google contact Same email I'd needs to be in mobile

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 27 '22 at 15:16