Web link to specific whatsapp contact

后端 未结 13 1887
青春惊慌失措
青春惊慌失措 2020-12-07 08:00

I\'d like to place a link on a webpage which opens a whatsapp chat with a certain whatsapp contact. In other words: I want a \"contact me by whatsapp\" link to go next to th

相关标签:
13条回答
  • 2020-12-07 08:44

    Official WhatsApp doc Says-:

    https://api.whatsapp.com/send?phone=countrycode+phonenumber

    Use: https://api.whatsapp.com/send?phone=15551234567

    Don't use: https://api.whatsapp.com/send?phone=+001-(555)1234567

    https://faq.whatsapp.com/en/general/26000030

    0 讨论(0)
  • 2020-12-07 08:45

    You can now use a very simple API https://wa.me/ to perform this task where you can provide a valid whatsapp contact number like 15555555555 ( add country code, remove all '+', '-', brackets, spaces or leading zeros). You can also provide a urlencoded text as a predefined msg which user can send directly or change before sending.

    Chat with me link : <a href="https://wa.me/15555555555">Contact me by whatsapp</a>

    Chat with me link with predefined text : <a href="https://wa.me/15555555555?text=I%27d%20like%20to%20chat%20with%20you">Contact me on whatsapp</a>

    Beauty of this wa.me url is you don't need to check user agent as it works on both mobile and desktop (opens web.whatsapp.com)


    Source : https://faq.whatsapp.com/en/general/26000030

    More details in my answer on a similar question https://stackoverflow.com/a/51854282/2485420

    0 讨论(0)
  • 2020-12-07 08:50

    This approach only works on Android AND if you have the number on your contact list. If you don't have it, Android opens your SMS app, so you can invite the contact to use Whatsapp.

    <a href="https://api.whatsapp.com/send?phone=2567xxxxxxxxx" method="get" target="_blank"><i class="fa fa-whatsapp"></i></a>
    

    Google Chrome am targeting a blank window

    0 讨论(0)
  • 2020-12-07 08:55

    You can use the following URL as per the WhatsApp FAQ:

    https://wa.me/PHONENUMBERHERE

    Add the country code in front of the number and don't add any plus (+) sign or any dashes (-) or any other characters in the number. Only integrers/numeric values.

    You can also predefine a text message to start with:

    https://wa.me/PHONENUMBERHERE/?text=urlencodedtext

    0 讨论(0)
  • 2020-12-07 08:55

    Phone Number will be a country code followed by WhatsApp mobile number without any symbol. Please refer below code.

    <a href="https://api.whatsapp.com/send?phone=19998887878&text=Hi%20There!">WhatsApp Now</a>
    
    0 讨论(0)
  • 2020-12-07 08:57

    I've tried this:

    <a href="whatsapp://send?abid=phonenumber&text=Hello%2C%20World!">whatsapp</a>
    

    changing 'phonenumber' into a specific phonenumber. This doesn't work completely, but when they click on the link it does open whatsapp and if they click on a contact the message is filled in.

    If you want to open a specific person in chat you can, but without text filled in.

    <a href="intent://send/phonenumber#Intent;scheme=smsto;package=com.whatsapp;action=android.intent.action.SENDTO;end">test</a>
    

    You'll probably have to make a choice between the two.

    some links to help you Sharing link on WhatsApp from mobile website (not application) for Android https://www.whatsapp.com/faq/nl/android/28000012

    Hope this helps

    (I tested this with google chrome on an android phone)

    0 讨论(0)
提交回复
热议问题