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 a previously sent message, deleting messages, downloading media from messages, marking messages as read, reacting to messages with emojis, 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:

  • Updating or correcting a sent message without resending it.
  • Downloading media files shared in chats for further processing or storage.
  • Marking messages as read programmatically to manage notifications.
  • Sending quick emoji reactions to messages.
  • Indicating typing or recording status to improve user experience.

Practical example: Automatically edit a message if some data changes after sending, or download an image sent in a chat to save it externally.

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 (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 Extra optional 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:" for own messages (for React operation).
Phone Number Phone number to set presence for (for Set Presence operation).
State Presence state: Typing (composing) or Not Typing (paused) (for Set Presence operation).
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. The structure varies depending on the operation performed:

  • For Edit Message, Delete Message, Mark as Read, React to Message, and Set Presence operations, the output contains confirmation or status information returned by the API.
  • For Download Media, the output includes the downloaded media data encoded in base64 within a binary property. The binary data contains:
    • data: Base64-encoded media content.
    • mimeType: MIME type of the media.
    • fileExtension: File extension inferred from MIME type.
    • fileName: Suggested filename for the downloaded media.

This allows subsequent nodes to access the media content directly as binary data.

Dependencies

  • Requires an API key credential for authenticating with the Wuzapi WhatsApp API.
  • The node uses an internal helper function to make HTTP POST requests to specific Wuzapi endpoints corresponding to each operation.
  • No additional external dependencies are required beyond the configured API authentication.

Troubleshooting

  • Common issues:

    • Invalid or missing message IDs will cause API errors when attempting to edit, delete, react, or mark messages.
    • Incorrect phone number format may lead to failures in identifying the target message or chat.
    • Missing or incorrect media keys, URLs, or hashes will prevent successful media downloads.
    • Network or authentication errors can occur if the API key is invalid or connectivity is lost.
  • Error messages:

    • Errors returned from the API typically include descriptive messages about what went wrong (e.g., "Message not found", "Invalid media key").
    • If the node is set to continue on fail, error details are included in the output JSON under an error field.
  • Resolution tips:

    • Verify all required parameters are correctly filled and formatted.
    • Ensure the API key credential is valid and has necessary permissions.
    • Check network connectivity and endpoint availability.
    • Use the "continue on fail" option to handle errors gracefully in workflows.

Links and References

Discussion