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 a message status update to a Zalo conversation (either personal or group) using the Zalo API authenticated via cookies. It is useful for scenarios where you want to programmatically indicate typing or other message status events in a chat thread on Zalo, such as showing that a user is typing or active in a conversation.

Practical examples include:

  • Indicating to a recipient that you are typing a reply in a personal or group chat.
  • Triggering message status updates automatically from workflows based on external events.

Properties

Name Meaning
ID cuộc trò chuyện / Thread ID The unique identifier of the conversation (thread) where the message status will be sent.
Loại cuộc trò chuyện The type of conversation: "Cá nhân" (Personal/User) or "Nhóm" (Group). Options: 0 (User), 1 (Group).

Output

The output JSON contains a success flag and a confirmation message:

{
  "success": true,
  "message": "OK"
}

This indicates that the message status was successfully sent to the specified conversation thread.

Dependencies

  • Requires valid Zalo API credentials authenticated via a cookie, IMEI, and user agent string.
  • The node uses an internal Zalo API client initialized with these credentials.
  • No additional environment variables are required beyond the configured Zalo API credential containing the necessary authentication data.

Troubleshooting

  • Common issues:

    • Failure to initialize the Zalo API client due to invalid or missing credentials.
    • Errors when sending typing events if the thread ID or type is incorrect.
  • Error messages:

    • "Failed to initialize Zalo API. Check your credentials." — Indicates that the provided cookie or other authentication details are invalid or expired. Solution: Reconfigure the Zalo API credential with valid login information.
    • "Zalo API not initialized" — The node attempted to send a message status without a successful API client initialization. Ensure credentials are properly set.
    • "Cannot send typing event" — The typing event failed to send, possibly due to network issues or invalid thread parameters. This error is logged but does not stop execution.
  • To resolve errors, verify that the Zalo API credentials are correct and have not expired, and confirm that the thread ID and type correspond to an existing conversation.

Links and References

(Note: These links are generic references; consult official Zalo developer resources for detailed API usage.)

Discussion