Actions9
- Bot Actions
- Message Actions
Overview
This node integrates with the Zalo Bot Platform, specifically allowing users to manage bot webhook settings among other bot-related operations. The setWebhook operation configures a webhook URL and secret token for the bot, enabling Zalo to send event notifications (such as incoming messages or user interactions) to the specified HTTPS endpoint.
Common scenarios where this node is beneficial include:
- Setting up or updating the webhook URL to receive real-time events from Zalo.
- Securing webhook communication by specifying a secret token that Zalo includes in request headers for verification.
- Automating bot configuration workflows within n8n without manual API calls.
Practical example:
- A user wants to connect their Zalo bot to an n8n workflow that triggers on inbound messages. They use this node’s
setWebhookoperation to register their n8n webhook URL and provide a secret token for security. Once set, all relevant events will be forwarded to the workflow automatically.
Properties
| Name | Meaning |
|---|---|
| Debug Mode | When enabled, returns the called URL and HTTP status for easier debugging of the API request. |
| Webhook URL | The HTTPS URL where Zalo will send webhook event notifications. Must be a valid HTTPS URL. |
| Secret Token | A required string (8–256 characters). Zalo sends this token in the X-Bot-Api-Secret-Token header with each webhook request for verification. |
Output
The node outputs a JSON array containing the response from the Zalo API after attempting to set the webhook. The structure typically includes:
response: The parsed JSON response from the Zalo API indicating success or failure of the webhook setup.- If debug mode is enabled, additional fields under
debugprovide:url: The full API request URL with sensitive tokens redacted.status: The HTTP status code returned by the API.
No binary data output is produced by this operation.
Example output JSON snippet:
[
{
"response": {
"ok": true,
"message": "Webhook set successfully"
},
"debug": {
"url": "https://bot-api.zapps.me/bot<REDACTED_TOKEN>/setWebhook",
"status": 200
}
}
]
Dependencies
- Requires an API authentication token credential for the Zalo Bot Platform.
- The node makes HTTP requests to the Zalo Bot API endpoint at
https://bot-api.zapps.me. - The webhook URL must be publicly accessible over HTTPS.
- No additional external dependencies beyond standard HTTP client functionality.
Troubleshooting
Common issues:
- Invalid or unreachable webhook URL: Ensure the URL is HTTPS and publicly accessible.
- Secret token length violation: The secret token must be between 8 and 256 characters.
- Missing confirmation when deleting webhook (not applicable here but related): The node requires explicit confirmation to delete webhooks to prevent accidental removal.
- API authentication errors: Verify that the provided API token credential is valid and has necessary permissions.
Error messages:
"Bạn đang xoá Webhook. Hãy bật "Confirm Delete" để xác nhận."— This error occurs if trying to delete a webhook without confirming; not relevant forsetWebhookbut indicates safety checks in place.- Errors related to missing required parameters like webhook URL or secret token will be thrown by the node before making the API call.
- Network or API errors will be reflected in the response object; enabling debug mode helps diagnose these by showing the exact request URL and status code.