user1697114
user1697114

Reputation: 689

Send message on WhatsApp on Web using HTML or JavaScript

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 list to send this encoded message. I took reference from: WhatsApp.comHow to use click to chat

Upvotes: 3

Views: 7388

Answers (1)

HoldOffHunger
HoldOffHunger

Reputation: 20861

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.

Upvotes: 4

Related Questions