MegaAPI icon

MegaAPI

Interact with MegaAPI WhatsApp service

Overview

This node operation sends a media file from a publicly accessible URL to a specified WhatsApp group. It is useful for automating the distribution of documents, images, audio, video, or voice messages directly into group chats on WhatsApp without manual intervention. Typical use cases include sharing reports, promotional materials, event photos, or voice announcements with multiple recipients simultaneously.

For example, a marketing team could automatically send a PDF brochure link to their customer group, or a project manager might share an image or video update with the project’s WhatsApp group.

Properties

Name Meaning
Group JID The unique identifier of the WhatsApp group to which the media will be sent. Format: group_id@g.us (e.g., 123456789545@g.us). Must be a group where the sender is a member.
Media URL The direct URL of the media file to send. This URL must be publicly accessible so WhatsApp can fetch the file.
File Name The name that the media file will have when displayed in WhatsApp (e.g., example.pdf).
Media Type The type of media being sent. Options include: Audio, Document, Image, PTT (voice message), Video.
MIME Type The MIME type corresponding to the media file format. Examples: application/pdf for PDFs, image/jpeg for JPEG images, video/mp4 for MP4 videos, etc.
Caption Optional text caption to accompany the media file in the WhatsApp group message.

Output

The node outputs JSON data containing details about the sent message, including:

  • Message status (e.g., sent, delivered)
  • Message ID assigned by WhatsApp
  • Delivery confirmation information

If the operation succeeds, this output confirms that the media was successfully sent to the group and provides identifiers for tracking or further processing.

The node does not output binary data; it only handles sending media via URL and returns metadata about the message.

Dependencies

  • Requires a valid WhatsApp API service connection configured with an API key or token.
  • The WhatsApp instance must be authenticated and authorized to send messages to the target group.
  • The media URL must be publicly accessible without authentication.
  • The user must be a member of the WhatsApp group identified by the Group JID.

Troubleshooting

  • Common issues:

    • Invalid or incorrectly formatted Group JID (must end with @g.us).
    • Media URL is not publicly accessible or requires authentication.
    • Unsupported or mismatched MIME type for the media file.
    • User is not a member of the specified WhatsApp group.
    • Network or API connectivity issues with the WhatsApp service.
  • Error messages:

    • "Unknown group operation: sendMediaUrlGroup": Indicates the operation parameter is incorrect or unsupported.
    • Errors related to authorization typically mean the API credentials are invalid or expired.
    • Media fetching errors usually indicate inaccessible URLs or unsupported media formats.
  • Resolutions:

    • Verify the Group JID format and membership.
    • Ensure the media URL is reachable publicly.
    • Match the MIME type correctly to the media file.
    • Check API credentials and refresh if necessary.
    • Review network connectivity and firewall settings.

Links and References

Discussion