MegaAPI icon

MegaAPI

Interact with MegaAPI WhatsApp service

Overview

This node operation allows you to download media content from a WhatsApp message using the MegaAPI WhatsApp service. It is useful when you want to retrieve and save media files such as images, audio, video, or documents that were sent or received in WhatsApp chats.

Common scenarios include:

  • Archiving media files shared in WhatsApp conversations.
  • Processing or analyzing media content received via WhatsApp.
  • Integrating WhatsApp media downloads into automated workflows for backup or further distribution.

For example, you can use this node to download an image sent in a WhatsApp chat by providing the media key, direct path, URL, mimetype, and specifying the message type as "Image".

Properties

Name Meaning
Media Key The media key associated with the WhatsApp message's media content.
Direct Path The direct path to the media file on the WhatsApp server.
URL The URL from which the media content can be downloaded.
Mimetype The MIME type of the media file (e.g., image/jpeg, audio/mp3, video/mp4, application/pdf).
Message Type The type of media message to download. Options: Image, Audio, Video, Document.
Information A notice indicating that this operation downloads media content from a WhatsApp message.

Output

The output JSON contains the downloaded media content information. Typically, it includes metadata about the media and the actual media data encoded appropriately (e.g., base64). If the node supports binary data output, the media file will be available in the binary property of the output item, allowing subsequent nodes to process or save the media file directly.

Dependencies

  • Requires an active connection to the MegaAPI WhatsApp service.
  • Needs valid API credentials (an API key/token) configured in n8n to authenticate requests.
  • The node uses the MegaAPI endpoint specified in the credentials to perform media downloads.

Troubleshooting

  • Invalid Media Key or Direct Path: If the media key or direct path is incorrect or expired, the download will fail. Verify these values are correct and current.
  • Authentication Errors: Ensure that the API token provided in the credentials is valid and has not expired.
  • Unsupported MIME Type: Providing an incorrect or unsupported mimetype may cause issues in processing the media. Use standard MIME types.
  • Network Issues: Connectivity problems to the MegaAPI service or WhatsApp servers can cause timeouts or failures.
  • Error Messages: The node throws errors if unknown operations or resources are specified. Make sure to select the correct resource ("Instance") and operation ("Download Media Message").

To resolve errors, check the input parameters carefully, verify credentials, and ensure network connectivity.

Links and References

Discussion