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 platform using its API, authenticated via a login session established with cookies. 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.

Typical use cases 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.

Properties

Name Meaning
Thread ID The unique identifier of the conversation thread where the message will be sent.
Type The type of recipient: either a single User or a Group.
Message The textual content of the message to send.
Urgency The priority level of the message; options are Default, Important, or Urgent.
Quote Message Details of a message to quote, including Message ID, Sender ID, and quoted content.
Mentions Information about users mentioned in the message, specifying User ID, position, and length.
Attachments One or more image attachments specified by public URLs to include in the message.

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 whether the thread is a user (0) or group (1).
  • messageContent: The full message payload sent, including text, urgency, quotes, mentions, and attachments.
  • error (if any): Error message string if sending failed and the node is configured to continue on failure.

If attachments were included, the node temporarily downloads images before sending and removes them afterward.

Dependencies

  • Requires valid Zalo API credentials including a cookie-based login session, device IMEI, and user agent string.
  • Uses an external helper utility to download and remove image attachments.
  • Needs the Zalo API client library bundled as a dependency.
  • Must be configured with appropriate credentials in n8n to authenticate API requests.

Troubleshooting

  • Failed to initialize Zalo API: Indicates invalid or expired credentials. Verify the cookie, IMEI, and user agent values.
  • Zalo login error: Could be caused by network issues or incorrect credential format.
  • Cannot send typing event: Non-critical warning if the typing indicator fails; message sending may still succeed.
  • Error sending Zalo message: General failure during message sending; check error details for specifics.
  • Ensure all required properties like Thread ID and Message are provided.
  • If attachments fail, verify that image URLs are publicly accessible and valid.

Links and References

Discussion