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 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 user threads or group chats.
  • Replying to messages by quoting previous content.
  • Mentioning specific users in group conversations.
  • Attaching images via URLs to enrich message content.
  • Setting message urgency levels to prioritize communication.

For example, a business could automatically send order status updates to customers or broadcast promotional messages to a group chat.

Properties

Name Meaning
Thread ID The unique identifier of the thread (user or group) where the message will be sent.
Type The type of the thread: 0 for User, 1 for Group.
Message The text content of the message to be sent.
Urgency The urgency level of the message. Options: Default (0), Important (1), Urgent (2).
Quote Message Optional collection to reply to a specific message by quoting it. Includes:
- 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 collection to mention users in the message. Includes:
- User ID: ID of the user to mention.
- Position: Position index in the message text where the mention starts.
- Length: Length of the mention text.
Attachments Optional fixed collection allowing multiple image attachments by URL. Each attachment includes:
- Type: Currently only "Image URL" supported.
- Image URL: Publicly accessible URL of the image to attach.

Output

The node outputs an array with one item per input, each containing a JSON object with the following structure:

  • 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 message data that was sent, including text, mentions, quotes, and attachments if any.

If attachments are included, the node handles saving and cleaning up temporary files related to those images.

Dependencies

  • Requires an API authentication token credential for Zalo API access.
  • Uses an internal Zalo API client library to handle message sending and typing events.
  • May require file system access for downloading and saving image attachments temporarily.
  • Node configuration must include valid cookie, IMEI, and user agent parameters for Zalo API initialization.

Troubleshooting

  • Zalo API not initialized: This error occurs if the node cannot establish a connection to the Zalo API using provided credentials. Ensure the API key/token and other required parameters are correctly configured.
  • Cannot send typing event: Typing indicator events may fail silently; this does not block message sending but indicates a minor connectivity or permission issue.
  • Invalid thread ID or type: Messages will fail if the thread ID does not exist or the type (User/Group) is incorrect. Verify these values before sending.
  • Attachment download errors: If image URLs are invalid or inaccessible, the node will throw errors when trying to download or save them. Check URL accessibility and permissions.
  • Message content missing: Required fields like message text or thread ID must be provided; otherwise, the node will throw validation errors.

Links and References

Discussion