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

Actions2

Overview

This node allows sending messages through the Zalo platform, a popular messaging app in Vietnam. It supports sending text messages to either individual users or groups within Zalo threads. The node can include message urgency levels, quote previous messages as replies, mention specific users within the message, and attach images via URLs.

Typical use cases include:

  • Automating customer support responses by sending messages to user threads.
  • Broadcasting announcements or updates to group chats.
  • Replying to specific messages with quoted content.
  • Highlighting important messages using urgency flags.
  • Including mentions to notify particular users in conversations.
  • Sending images along with text messages.

Properties

Name Meaning
Thread ID The unique identifier of the Zalo thread (user or group) where the message will be sent.
Type The type of the thread: "User" (individual chat) or "Group" (group chat).
Message The text content of the message to send.
Urgency The urgency level of the message: "Default", "Important", or "Urgent".
Quote Message Optional reply quoting a previous message, including:
- Message ID: ID of the message being quoted.
- Sender ID: ID of the original sender of the quoted message.
- Content: Text content of the quoted message.
Mentions Optional mentions within the message, each including:
- User ID: ID of the user to mention.
- Position: Starting position 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 of JSON objects, one per input item processed, each 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: The type of the thread (user or group).
  • messageContent: The full message object sent, including text, urgency, quotes, mentions, and attachments.

If an error occurs during sending, the output for that item includes:

  • success: false
  • error: The error message describing what went wrong.

No binary data is output by this node.

Dependencies

  • Requires valid Zalo API credentials including a cookie, device IMEI, and user agent string.
  • Uses an external Zalo SDK or API client library to handle authentication and message sending.
  • The node expects these credentials to be configured in n8n prior to execution.

Troubleshooting

  • Zalo login error: Indicates failure to authenticate with Zalo using provided credentials. Verify that the cookie, IMEI, and user agent are correct and have not expired.
  • Error sending Zalo message: General failure when sending a message. Check network connectivity and ensure the thread ID and message content are valid.
  • Invalid thread type or ID: Make sure the thread ID corresponds to the selected type (user or group).
  • Attachment issues: Only image URLs are supported as attachments. Ensure URLs are publicly accessible and correctly formatted.
  • Mention positions and lengths: Incorrect mention positioning may cause unexpected behavior; verify that mention offsets align with the message text.

Links and References

Discussion