Wuzapi Chat icon

Wuzapi Chat

Perform chat operations with Wuzapi WhatsApp API

Overview

This node enables interaction with the Wuzapi WhatsApp API to perform various chat-related operations. Specifically, the "Download Media" operation allows users to download different types of media files (images, videos, audio, documents) from WhatsApp messages by providing necessary metadata and encryption keys.

Common scenarios for this node include:

  • Automatically retrieving media files sent in WhatsApp chats for archival or processing.
  • Integrating WhatsApp media downloads into workflows that require further analysis or storage.
  • Handling encrypted media by supplying required decryption keys and hashes.

For example, a user can input the URL and encryption key of an image sent via WhatsApp, and the node will download and decrypt the image, making it available as binary data for subsequent workflow steps.

Properties

Name Meaning
Media Type Type of media to download. Options: Audio, Document, Image, Video
Media URL URL of the media file to download (required)
Direct Path Optional direct path to the media file
Media Key Encryption key for the media file (required)
Mime Type MIME type of the media file (e.g., image/jpeg) (required)
File SHA256 SHA256 hash of the file for integrity verification (required)
File Length Size of the file in bytes (required)
Additional Fields Collection of optional fields:
- File Enc SHA256 Encrypted file SHA256 hash
- Binary Property Name Name of the binary property where the downloaded media will be stored (default: "data")

Output

The node outputs the downloaded media as binary data attached to the item under a binary property. The name of this binary property defaults to "data" but can be customized via the "Binary Property Name" additional field.

The binary data includes:

  • data: The base64-encoded content of the downloaded media.
  • mimeType: The MIME type of the media (e.g., image/jpeg).
  • fileExtension: The file extension inferred from the MIME type (e.g., jpg, mp4, ogg, pdf).
  • fileName: A generated filename like downloaded-media.jpg.

This structure allows downstream nodes to easily access and process the media file.

Dependencies

  • Requires an active connection to the Wuzapi WhatsApp API service.
  • Needs an API authentication credential configured in n8n to authorize requests.
  • The node depends on correct media metadata inputs such as URLs, encryption keys, and hashes to successfully download and decrypt media.

Troubleshooting

  • Incorrect or missing media metadata: If the URL, media key, SHA256 hashes, or file length are incorrect or missing, the download may fail or produce corrupted output. Verify all required fields carefully.
  • Invalid MIME type: Providing an incorrect MIME type might cause improper file extension assignment or handling issues downstream.
  • API request failures: Network issues or invalid API credentials will result in errors. Ensure the API key is valid and the Wuzapi service is reachable.
  • Base64 decoding errors: If the returned data does not match the expected base64 format, the binary data extraction will fail. This could indicate an issue with the API response or input parameters.

To resolve errors, check the error message details returned by the node, verify all input parameters, and confirm API connectivity.

Links and References

Discussion