diff --git a/docs/site/content/en/docs/how-to/receive-messages/index.md b/docs/site/content/en/docs/how-to/receive-messages/index.md index 144eb64a..c439c1d3 100644 --- a/docs/site/content/en/docs/how-to/receive-messages/index.md +++ b/docs/site/content/en/docs/how-to/receive-messages/index.md @@ -154,8 +154,8 @@ Receive events when server or recipient gets the message, read or played it. ## Files ![](/images/versions/plus.png) -When people send you files - images, voice messages, and documents - WAHA saves it in the file storage. -In your application you must download it and use it as you want to. You can find the URL in `mediaUrl` field +When people send you media - images, voice messages, and documents - WAHA saves it in the file storage. +In your application you must download it and use it as you want to. You can find the URL in `mediaUrl` field. For example, you can get the webhook like this with `mediaUrl` value (we've skipped other fields): @@ -173,6 +173,21 @@ For example, you can get the webhook like this with `mediaUrl` value (we've skip ``` Then you can use the link to download the file `http://localhost:3000/api/files/true_11111111111@c.us_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.jpg`. +For documents (file attachments) there's also `filename` field with the original file name. +```json +{ + "event": "message", + "session": "default", + "payload": { + "id": "true_11111111111@c.us_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "timestamp": 1667561485, + "from": "11111111111@c.us", + "mediaUrl": "http://localhost:3000/api/files/true_11111111111@c.us_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.pdf", + "filename": "some-file.pdf" + } +} +``` + To configure the url you can use environment variables `WHATSAPP_API_HOSTNAME` and `WHATSAPP_API_PORT`. By default, WAHA download all files that the account receive.