Zalo Bot icon

Zalo Bot

Interact with Zalo Bot Platform

Overview

This node integrates with the Zalo Bot Platform, allowing users to interact programmatically with their Zalo bots. Specifically, the getUpdates operation under the Bot resource fetches incoming updates or events sent to the bot, such as messages or user interactions.

Common scenarios for using this node include:

  • Polling the Zalo Bot API to retrieve new messages or events that the bot has received.
  • Debugging and monitoring bot activity by fetching recent updates.
  • Building workflows that react to user inputs or other bot events by processing these updates.

For example, a chatbot developer might use the getUpdates operation to periodically check for new user messages and then trigger automated responses or logging actions within n8n.

Properties

Name Meaning
Debug Mode When enabled, returns the full URL of the API call for easier debugging.
Offset Numeric offset for the getUpdates request to specify the starting point of updates.
Limit Limits the number of update records returned (0 means default limit set by API).

Output

The output is a JSON array where each element corresponds to the response from the Zalo Bot API for the getUpdates call. The structure typically includes:

  • response: The parsed JSON response from the API containing the updates data.
  • debug (optional): If debug mode is enabled or an error occurs, this object contains:
    • url: The full API request URL with sensitive tokens redacted.
    • status: HTTP status code of the API response.

The response field will contain the actual updates data as provided by the Zalo Bot API, which usually includes details about messages, events, or other bot-related activities.

No binary data output is produced by this operation.

Dependencies

  • Requires an API authentication token credential for the Zalo Bot Platform.
  • Uses the external service endpoint at https://bot-api.zapps.me.
  • The node depends on the node-fetch library to make HTTP requests.
  • No additional environment variables are required beyond the API credential.

Troubleshooting

  • Missing or invalid API token: Ensure the API key credential is correctly configured and valid.
  • Offset and Limit parameters: Using incorrect values may result in empty or incomplete update lists.
  • Confirm Delete flag: For operations like deleting webhook (not relevant here), forgetting to confirm can cause errors.
  • API errors: If the API returns an error, enabling Debug Mode helps by showing the exact request URL and status code.
  • JSON parsing errors: Rare but possible if the API returns malformed JSON; the node handles this by returning raw text in the response.

Links and References

Discussion