Send message on whatsapp on whatsapp web using html or javascript

前端 未结 2 1339
旧时难觅i
旧时难觅i 2021-01-20 05:02

I want to send message through whatsapp web.

I am using following code but its not working.. https://wa.me/?text=urlencodedtext

I am unable to see contact l

2条回答
  •  再見小時候
    2021-01-20 05:38

    Try changing the domain from wa.me to api.whatsapp.com, like this...

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

    Then you can have it send whatever text you'd like. You also have the option to specify a phone number...

    https://api.whatsapp.com/send?text=text&phone=1234
    

    Unfortunately, it seems that wa.me currently only works when you specify BOTH a phone number AND a message, like so:

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

    If you don't know the phone number, or don't like that parameter, please use the api.whatsapp.com format.

    October, 2020 Update: wa.me was partially fixed. However, unlike api.whatsapp.com, it will not show an image preview of the site's og:image tags. So, keep using api.whatsapp.com as suggested above.

提交回复
热议问题