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 voice messages via WhatsApp. It allows users to send an audio file by specifying the recipient's phone number and the URL of the audio file. This is useful in scenarios where you want to deliver voice notifications, alerts, or personalized voice messages automatically through WhatsApp.

Practical examples include:

  • Sending appointment reminders as voice messages.
  • Delivering customer support updates via voice.
  • Broadcasting voice announcements to clients.

Properties

Name Meaning
Phone Number The recipient's WhatsApp number in international format (e.g., 5511999999999).
External Key A unique key from your system to identify the message externally.
Close Ticket Boolean flag indicating whether to close the related ticket after sending the message.
Audio URL The URL of the audio file to be sent as a voice message.

Output

The node outputs a JSON object containing the response from the WhatsApp API after attempting to send the voice message. This typically includes status information about the message delivery.

No binary data output is produced by this operation.

Example output structure (simplified):

{
  "json": {
    "status": "success",
    "messageId": "abc123",
    "details": { ... }
  },
  "pairedItem": {
    "item": 0
  }
}

Dependencies

  • Requires configuration of an API key credential for the WhatsApp API integration.
  • The node uses the base URL and instance ID from the credentials to construct API requests.
  • The audio file must be accessible via a public URL.

Troubleshooting

  • Common issues:

    • Invalid or inaccessible audio URL: Ensure the audio file URL is publicly accessible and correctly formatted.
    • Incorrect phone number format: Use the international format without symbols or spaces (e.g., 5511999999999).
    • Missing or invalid API credentials: Verify that the API key and instance ID are correctly configured in n8n credentials.
    • Network or API errors: Check connectivity and API service status.
  • Error messages:

    • "Unknown error occurred": Generic catch-all; check detailed logs or API response for specifics.
    • Authentication failures: Confirm API credentials validity.
    • Validation errors from API: Review input parameters for correctness.

Links and References

Discussion