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 message status updates (specifically typing indicators) through the Zalo messaging platform using its API. It is useful when you want to programmatically indicate that a user or group is currently typing in a chat thread, enhancing real-time communication experiences.

Typical use cases include:

  • Showing typing indicators in automated chatbots or customer support systems integrated with Zalo.
  • Triggering typing status before sending actual messages to simulate human-like interaction.
  • Managing group or individual chat states in workflow automations involving Zalo.

For example, before sending a message to a user or group, this node can send a "typing" event to notify the recipient(s) that a response is being prepared.

Properties

Name Meaning
Thread ID The unique identifier of the chat thread where the typing status will be sent.
Type The type of the message thread: either "User" (individual chat) or "Group" (group chat).

Output

The node outputs a JSON object indicating the success or failure of sending the typing status:

  • On success:
    {
      "success": true,
      "message": "OK"
    }
    
  • On failure (if continueOnFail is enabled):
    {
      "success": false,
      "error": "Error message describing what went wrong"
    }
    

No binary data is output by this operation.

Dependencies

  • Requires an API key credential for Zalo with valid cookie, device IMEI, and user agent information to authenticate requests.
  • Uses the external zca-js library to interact with the Zalo API.
  • Relies on helper functions for image handling in other operations (not relevant here).
  • Node must be configured with proper credentials containing authentication cookies and device info.

Troubleshooting

  • Common issues:

    • Invalid or expired authentication cookie causing login failure.
    • Incorrect thread ID or thread type leading to failed typing event dispatch.
    • Network or API errors from Zalo service.
  • Error messages:

    • "Failed to initialize Zalo API. Check your credentials." — Indicates problems with authentication; verify the provided cookie and device info.
    • "Zalo login error: <details>" — Detailed login failure; check credentials and network connectivity.
    • "Zalo API not initialized" — The node attempted to send typing status without successful login; ensure credentials are correct.
    • "Cannot send typing event" — Typing event failed; may be due to invalid thread ID/type or temporary API issues.
  • Resolution tips:

    • Double-check and refresh the authentication cookie and device identifiers.
    • Confirm the thread ID exists and matches the specified type (user or group).
    • Enable continueOnFail to allow workflows to proceed despite occasional failures.

Links and References

Discussion