Zalo Message History icon

Zalo Message History

Lấy lịch sử tin nhắn của cuộc trò chuyện Zalo (hỗ trợ cả user và group)

Zalo Message History

AI-generated

Summary

Retrieve the chat message history from a Zalo conversation, either from a user (personal chat) or a group chat.

Inputs

  • Thread Type (required) — Specify the type of conversation: 0 for User (personal), 1 for Group chat.
  • Thread ID (required) — Provide the unique ID of the conversation—either the user ID or group ID.
  • Limit — Define the number of most recent messages to fetch. For group chats, setting 0 fetches all available messages.
  • Timeout (seconds) — Set the maximum wait time in seconds to receive the message history (applies only for User threads).

Output shape

a list of items, each containing JSON with properties: threadId, threadType ('user' or 'group'), totalMessages (number), messages (array of message objects), and for group chats with limited fetches, a hasMore boolean indicating if more messages are available.

For group threads with Limit=0, the node fetches all messages by requesting repeatedly until no more messages exist. For user threads, the node listens up to the specified timeout to retrieve old messages, then filters by threadId and returns the results limited to the specified count. Errors for individual items can be included if continueOnFail is enabled.

Examples

Example 1: Fetch last 50 messages from a user conversation

Thread Type = 0, Thread ID = user's ID, Limit = 50, Timeout = 15 seconds

Example 2: Fetch all messages from a group chat

Thread Type = 1, Thread ID = group's ID, Limit = 0 (to fetch all)

Links

Discussion