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 login session established with cookies. It supports sending text messages to either individual users or groups, with options for quoting previous messages, mentioning users, setting message urgency, and attaching images by URL.

Typical use cases include automating customer support replies, broadcasting announcements to groups, or integrating Zalo messaging into workflows that require notifications or alerts.

For example, you can send an urgent message quoting a previous conversation, mention specific users in the message, and attach one or more images hosted online.

Properties

Name Meaning
Thread ID The ID of the thread (user or group chat) where the message will be sent.
Type The type of the 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: 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 mentions within the message specifying:
- User ID: ID of the user being mentioned.
- 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. Only image URLs are supported.

Output

The node outputs an array with one item per input message. Each output item contains a json object with the following fields:

  • 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 (0 for user, 1 for group).
  • messageContent: The full message object 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 valid Zalo API credentials including a cookie string, device IMEI, and user agent string.
  • Uses an external helper utility to download and save images temporarily before sending.
  • Requires network access to Zalo's API endpoints.
  • Needs proper configuration of the Zalo API credential in n8n with the necessary authentication details.

Troubleshooting

  • Failed to initialize Zalo API: Indicates invalid or expired credentials. Verify the cookie, IMEI, and user agent values are correct and up to date.
  • Zalo login error: Could be caused by network issues or incorrect credential format. 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: General failure during message sending. Check the error message for details such as invalid thread ID, unsupported attachment URL, or API rate limits.
  • If attachments fail to upload, ensure the image URLs are publicly accessible and valid.
  • To avoid failures stopping the workflow, enable "Continue On Fail" in the node settings.

Links and References

Discussion