How can I add an image parameter in the WhatsApp API URL
Asked Answered
H

2

7

Basically I want to send an image and some texts to WhatsApp from my website when the user clicks on the chat with WhatsApp icon

So I want to redirect users from my website to my WhatsApp chat! I know we can add a text parameter to the WhatsApp API URL like this:

https://api.whatsapp.com/send?phone=123456789&text=this is a test

But the fact is I want to add like an image parameter with the text parameter in the URL, for ex like this:

https://api.whatsapp.com/send?phone=123456789&text=this is a test&img=[my-image]
Hyksos answered 16/1, 2021 at 14:54 Comment(3)
You solved it because I am also looking for such an answer ?Sculpture
Any one solve this problemWestney
have you found any solution for this?Numerous
R
0

In my experience you can't do that with the normal whatsapp api. You can either send a text or an image using the text parameter following this link structure:

https://api.whatsapp.com/send?phone=<phone_number>&text=<message>

Phone_number - is the phone number with country code Text - will be either rough text or an image link text.

Depending on the image name you may need to url_encode the image before adding it to your link.

Raid answered 16/4 at 12:49 Comment(0)
P
-2

source_url but your text won't show (it's the text or the image)

Pompeii answered 14/4, 2022 at 15:25 Comment(1)
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.Yield

© 2022 - 2024 — McMap. All rights reserved.