G4 WhatsApp API icon

G4 WhatsApp API

N8N node to interface with salman0ansari baileys rest api

Overview

This n8n node, G4 WhatsApp API, allows you to send messages via the WhatsApp platform using the salman0ansari baileys REST API. The node is designed to facilitate automated WhatsApp messaging workflows, such as sending notifications, alerts, or updates directly to a specified contact number.

Common scenarios:

  • Sending automated text messages to customers or team members.
  • Integrating WhatsApp notifications into business processes (e.g., order confirmations, appointment reminders).
  • Broadcasting information to users via WhatsApp from other systems.

Practical example:
You can use this node in an n8n workflow to send a custom WhatsApp message to a user when a new record is added to your CRM.


Properties

Name Type Meaning
To String The contact number to send the message to.
Message Type Options The type of message to send (e.g., Text Message, Audio Message, Image Message, etc.).
Text Message String The content of the text message. Only required and visible when "Message Type" is "Text Message".

Output

The node outputs a JSON object containing the response from the WhatsApp API after attempting to send the message. The structure of the output will depend on the API's response, but typically includes status information and any relevant data returned by the API.

Example output:

[
  {
    // ...fields returned by the WhatsApp API, such as status, messageId, etc.
  }
]

Dependencies

  • External Service: Requires access to the salman0ansari baileys WhatsApp REST API.
  • API Credentials: You must configure credentials named g4whatsappapi in n8n, which should include:
    • api_url: The base URL of the WhatsApp API service.
    • key: The API key for authentication.

Troubleshooting

Common issues:

  • Invalid credentials: If the API key or URL is incorrect, the node may return authentication errors.
  • Incorrect phone number format: Ensure the "To" field contains a valid WhatsApp contact number.
  • Missing required fields: If "Text Message" is empty when "Message Type" is set to "Text Message", the node will not function as expected.

Possible error messages:

  • "401 Unauthorized": Check your API key and URL in the credentials.
  • "400 Bad Request": Verify that all required fields are filled and formatted correctly.
  • "Network Error": Ensure the API endpoint is reachable from your n8n instance.

Links and References

Discussion