WasenderAPI icon

WasenderAPI

Manage WasenderAPI sessions, messages, contacts, and groups

Message → Send Document

AI-generated

Overview

This node operation sends a document message via the WasenderAPI. It allows users to specify the recipient, document URL, optional file name, and additional message options such as replying to a specific message or mentioning group members. This operation is useful for automating the sending of documents like PDFs, reports, or any file accessible via a URL to individual contacts, groups, or channels on WhatsApp.

Use Case Examples

  1. Sending a PDF report to a client by specifying their phone number as the recipient and providing the document URL.
  2. Sharing a contract document with a WhatsApp group by using the group's JID as the recipient and optionally mentioning specific participants.

Properties

Name Meaning
Session Select or specify the WhatsApp session to use for sending the document. This can be chosen from a list or by ID, or automatically selected from incoming data.
Recipient The phone number, group JID, or channel JID to which the document will be sent. This is a required field.
Document URL The URL of the document to be sent. This must be a valid URL pointing to the document file and is required.
File Name Optional file name to use for the document when sending. This helps the recipient identify the file.
Message Options Additional options for the message, such as replying to a specific message ID.
Mentions Used for group messages to mention specific members by their participant JIDs.
Options Request options for retrying failed API requests, including whether to retry and the maximum number of retries.

Output

JSON

  • to - The recipient identifier (phone number, group JID, or channel JID) to whom the document was sent.
  • documentUrl - The URL of the document that was sent.
  • fileName - The file name used for the document, if provided.
  • replyTo - The message ID this document message is replying to, if specified.
  • mentions - List of participant JIDs mentioned in the message, if any.
  • status - The status or response from the WasenderAPI after sending the document message.

Dependencies

  • WasenderAPI service with an API key credential

Troubleshooting

  • Ensure the session ID is correctly specified or available in the incoming data; otherwise, the node will throw an error indicating a session is required.
  • The 'Document URL' must be a valid and accessible URL; otherwise, the API request to send the document will fail.
  • If replying to a message, the 'Reply To Message ID' must be a positive integer; invalid values will cause an error.
  • For group messages with mentions, ensure participant JIDs are correctly formatted to avoid message sending issues.

Discussion