I am currently writing a chatbot for WhatsApp. I use the node js and WhatsApp Business API to create my API that send messages to users.

When the client sends a image message, I see the following JSON object in the logs of my application:

{ "object": "whatsapp_business_account", "entry": [ { "id": "116591461526821", "changes": [ { "value": { "messaging_product": "whatsapp", "metadata": { "display_phone_number": "15550383872", "phone_number_id": "107615645766004" }, "contacts": [ { "profile": { "name": "TW🐯" }, "wa_id": "26657963470" } ], "messages": [ { "from": "26657963470", "id": "wamid.HBgLMjY2NTc5NjM0NzAVAgASGCAyQjlFNENGRkFENDk4MkRDQkU4QjVFOTlERUU3RUM4MgA=", "timestamp": "1707306273", "type": "image", "image": { "mime_type": "image/jpeg", "sha256": "iNUQ9GcXEvo/mqx2HYvGYmoX4/sgw3JLLjNe5y3cYHM=", "id": "1549548012254387" } } ] }, "field": "messages" } ] } ] }

can't find any information in the documentation about how to download this file. In my case, I want to upload this image file that the client sends to my file storage. Please tell me which URL method from the WhatsApp API is responsible for this mechanism?

Tag:node.js, express

Add a new comment.