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 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 images in messages for richer communication.

For example, a business could use this node to send an urgent notification with an attached image to a group chat, while quoting a previous message for context.

Properties

Name Meaning
Thread ID The ID of the conversation thread where the message will be sent.
Type The type of 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: ID of the message to quote.
- Sender ID: ID of the sender of the quoted message.
- Content: Text content of the quoted message.
Mentions Optional mention details specifying:
- User ID: ID of the user to mention.
- Position: Position index of the mention in the message text.
- Length: Length of the mention text.
Attachments One or more image attachments specified by public URLs.

Output

The node outputs an array with one object per input item containing:

  • 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 representing the thread type (user or group).
  • messageContent: The full message payload sent, including text, urgency, quotes, mentions, and attachments.

If sending fails and the node is configured to continue on failure, the output includes:

  • success: false
  • error: Error message describing the failure.

The node does not output binary data.

Dependencies

  • Requires an API key credential providing a cookie string, device IMEI, and user agent for authenticating with the Zalo API.
  • Uses the external zca-js library to interact with Zalo's API.
  • Utilizes helper functions to download and remove images from URLs when sending attachments.
  • Requires proper configuration of credentials with valid Zalo session cookies.

Troubleshooting

  • Failed to initialize Zalo API: Indicates invalid or expired credentials. Verify the cookie, IMEI, and user agent values are correct and active.
  • Zalo login error: Could be due to network issues or incorrect authentication data. Check connectivity and credential validity.
  • Cannot send typing event: Non-critical; the node logs this but continues. May happen if the thread ID is invalid or the API rejects the typing event.
  • Error sending Zalo message: Could result from invalid thread IDs, unsupported attachment URLs, or API rate limits. Review error messages and ensure all inputs are valid.
  • If the node is set to stop on failure, any error during message sending will halt execution; enabling "continue on fail" allows processing subsequent items.

Links and References

Discussion