Wati icon

Wati

Send WhatsApp messages, manage contacts, deliver templates, and download media via Wati API

Message → Get Media

AI-generated

Summary

Downloads a media file (image, video, document, etc.) from a specified URL and writes it to a binary property in the output item.

Inputs

  • mediaFileUrl (required) — The file URL to download. Can be a public HTTP(S) URL or an API path relative to the Wati base URL. Use {{ $.data }} from a Wati Trigger output.
  • binaryPropertyName — The name of the binary property (e.g., 'data') to write the downloaded file to. Defaults to 'data'.

Output shape

One item per input item, containing a binary property with the file and a JSON object with metadata (fileUrl, fileName, mimeType).

The operation writes the file to a binary property instead of returning a standard JSON payload. It pairs the output item with the input item.

Examples

Example 1: Download an image attached to a WhatsApp message.

Set mediaFileUrl to the message's data field URL (e.g., {{ $.data }}) and binaryPropertyName to 'data'.

Example 2: Download a document using the API path format.

Set mediaFileUrl to a relative API path (e.g., '123456/messages/file/abc123') and binaryPropertyName to 'document'.

Links

Discussion