WhatsApp API icon

WhatsApp API

Integração com WhatsApp API para envio de mensagens e gerenciamento

Overview

This node integrates with a WhatsApp API to send messages and manage related entities such as contacts, tickets, sessions, and opportunities. Specifically, the Send Base64 operation under the Message resource allows users to send files encoded in Base64 format via WhatsApp. This is useful when you want to send media files (images, documents, etc.) directly embedded in the message payload without relying on external URLs.

Common scenarios include:

  • Sending images or documents stored in workflows as Base64 strings.
  • Automating customer support by sending receipts, invoices, or other attachments through WhatsApp.
  • Sharing dynamically generated media content without hosting it externally.

Example: You have an image generated in your workflow encoded as Base64, and you want to send it to a customer's WhatsApp number along with a text message describing the file.

Properties

Name Meaning
Phone Number WhatsApp number of the recipient in international format (e.g., 5511999999999).
Message Text Text message to accompany the Base64 file being sent.
External Key Unique key from your system to identify this message transaction.
Close Ticket Boolean flag indicating whether to close the associated ticket after sending the message.
Base64 Data The actual file content encoded as a Base64 string.
MIME Type MIME type of the file (e.g., image/png, application/pdf).
File Name Name of the file as it will appear to the recipient.

Output

The node outputs a JSON object containing the response from the WhatsApp API for each input item processed. The structure typically includes details about the message delivery status or any errors returned by the API.

If the operation succeeds, the output JSON may contain confirmation data such as message IDs or status codes.

No binary data is output by this node; it only returns JSON responses from the API.

Dependencies

  • Requires configuration of an API authentication credential (an API key or token) for the WhatsApp API.
  • The node uses the base URL and instance ID from these credentials to construct API requests.
  • The WhatsApp API endpoint must support the /v2/api/external/{instanceId}/base64 route for sending Base64 encoded files.

Troubleshooting

  • Invalid phone number format: Ensure the phone number is in the correct international format without spaces or special characters (e.g., 5511999999999).
  • Incorrect Base64 encoding: The Base64 data must be properly encoded and complete; otherwise, the API may reject the file.
  • Unsupported MIME type: Verify that the MIME type matches the file content and is supported by the WhatsApp API.
  • API authentication errors: Check that the API credentials are valid and have the necessary permissions.
  • Network or connectivity issues: Confirm that the base URL is reachable and the instance ID is correct.
  • Error messages from API: The node returns error messages in the output JSON if the request fails. Review these messages to adjust parameters accordingly.

Links and References

Discussion