Mtai Zalo Send Message icon

Mtai Zalo Send Message

Gửi tin nhắn qua API Zalo sử dụng kết nối đăng nhập bằng cookie

Actions2

Overview

This node allows sending a "typing status" event to a Zalo chat thread via the Zalo API. It is useful for indicating to the recipient(s) that the sender is currently typing a message, enhancing real-time communication experience in chat applications.

Typical use cases include:

  • Showing typing indicators in user-to-user or group conversations on Zalo.
  • Integrating with automated workflows where you want to simulate or trigger typing status before sending actual messages.
  • Enhancing chatbot interactions by signaling activity to users.

For example, before sending a message, this node can be used to send a typing status to a specific thread (user or group), making the conversation feel more natural and interactive.

Properties

Name Meaning
Thread ID The unique identifier of the Zalo thread (chat) where the typing status will be sent.
Type The type of the thread: either "User" (individual chat) or "Group" (group chat). Options: User, Group

Output

The node outputs JSON data with the following structure:

{
  "success": true,
  "message": "OK"
}
  • success: Boolean indicating if the typing status was sent successfully.
  • message: A simple confirmation string ("OK").

No binary data is output by this operation.

Dependencies

  • Requires an active Zalo API connection authenticated via a cookie-based credential, including device identifiers like IMEI and user agent strings.
  • The node depends on the external zca-js library to interact with the Zalo API.
  • Proper credentials must be configured in n8n to provide the necessary authentication details.

Troubleshooting

  • Common issues:

    • Failure to initialize the Zalo API due to invalid or expired cookies or missing device info.
    • Errors when sending the typing event if the thread ID is incorrect or the API rejects the request.
  • Error messages:

    • "Failed to initialize Zalo API. Check your credentials." — Indicates problems with authentication; verify the cookie and device info credentials.
    • "Zalo login error: <error message>" — Details from the underlying API login failure.
    • "Zalo API not initialized" — The node attempted to send a typing event without successful API initialization.
    • "Cannot send typing event" — The API call to send the typing status failed; check thread ID and network connectivity.
  • Resolution tips:

    • Ensure the provided cookie and device information are valid and up to date.
    • Confirm the thread ID exists and matches the specified type (user or group).
    • Check network access and API availability.
    • Use the node's "Continue On Fail" option to handle errors gracefully in workflows.

Links and References

Discussion