Zalo Send Message icon

Zalo Send Message

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

Overview

This node sends messages through the Zalo messaging platform using its API, authenticated via a cookie-based login. It supports sending text messages to either individual users or groups, with options for message urgency, quoting previous messages, mentioning users, and attaching images or files by URL.

Common scenarios include:

  • Automating customer support replies on Zalo.
  • Broadcasting announcements or alerts to user groups.
  • Sending personalized messages that reference earlier conversations.
  • Including media attachments in messages for richer communication.

For example, a business could use this node to send an urgent notification with an image attachment to a group chat, or reply to a user's message quoting their original text.

Properties

Name Meaning
Thread ID The ID of the conversation thread where the message will be sent.
Type The type of message recipient: "User" (individual) or "Group".
Message The text content of the message to send.
Urgency The urgency level of the message: "Default", "Important", or "Urgent".
Quote Message Optional quoted message details including Message ID, Sender ID, and Content to reference.
Mentions Optional mention details specifying User ID, position, and length within the message text.
Attachments One or more attachments specified by public URLs (images or files) to include with the message.

Output

The node outputs an array of JSON objects, each representing the result of sending a message for one input item. Each output object contains:

  • success: Boolean indicating if the message was sent successfully.
  • response: The raw response from the Zalo API after sending the message.
  • threadId: The ID of the thread where the message was sent.
  • threadType: Numeric code indicating whether the message was sent to a user (0) or group (1).
  • messageContent: The full message payload sent, including text, urgency, quotes, mentions, and attachments if any.
  • If sending fails and "Continue On Fail" is enabled, an error object with the failure message is included instead.

No binary data output is produced by this node.

Dependencies

  • Requires an API key credential containing a valid Zalo login cookie, device IMEI, and user agent string.
  • Uses the external zca-js library to interact with the Zalo API.
  • Utilizes helper functions to download and remove attachment files temporarily.
  • Must be configured with proper credentials that allow cookie-based authentication to Zalo.

Troubleshooting

  • Failed to initialize Zalo API: Indicates invalid or expired credentials (cookie, IMEI, or user agent). Recheck and update credentials.
  • Zalo login error: Could be caused by network issues or incorrect credential format. Verify connectivity and credential correctness.
  • Cannot send typing event: Non-critical; the node logs this but continues. Usually means the API does not accept typing events for the target thread.
  • Error sending Zalo message: May occur due to invalid thread ID, insufficient permissions, or malformed message content. Check input parameters and ensure the bot has access to the thread.
  • When attachments are used, ensure URLs are publicly accessible and valid; otherwise, file download will fail.
  • Enable "Continue On Fail" to process multiple items even if some fail.

Links and References

Discussion