Wuzapi Chat icon

Wuzapi Chat

Perform chat operations with Wuzapi WhatsApp API

Overview

The node "Wuzapi Chat" enables various chat-related operations using the Wuzapi WhatsApp API. It supports actions such as editing messages, deleting messages, downloading media, marking messages as read, reacting to messages, and setting chat presence indicators (like typing or recording).

This node is beneficial in scenarios where automated interaction with WhatsApp chats is needed, for example:

  • Editing a previously sent message to correct information.
  • Downloading media files from received messages for processing or storage.
  • Marking messages as read automatically after processing.
  • Sending emoji reactions to messages programmatically.
  • Indicating typing or recording status to other chat participants.

Practical example: Automatically edit a sent message to update its content based on new data, or download an image sent in a chat to save it locally.

Properties

Name Meaning
Message ID ID of the message to delete (for Delete Message operation).
Message ID ID of the message to edit (for Edit Message operation).
Phone Number Phone number or "me:" prefix indicating your own message (for Edit Message operation).
New Message New content text to replace the original message body (for Edit Message operation).
Media Type Type of media to download: Audio, Document, Image, or Video (for Download Media operation).
Media URL URL of the media file to download (for Download Media operation).
Direct Path Optional direct path to the media file (for Download Media operation).
Media Key Encryption key for the media file (for Download Media operation).
Mime Type MIME type of the media file (e.g., image/jpeg) (for Download Media operation).
File SHA256 SHA256 hash of the media file (for Download Media operation).
File Length Size of the media file in bytes (for Download Media operation).
Additional Fields Optional extra fields for media download, including encrypted file SHA256 and binary property name.
Message IDs Comma-separated list of message IDs to mark as read (for Mark as Read operation).
Chat JID JID of the chat containing the messages (for Mark as Read operation).
Sender JID JID of the message sender (optional for Mark as Read operation).
Phone Number Phone number or "me:" prefix for your own message (for React to Message operation).
Reaction Emoji character(s) to react with; empty to remove reaction (for React to Message operation).
Message ID ID of the message to react to, prefixed with "me:" if it's your own message (for React operation).
Phone Number Phone number to set presence for (for Set Presence operation).
State Presence state to set: Typing (composing) or Not Typing (paused) (for Set Presence).
Media Type Type of media being composed: None or Audio (for Set Presence operation).

Output

The node outputs JSON data representing the response from the Wuzapi WhatsApp API for each operation performed. The structure varies depending on the operation:

  • For Edit Message, Delete Message, Mark as Read, React to Message, and Set Presence operations, the output contains confirmation or status details returned by the API.
  • For Download Media, the node outputs the downloaded media as binary data attached to the item under a binary property (default name "data" or custom name if specified). The binary data includes:
    • data: Base64-encoded media content.
    • mimeType: MIME type of the media.
    • fileExtension: File extension inferred from MIME type.
    • fileName: Generated filename like downloaded-media.<ext>.

This allows subsequent nodes to process or save the media file.

Dependencies

  • Requires an API key credential for authenticating with the Wuzapi WhatsApp API.
  • Uses the internal helper function to make HTTP POST requests to Wuzapi endpoints.
  • No additional external dependencies beyond the configured API credential.

Troubleshooting

  • Common issues:

    • Invalid or missing message IDs will cause API errors when trying to edit, delete, or react to messages.
    • Incorrect phone number format may lead to failures identifying the target message or chat.
    • Missing required parameters for media download (e.g., media key, SHA256 hash) will prevent successful retrieval.
    • Network or authentication errors if the API key is invalid or connectivity issues occur.
  • Error messages:

    • Errors returned from the API are captured and can be output per item if "Continue On Fail" is enabled.
    • Typical error messages include "Message not found", "Invalid media key", or "Unauthorized".
  • Resolutions:

    • Verify all required fields are correctly filled and formatted.
    • Ensure the API key credential is valid and has necessary permissions.
    • Check network connectivity and endpoint availability.
    • Use "Continue On Fail" option to handle partial failures gracefully.

Links and References

Discussion