Mtai Zalo Send Message icon

Mtai 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 using its API, authenticated via a cookie-based login. It is designed to send text messages to either individual users or groups within Zalo threads. The node supports adding message urgency levels, 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 notifications with mentions and quoted context.
  • Sharing images alongside text messages in conversations.

Example: Automatically send an urgent message with an image attachment to a specific group thread, quoting a previous message for context.

Properties

Name Meaning
Thread ID The ID of the Zalo 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 to reply to, including Message ID, Sender ID, and Content.
Mentions Details of users mentioned in the message, including User ID, position, and length of mention.
Attachments One or more image attachments specified by public URLs to include with the message.

Output

The node outputs an array of JSON objects, each representing the result of sending a message per input item. Each output JSON 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 representing whether the message was sent to a user (0) or group (1).
  • messageContent: The full message object sent, including text, urgency, quotes, mentions, and attachments.

If sending fails and "Continue On Fail" is enabled, the output includes:

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

No binary data is output by this node.

Dependencies

  • Requires valid Zalo API credentials configured with a cookie string, IMEI, and user agent.
  • Uses the external zca-js library to interact with the Zalo API.
  • Utilizes helper functions to download and remove image attachments temporarily.
  • Requires network access to Zalo API endpoints and any image URLs provided.

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 warning when the node cannot notify the thread that the user is typing. Usually safe to ignore.
  • Error sending Zalo message: General failure during message sending. Inspect the error message for details; common causes include invalid thread IDs, unsupported attachment URLs, or API rate limits.
  • If attachments fail to upload, ensure the image URLs are publicly accessible and correctly formatted.
  • Enable "Continue On Fail" to allow processing multiple items even if some fail.

Links and References

Discussion