WSAPI Message

Send and manage WhatsApp messages via WSAPI

Overview

This node enables sending and managing WhatsApp messages through a WSAPI (WhatsApp Service API). It supports various message types including text, links with previews, images, videos, audio, voice notes, documents, contacts, locations, stickers, reactions, and message management actions like editing, deleting, starring, and marking as read.

For the Send Text operation specifically, the node sends a plain text message to a specified WhatsApp recipient or group. This is useful for automating notifications, alerts, customer support messages, or any scenario where you want to programmatically send text messages via WhatsApp.

Practical examples:

  • Sending order confirmation messages to customers.
  • Broadcasting announcements to WhatsApp groups.
  • Replying automatically to user inquiries with predefined text.

Properties

Name Meaning
Recipient WhatsApp ID of the recipient. This can be a phone number with @s.whatsapp.net for individual contacts or @g.us for groups.
Message Text The actual text content of the message to send.
Advanced Options Additional optional settings:
- Mentions Comma-separated list of WhatsApp IDs to mention in the message. These can be referenced in the text as @1234567890.
- Reply To Message ID ID of an existing message to which this message will be a reply.
- Is Forwarded Boolean flag to mark the message as forwarded.
- View Once (Not applicable for Send Text) Option to send media as disappearing (view once).

Output

The output JSON contains the response from the WSAPI after sending the message. It typically includes details about the sent message such as message ID, status, timestamps, and any metadata returned by the API.

No binary data is output for the Send Text operation since it only deals with plain text messages.

Dependencies

  • Requires connection to a WSAPI service that manages WhatsApp messaging.
  • Needs an API key credential and instance identifier configured in n8n credentials for authentication.
  • The node makes HTTP POST requests to the WSAPI endpoints using these credentials.

Troubleshooting

  • Common issues:

    • Invalid recipient format: Ensure the recipient ID includes the correct suffix (@s.whatsapp.net for contacts or @g.us for groups).
    • Missing required fields: Both recipient and message text are mandatory.
    • Authentication errors: Verify that the API key and instance ID credentials are correctly set up.
    • Network or API endpoint errors: Check connectivity and WSAPI service availability.
  • Error messages:

    • Errors returned from the WSAPI will be included in the node output if "Continue On Fail" is enabled.
    • Typical error messages may include invalid recipient, unauthorized access, or malformed request body.
    • Resolving usually involves correcting input parameters or verifying credentials.

Links and References


This summary focuses exclusively on the Message > Send Text operation as requested.

Discussion