How to Send Media Files with WhatsApp Business API
ฝัง
- เผยแพร่เมื่อ 27 ก.ค. 2024
- Do you want to send images, documents, audio files or videos using the WhatsApp Business API? In this video I show you how to do it! You're going to learn how to do it using Postman, but also how do it using your favorite programming language such as PHP, Javascript, Python, Ruby, among others.
➡️ Try Wasapi for 7 days at no cost at» bit.ly/45mTqcb
➡️ NEW: If you want to send & receive WhatsApp messages EASILY, without all the technical knowledge required here, check out this NEW video: bit.ly/sendReceiveWasapi
➡️ If you want information about the course (From Zero to Expert in the WhatsApp API), CLICK HERE » bit.ly/cursoApiWhatsApp
This is the fifth video of the video series in which we explore in detail the new Meta WhatsApp Business API to automate marketing operations, communicate with users and customers, among other things!
If you want to watch the entire playlist follow this link: • WhatsApp Business API
Links:
- API Documentation: / cloud-api
- Developer Account: developers.
- Glitch: glitch.com/
- Postman: www.postman.com/
Chapters:
0:00 Intro
1:01 Sending images with the API
8:26 Sending PDF documents with the API
10:35 Sending audio and video with the API
11:36 Generating code with Postman
13:15 Using WhatsApp API with PHP
14:50 Using Javascript and other languages
15:17 Next Steps
➡ NEW: If you want to send & receive WhatsApp messages EASILY, without all the technical knowledge required here, check out this NEW video: bit.ly/sendReceiveWasapi
Congrats buddy! You helped me a lot!
congrats dude🤝It was very helpful for me a lot
dude, do you know how to get list of values in whatsapp business API
Nice, thank you
For those who have the problem that can't send images and documents. What I did was send a message from the client side to the business account, then I was able to send images. Apparently to send multimedia content, the client must respond before (at least once).
Thank you I was searching for long just found your😂😅
Thanks a bunch. great work. I love to ask; How about how to send multiple images at once using the endpoint?
greate man !!!!
Man, u mentioned that is necessary that the recepient number write back in order to be allow from the API standpoint to send custom text, image, video and so on. Is there any documentation where that behaviour is explained?
como le hago si quiero adjuntar un archivo desde mi computadora local y no desde un link?
hello! How can I generate media_id for an audio file? Thank you!☺
Thanks dude its very useful for me .
Is there any possible way to send documents without recipient reply ?
Hey Juan or anyone reading this,
I wanted to know how to get the picture in picture mode for a TH-cam video link sent in a message through WhatsApp API or even whether that is possible.
This p-i-p does happen while sending messages through normal WhatsApp but not when u send it from a WhatsApp Business API.
Hoping for some help!
Hi, is it a must to use the URL? What if I have a local audio filepath. How can I use the WhatsApp API to send the message to the user?
amazing content, can you explain how to get (receive) reply message (whatsapp cloud api) and print to my webpage
No encontre en la docu de whatsapp la parte de subir archivos que no sean imagenes
@VinixCode how can i send pdf document as header of a template message?
Hello,
while sending the document pdf file from aws s3 objectUrl to WhatsApp Meta API's. It converts the pdf file to encrypted binary file format automatically, but I want to send it normally in pdf file format, please provide a solution.
Thank you!
do you know how to send TH-cam video url ended with mp4?
How to send and open view once media and voice messages using cloud API?
how to send a video message -> you didn't cover it, struggling with finding the correct payload! Help !
Does WAB API support forwarding? Or can it be coded for it?
hi your vedio is awesome..it is very useful for me thanks...how to start and build our own whatsapp chat bot.
This is something that we will be covering in future videos!
How to check whether the user has confirmed receiving messages ? I was thinking to send a welcome message first and then send the pdf file.
Hii ...
I'm unable to send the messages through WhatsApp API, it's says 'sending message failed', an unexpected error '
Hi Great work. When I used postman to call the API, it throws:
{
"error": {
"message": "(#100) Invalid parameter",
"type": "OAuthException",
"code": 100,
"error_data": {
"messaging_produc t": "whatsapp",
"details": "Parameter Invalid"
},
"error_subcode": 2494010,
"fbtrace_id": "AMpEzMHlMd-F2ll2NMiqZui"
}
}
Could you help me fix the problem? Thanks
I would like to send 10 different message to 10 receipts, Can i send them in 1 single request API instead of 10 request API ?
Hey. It was very helpful video to me. Though there is one point for which I need more details. Can you please show how to create that Fb APP as well?
Hey Keyur, we have a video covering that topic! th-cam.com/video/ul_9qe_fiTY/w-d-xo.html
Hi great work, one can easily follow... Have you made a tutorial on automatic responses based on replies from users? Previously I built a chatbot with twillio and python and I would just insert the webhook url in twillio settings and everything was going well. can the same be done with cloud api? I want to use the already done script as it links perfectly with the Postgres database.
Neemiah, it is indeed possible to build a chatbot with this new API! You can use a solution like Twilio or Dialogflow, or even write your write your own chatbot if you want to. For that, you do need to set up a webhook, as it will be the one that processes all the alerts and messages from WhatsApp.
@@VinixCode Yes, I tried to reuse the code I used with Twilio and inserted the webhook but did not succeed, that is why I wondered if you made a tutorial on that, so I can see where I went wrong
Note, you need to reply to template message or press Continue before you can receive next message, i.e image message.
hello when i try to send pdf .i receive html file in WhatsApp can you help me
Anyone knows how to read a voice note that we receive ?
I can't find that anywhere
Muy buenas quisiera que me ayudes con una duda, mencionabas en un video que WhatsApp te cobra por conversación, que pasa si yo empiezo la conversación con alguien por Whatsapp sin necesidad de usar la api. De igual manera contara como una conversación a cobrar?
Dante, y cómo iniciarías la conversación sin usar la API? Te pregunto, porque el número de teléfono que uses para la API, no puede ser usado en la aplicación móvil de WhatsApp y viceversa.
Great explanation, but i have a question what is the use of their "POST /PHONE_NUMBER_ID/media" end point if we can send file as urls?
This endpoint is used to upload local files instead of using a URL.
@@VinixCode I asked because i saw media templates with urls only, but i just checked that they support sending medias with urls and ids as messages not templates. Thank you so much for your effort.
Trying to send a pdf i am receiving the file as null.bin any solution?
Hello my friend, this video helped me a lot, now I can send any document thanks to you, thank you, but I need to understand why it is only possible to receive the document via API only when the contact says hi first?
You mean send a document or receive a document? You can use template messages to send messages to anybody, but to send regular messages you first need to get a reply back from the user. That's essentially the way in which that person authorizes the reception of messages from you.
Hi,
I want to use WhatsApp cloud API in my laravel App and send the same message to multiple users. How can I set the 'Recipient-Phone-Number' number dynamically?
Aksh, just store the names in a variable or retrieve the data from the database, and use a loop to send each message.
Hi! how can i achieve this in php
How to send from Local File i.e. d:\ pdf file instead of Link
thank you so much you helped me a lot , but can send a document first, like start the conversation with a document, if that is impossible can you make a template that can send a document to initiate the conversation
Mohamed, yes. You can simply create a message template that sends a document in the header and use that to initiate the conversation.
@@VinixCode sorry to bother you , can you send like two documents in one template or let me say can you send multiply documents in one postman request or one template , i search it a lot still can’t find it please help me .
@@mohamedkunle528 No, you can't but you can send 2 messages with each file.
Hi, I would like to send a Video and Message Body content as single message without using template. Is it possible ?
It is possible to do this, but you cannot do it if you're starting a conversation. To initiate a conversation you always have to use a template.
Hey bro thanks for great content. How to receive Messages for Business API and how can I fetch them. Please help
Priyank, that's exactly the next video that we'll be uploading this Monday. Stay tuned.
Tengo una consulta. Envio una imagen, la respuesta es 200 sin problema, pero la imagen nunca llega. Sigo al pie la petición. Cual puede ser el problema? Deberé activar algo mas de la app que no hago?. Los mensajes de texto plano son los únicos que llegan correctamente
Esteban, la respuesta 200 solo significa que la petición fue procesada exitosamente, no que el mensaje fue enviado. Para saber si el mensaje fue enviado o no, debes leer la información que te envían por los Webhooks. En este video explicamos todo este tema: th-cam.com/video/41_4Q5NApTw/w-d-xo.html
hello, how can i sent documment on local (not using from external link) with WAB API?
Tias, using the Media API: developers.facebook.com/docs/whatsapp/cloud-api/reference/media
1. Upload the file (POST /PHONE_NUMBER_ID/media)
2. Send the message and pass the media ID in the payload.
Hey, is there a way to send caption along with the image. This is a reply to a message, and thus not using a template
Yes. You can pass the 'caption' attribute in the payload, along with the 'link' attribute.
Is it possible at the first time of starting conversation to send a media file?
Yes. If you use a message template with a media file in the header.
Thank you for your Video
I try To send massages text it's done
but when i change the code to send File not working
the result show me ok but i didn't receive
Should I make a real account and not a demo but the text i received only photo or document
please help me
You need to use WhatsApp's webhooks to know whether your message was delivered or not. We cover all of that in this video: th-cam.com/video/UvE5G2oTjdM/w-d-xo.html
Hello!
Do you know why I get the correct 200 response but I don't receive the image? I've already chatted with this user before and I'm still using the test number provided by whatsapp
We covered that topic in this video: th-cam.com/video/UvE5G2oTjdM/w-d-xo.html
Basically a 200 response doesn't mean that the message was sent. It only means that WhatsApp received your request, but they then notify you via webhooks whether the messages was delivered or not.
hey Juan, can I send a pdf document to a customer via our WhatsApp business directly without sending a welcome text message at first or even if I did send a welcome text message and the customer not replying to it with anything? I mean is it possible?
Yes. Just create a message template that uses a document as a header, and send that one instead of the hello world template.
@@VinixCode thanks Juan👍
el acento haciendo de las suyas 😅
How to get media id???
nice tip there the user has to text me first...thanks
Unless you start the conversation using a message template.
Delicious, can also show me how to send image to whatsapp using HTML
Hey Jagadish, not sure what you mean by sending an email using HTML...
@@VinixCode so far you hav sent only text message from html to whatsapp , but I want to send image as well
I cannot send localhost pdf to whatsapp ... the file needs to be hosted on a real server , right?
That’s right, you need to use a real server or a tunnel such as ngrok.
Can I send an attachment from google drive, not a link original file like pdf or image
Gajendra, that should work but only if it's a public link. Give it a try.
@@VinixCode I changed the drive file sharing setting as "Anyone with link", but it didn't work. Also google drive have removed the option to share with 'Anyone on web'. I've a hunch that only indexed links work with these API, but not sure. If you could try sending a PDF file from google drive and revert on this comment, that would be great, Cheers!
Hi
Can I send bulk message to customers。
Yes, here's how to do it! th-cam.com/video/PVFDQeVyeQw/w-d-xo.html
How can I send a pdf from my local folder by using the path of the file?
Joy, we'll be covering that topic in our next video. Stay tuned.
hy did you find a way to send a pdf from local folder ??
@@VinixCode Hi, which video include this now ?
can we send file link as php url?
Tirumani, yes you can. Just make sure that this PHP script sets the correct http headers such as "Content-Type: image/jpeg" for a JPG image, and such.
Bro, do you know how to get files sent by users?
I do know, Daniel. Will cover that topic in one of our next videos!
Hola cómo envío un mensaje a un grupo ya creado ?
Josman, no se puede enviar mensajes a grupos con la API de WhatsApp
Hello can you send multiple Files at once? So i want to send 10 files, can I send 10 all at once?
No, it's not possible.
in my case no error show same response as your but document and file not receiving.only text message receive.can you help me what is the problem?
Make sure you're sending a file with the correct formats.
@@VinixCode format is correct it show same response
@@VinixCode my templates are also rejecting.with unkown error please guide me..are they accept to send invoices on whatsapp?
Read my solution in the comments section
Important quest: how to send HIGH definition images using whatsapp cloud api ! ?
How to interact(send and receive and replay) with people Using WhatsApp Business API
Muhammed, there’s another video about it in this channel.
Is this api is free
Yeap man ? They have the test account that is enough to create an app