mand1
mand1

Reputation: 81

Whatsapp Api - How to automatically send pre-filled message which is in the url

To create your own link with a pre-filled message that will automatically appear in the text field of a chat, use https://wa.me/whatsappphonenumber/?text=urlencodedtext where whatsappphonenumber is a full phone number in international format and URL-encodedtext is the URL-encoded pre-filled message.

Example:https://wa.me/15551234567?text=I'm%20interested%20in%20your%20car%20for%20sale

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

or

<a href="https://api.whatsapp.com/send?phone=0123456789&text=I'm%20interested%20in%20your%20services" target="_blank">  Click to WhatsApp Chat</a>

The message in the url shows in the input field of whatsapp message box is there a way so that the message gets posted or sent automatically ? Reason behind it- There will be a icon on the website for whatsap chat anyone who clicks on that icon his message should be automatically send to the website's contact number which is in the url.

Upvotes: 8

Views: 77563

Answers (1)

Satheesh
Satheesh

Reputation: 11276

I was looking at this sometime back and sadly still there is no way to automatically send messages through the client app. It makes sense in a way to prevent spam & misuse. The closest thing is to pre-fill the content and let the user send the message to the desired phone number.

If you are a business you could try the Whatsapp for Business API - https://www.whatsapp.com/business/api to implement chatbot like features and that might fit whatever use case you are looking to build. Anyways it a request only feature for now but you can try the same.

Or if you would want to get wild and try app overlay to auto send the message but Whatsapp prevents app overlay and never lets users proceed to use the app.

Upvotes: 2

Related Questions