Overview
This node integrates with the SmileAPI WhatsApp service, allowing users to manage WhatsApp instances and send messages programmatically. Specifically, for the Instance - Restart operation, it enables restarting a WhatsApp instance identified by its phone number ID. This can be useful in scenarios where the WhatsApp instance becomes unresponsive or requires a reset without deleting and recreating it.
Practical examples include:
- Automatically restarting an instance after detecting connectivity issues.
- Restarting instances as part of maintenance workflows.
- Triggering restarts remotely via automation when certain error conditions occur.
Properties
| Name | Meaning |
|---|---|
| Phone Number ID | The unique identifier of the WhatsApp instance's phone number to target for the restart. |
| Bearer Token | Your SmileAPI Bearer Token used for authenticating API requests. |
Output
The node outputs JSON data representing the response from the SmileAPI after attempting to restart the instance. This typically includes status information about the restart request, such as success confirmation or error details.
No binary data output is produced by this operation.
Example output structure (simplified):
{
"status": "success",
"message": "Instance restarted successfully",
"instanceId": "5511987654321"
}
Dependencies
- Requires a valid SmileAPI account and an associated API authentication token (Bearer Token).
- The node uses the SmileAPI REST endpoint:
https://api.smileapi.com.br/{username}/v1/{phoneNumberId}/instance/restart. - The username part of the URL is retrieved from stored credentials.
- Proper network access to the SmileAPI service is necessary.
Troubleshooting
Common Issues:
- Invalid or expired Bearer Token causing authentication failures.
- Incorrect Phone Number ID leading to "instance not found" errors.
- Network connectivity problems preventing API calls.
Error Messages:
"Unauthorized"or"Authentication failed": Verify that the Bearer Token is correct and has not expired."Instance not found": Confirm the Phone Number ID is accurate and corresponds to an existing instance.- Timeout or connection errors: Check internet connectivity and firewall settings.
Resolution Tips:
- Regenerate or obtain a fresh Bearer Token if authentication fails.
- Double-check the Phone Number ID input for typos.
- Ensure the SmileAPI service is operational and reachable.
Links and References
- SmileAPI official documentation: https://smileapi.com.br/docs
- SmileAPI WhatsApp API overview: https://smileapi.com.br/whatsapp-api
- n8n documentation on creating custom nodes: https://docs.n8n.io/integrations/creating-nodes/