WSAPI Message

Send and manage WhatsApp messages via WSAPI

Overview

This node enables sending WhatsApp messages using the WSAPI service, specifically focusing on sending contact cards in this context. It allows users to send contact information either as a simple display name or as a detailed vCard string to a specified WhatsApp recipient (individual or group). This is useful for automating sharing of contact details within WhatsApp conversations, such as sending business cards, personal contacts, or any other contact info.

Practical examples include:

  • Automatically sending a new employee's contact card to a team group.
  • Sharing customer support contact details with clients.
  • Broadcasting event organizer contacts to attendees.

Properties

Name Meaning
Recipient WhatsApp ID of the recipient (phone number with @s.whatsapp.net for contacts, or group ID with @g.us for groups)
Contact Type How to specify the contact information: either by "Display Name" or by providing a raw "vCard" string.
Display Name The display name for the contact (used if Contact Type is "Display Name").
vCard Data Raw vCard string representing the contact details (used if Contact Type is "vCard").
Advanced Options Additional optional settings:
- Mentions: Comma-separated WhatsApp IDs to mention in the message.
- Reply To Message ID: ID of the message this is replying to.
- Is Forwarded: Mark the message as forwarded.

Output

The node outputs JSON data representing the response from the WSAPI after sending the contact message. This typically includes metadata about the sent message such as message ID, status, timestamps, and any error information if applicable.

No binary data output is involved for this operation.

Dependencies

  • Requires an API key credential and instance ID for authenticating with the WSAPI WhatsApp messaging service.
  • The node makes HTTP POST requests to the WSAPI endpoints to send messages.
  • Proper configuration of the WSAPI credentials in n8n is necessary.

Troubleshooting

  • Common issues:

    • Invalid or missing recipient WhatsApp ID format (must include @s.whatsapp.net or @g.us).
    • Incorrect or malformed vCard string when using the vCard contact type.
    • Missing required fields like Display Name or vCard data depending on the selected contact type.
    • Authentication errors due to invalid or expired API keys or instance IDs.
  • Error messages:

    • Errors returned from the WSAPI will be included in the node output if the request fails.
    • Typical errors may indicate invalid parameters, unauthorized access, or network issues.
  • Resolutions:

    • Verify the recipient ID format.
    • Ensure the vCard string complies with vCard standards.
    • Check that all required properties are provided.
    • Confirm WSAPI credentials are correctly set up and valid.

Links and References

Discussion