SmileAPI icon

SmileAPI

Interact with SmileAPI WhatsApp

Actions6

Overview

This node integrates with the SmileAPI WhatsApp service to manage WhatsApp instances and send messages. Specifically, for the Instance - Create operation, it allows users to create a new WhatsApp instance by specifying details such as phone number, app version, authentication method, call handling preferences, and webhook URL.

Common scenarios where this node is beneficial include:

  • Automating the setup of WhatsApp instances for business communication.
  • Quickly provisioning new WhatsApp numbers for customer support or marketing.
  • Integrating WhatsApp messaging capabilities into workflows without manual configuration.

For example, a user can create a WhatsApp instance that automatically rejects incoming calls and sends a custom message when a call is missed, while also setting up a webhook to receive real-time notifications about the instance status.

Properties

Name Meaning
Phone Number The phone number for the WhatsApp instance (e.g., 5511987654321).
App Version WhatsApp application version; currently only "Latest" is supported.
Authentication Method Method to authenticate with WhatsApp; currently only "QR Code" is supported.
Auto Reject Call Boolean flag indicating whether to automatically reject incoming calls.
Answer Missed Call Message Message text sent automatically when a call is missed (default: "Olá, não posso atender ligações no momento").
Webhook URL URL to receive notifications related to the WhatsApp instance (e.g., https://webhook.site/your-unique-url).

Output

The node outputs JSON data representing the response from the SmileAPI after attempting to create the WhatsApp instance. This typically includes details about the newly created instance such as its ID, status, and configuration.

If the API returns a string response, the node attempts to parse it as JSON; if parsing fails, the raw string is returned.

No binary data output is produced by this operation.

Dependencies

  • Requires an API key credential for SmileAPI authentication (referred generically as an API key credential).
  • The node makes HTTP requests to the SmileAPI endpoint at https://api.smileapi.com.br/{username}/v1/instance/add.
  • Proper network connectivity to SmileAPI servers is necessary.
  • The user must have a valid SmileAPI account and associated credentials configured in n8n.

Troubleshooting

  • Common issues:

    • Invalid or missing phone number format may cause API errors.
    • Incorrect or expired API key credential will result in authentication failures.
    • Network connectivity problems can prevent successful API calls.
    • Providing unsupported values for properties like app version or authentication method may cause errors.
  • Error messages:

    • Errors returned from the SmileAPI are passed through and included in the node output if "Continue On Fail" is enabled.
    • Typical error messages relate to authorization failures, invalid parameters, or server errors.
  • Resolution tips:

    • Verify the phone number format matches expected international format without symbols.
    • Ensure the API key credential is correctly set and has required permissions.
    • Check the webhook URL is reachable and properly formatted.
    • Use the latest app version and supported authentication methods as per documentation.

Links and References

  • SmileAPI official website and API documentation (not provided in code, please refer to SmileAPI's public resources).
  • n8n documentation on creating and managing credentials.
  • General WhatsApp Business API guidelines for understanding instance management concepts.

Discussion