WSAPI Message

Send and manage WhatsApp messages via WSAPI

Overview

This node enables sending WhatsApp audio messages via a WSAPI (WhatsApp API) service. It supports sending audio files either by providing a direct URL or by supplying Base64-encoded audio data. The node is useful for automating the delivery of voice notes, music clips, podcasts, or any audio content to individual contacts or groups on WhatsApp.

Practical examples include:

  • Sending recorded customer support voice messages automatically.
  • Broadcasting audio announcements or alerts to WhatsApp groups.
  • Delivering personalized audio greetings or reminders.

Properties

Name Meaning
Recipient WhatsApp ID of the recipient, which can be a phone number with @s.whatsapp.net for individual contacts or a group ID with @g.us for groups.
Audio Source Source type of the audio file to send. Options: URL (provide a direct link to the audio file), Base64 (provide Base64 encoded audio data).
Audio URL URL of the audio file to send. Required if Audio Source is URL. Example: https://example.com/audio.mp3.
Audio Base64 Base64 encoded audio data. Required if Audio Source is Base64.
MIME Type MIME type of the audio file. Options: audio/mpeg, audio/mp4, audio/wav. Default is audio/mpeg.
Advanced Options Collection of optional advanced settings:
- Mentions: Comma-separated list of WhatsApp IDs to mention in the message. Reference them in text as @1234567890@s.whatsapp.net.
- Reply To Message ID: ID of the message this is replying to.
- Is Forwarded: Boolean flag to mark the message as forwarded.
- View Once: Boolean flag to send the audio as disappearing media (view once).

Output

The node outputs JSON data representing the response from the WSAPI after sending the audio message. This typically includes details such as message ID, status, timestamps, and any metadata returned by the API.

No binary data output is produced by this node; it only sends audio messages but does not output audio content itself.

Dependencies

  • Requires an active WSAPI WhatsApp API service connection configured with an API key credential and instance ID.
  • The node uses HTTP requests to communicate with the WSAPI endpoints.
  • Proper network access to the provided audio URLs (if using URL source) must be ensured.
  • The WSAPI service must support the /messages/audio endpoint.

Troubleshooting

  • Invalid Recipient ID: Ensure the recipient WhatsApp ID is correctly formatted with @s.whatsapp.net for contacts or @g.us for groups.
  • Audio File Not Accessible: If using a URL source, verify that the URL is publicly accessible and points directly to a valid audio file.
  • Incorrect MIME Type: Match the MIME type property to the actual audio file format to avoid playback issues.
  • Base64 Data Errors: When using Base64 source, ensure the data is properly encoded without extra characters or line breaks.
  • API Authentication Failures: Confirm that the API key and instance ID credentials are correctly set up and have sufficient permissions.
  • View Once Option: Using the "View Once" option may cause the audio to disappear after one view; use carefully depending on your use case.

Common error messages usually come from the WSAPI service and relate to authentication, invalid parameters, or unsupported media types. Checking the exact API response in the node output helps diagnose these issues.

Links and References

Discussion