Zalo User icon

Zalo User

Quản lý người dùng Zalo

Overview

The node "Zalo User" manages interactions with Zalo users through various operations. Specifically, the "Thu hồi tin nhắn" (Undo Message) operation allows you to revoke or delete a previously sent message in a Zalo chat thread. This is useful when you want to retract messages that were sent by mistake or contain errors.

Common scenarios include:

  • Automatically deleting sensitive or incorrect messages shortly after sending.
  • Implementing moderation tools that can remove inappropriate content.
  • Allowing users to undo messages programmatically via workflows.

Example: You send a message to a user but realize it contains a typo. Using this node's undo message operation, you provide the thread ID, thread type, and message identifiers to revoke that message from the conversation.

Properties

Name Meaning
Thread ID The unique identifier of the user or chat thread where the message was sent.
Thread Type The type/category of the user or chat thread (e.g., individual chat, group chat).
msgId The unique identifier of the message to be undone (revoked).
cliMsgId The client-side message ID associated with the message to be undone.

Output

The output JSON contains:

  • status: A string indicating the success status, typically "Thành công" meaning "Success".
  • response: The raw response object returned from the Zalo API after attempting to undo the message. This may include details about the operation result.

No binary data is output by this node.

Example output JSON structure:

{
  "status": "Thành công",
  "response": {
    // API response details here
  }
}

Dependencies

  • Requires valid Zalo API credentials including an API key credential with cookie, IMEI, and user agent information.
  • Uses the external zca-js library to interact with the Zalo API.
  • The node expects these credentials to be configured properly in n8n before execution.

Troubleshooting

  • Common issues:

    • Invalid or expired credentials causing login failure.
    • Incorrect threadId, threadType, msgId, or cliMsgId leading to unsuccessful undo attempts.
    • Network or API rate limiting errors.
  • Error messages:

    • "No API instance found. Please make sure to provide valid credentials."
      Means the node could not authenticate with Zalo API. Check your credentials and ensure they are correct and active.
    • Errors thrown during the undo operation will be shown with their message. If "Continue On Fail" is enabled, the error will be included in the output JSON for that item.
  • Resolution tips:

    • Verify all required input properties are correctly set.
    • Confirm that the message IDs correspond exactly to the message you want to undo.
    • Ensure your Zalo API credentials have sufficient permissions and are not expired.
    • Enable "Continue On Fail" to handle partial failures gracefully in batch executions.

Links and References

Discussion