Zalo User icon

Zalo User

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

Overview

The Zalo User node enables management of Zalo user interactions and messaging through various operations. Specifically, the "Thu Hồi Tin Nhắn" (Undo Message) operation allows users to recall or retract a previously sent message in a chat thread. This is useful when you want to delete a message from both sender and receiver sides after it has been sent, for example, to correct mistakes or remove sensitive information.

Practical scenarios include:

  • Automatically recalling messages sent by mistake.
  • Managing chat content dynamically based on business logic.
  • Moderating conversations by removing inappropriate messages.

Properties

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

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 API call that performs the undo message action. This usually includes details about the recall operation result.

Example output structure:

{
  "status": "Thành công",
  "response": {
    // API response details about the undo message operation
  }
}

The node does not output binary data.

Dependencies

  • Requires an active connection to the Zalo API via credentials containing an API key, cookie, IMEI, and user agent.
  • The node uses an external library (zca-js) to interact with the Zalo platform.
  • Proper configuration of the Zalo API credential within n8n is necessary to authenticate requests.

Troubleshooting

  • Common issues:

    • Invalid or expired credentials may cause authentication failures.
    • Incorrect threadId, msgId, or cliMsgId values will prevent successful message recall.
    • Network connectivity problems can interrupt API calls.
  • Error messages:

    • "No API instance found. Please make sure to provide valid credentials."
      Resolution: Verify that the Zalo API credentials are correctly set up and valid.
    • Errors related to missing or invalid parameters will indicate which input property needs correction.
    • If the node fails but "Continue On Fail" is enabled, errors will be returned in the output JSON under the error field.

Links and References

Discussion