MegaAPI icon

MegaAPI

Interact with MegaAPI WhatsApp service

Message → Send Media URL

AI-generated

Overview

This node operation sends a media file from a specified URL to a WhatsApp contact. It downloads the media from the provided URL and sends it as the selected media type (e.g., audio, document, image, video) with an optional caption. This is useful for automating the sending of various media files to WhatsApp contacts without manually downloading and uploading files.

Use Case Examples

  1. Sending a PDF document to a client by providing the document URL and specifying the file name and MIME type.
  2. Sending an image from a URL to a WhatsApp contact with a caption describing the image.

Properties

Name Meaning
To (Contact) The WhatsApp contact to send the media to, formatted as phone_number@s.whatsapp.net.
Media URL The URL of the media file to send.
File Name The name of the file as it will appear in WhatsApp.
Media Type The type of media to send, such as audio, document, image, PTT (voice message), or video.
MIME Type The MIME type of the media file, indicating the file format (e.g., application/pdf, image/jpeg).
Caption Optional caption text to accompany the media file.

Output

JSON

  • messageId - The unique identifier of the sent message.
  • status - The status of the message sending operation (e.g., sent, failed).
  • to - The WhatsApp contact to whom the media was sent.
  • fileName - The name of the sent media file.
  • type - The type of media sent (audio, document, image, ptt, video).
  • mimeType - The MIME type of the sent media file.
  • caption - The caption text sent with the media, if any.

Dependencies

  • Requires an API key credential for MegaAPI WhatsApp service to authenticate requests.

Troubleshooting

  • Ensure the 'To' contact is correctly formatted as phone_number@s.whatsapp.net.
  • Verify the media URL is accessible and points to a valid media file.
  • Check that the MIME type matches the actual media file format to avoid sending errors.
  • If the node throws an 'Unknown message operation' error, confirm the operation is set to 'Send Media URL'.
  • Network issues or API authentication failures may cause message sending to fail; verify credentials and network connectivity.

Discussion