Zalo Send Message Thong icon

Zalo Send Message Thong

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. It supports sending text messages to either individual users or groups within Zalo threads. The node is useful for automating communication workflows such as customer support, notifications, or marketing campaigns where messages need to be sent programmatically.

Typical use cases include:

  • Sending alerts or updates to specific Zalo chat threads.
  • Replying to messages by quoting previous content.
  • Mentioning users in group chats.
  • Attaching images via public URLs to enrich message content.

For example, a business could automatically send order status updates to customers on Zalo, including images of products or invoices.

Properties

Name Meaning
Thread ID The unique identifier of the Zalo thread (chat) where the message will be sent.
Type The type of the message recipient: user or group.
Message The text content of the message to be sent.
Urgency The urgency level of the message. Options: Default, Important, Urgent.
Quote Message Optional quoted message details to reply to a specific message. Includes Message ID, Sender ID, and Content.
Mentions Details of users to mention in the message, including User ID, position in text, and length of mention.
Attachments One or more image attachments specified by public URLs.

Output

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

If the node encounters an error during sending, it outputs an object with:

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

No binary data output is produced by this node.

Dependencies

  • Requires an API key credential for authenticating with the Zalo API.
  • Uses an external Zalo API client library (zca-js) to interact with the Zalo service.
  • Needs proper configuration of credentials in n8n to provide cookie, IMEI, and user agent information for API initialization.

Troubleshooting

Common Issues

  • Failed to initialize Zalo API: This usually means the provided credentials are invalid or incomplete. Verify that the API key and other required authentication details are correctly configured.
  • Error sending Zalo message: Could be caused by incorrect thread IDs, unsupported message types, or network issues.
  • Cannot send typing event: This warning indicates the node failed to send a "typing" indicator but does not block message sending.

Error Messages and Resolutions

  • "Failed to initialize Zalo API. Check your credentials."
    Ensure that the API key credential is valid and all required fields (cookie, IMEI, user agent) are set properly.

  • "Error sending Zalo message: <details>"
    Check the message parameters such as thread ID, message content, and attachment URLs. Confirm the thread exists and the bot has permission to send messages there.

  • If the node throws errors referencing missing or invalid parameters, verify that all required properties (Thread ID, Message) are provided and correctly formatted.

Links and References


This summary is based solely on static analysis of the provided source code and property definitions.

Discussion