Lark Messenger icon

Lark Messenger

Interact with LarkMessenger API

Message Management → Get Chat History

AI-generated

Overview

This node operation retrieves the chat history from a specified chat container in Lark Messenger. It allows users to fetch messages within a given time range, sorted by creation time, and supports pagination for large datasets. This is useful for scenarios such as auditing conversations, analyzing chat interactions, or backing up chat data.

Use Case Examples

  1. Fetch chat messages from a specific chat container between two dates, sorted by ascending creation time.
  2. Retrieve the next page of chat history using a page token for continuous data processing.

Properties

Name Meaning
Container ID The unique identifier of the chat container from which to retrieve the chat history.
Start Time The start timestamp to filter chat messages from this time onward.
End Time The end timestamp to filter chat messages up to this time.
Sort Type The order in which chat messages are sorted by their creation time.
Page Size The number of chat messages to retrieve per page.
Page Token The token used to fetch the next page of chat messages for pagination.

Output

JSON

  • json
    • data
      * items - Array of chat messages retrieved from the chat history.
      * page_token - Token for fetching the next page of chat messages.
      * has_more - Boolean indicating if more chat messages are available beyond the current page.

Dependencies

  • Lark Messenger API
  • An API key credential for Lark Messenger

Troubleshooting

  • Ensure valid and active Lark API credentials are provided; otherwise, authentication will fail.
  • Verify that the Container ID is correct and accessible; an invalid ID will result in errors or empty results.
  • Check the format of Start Time and End Time parameters; incorrect formats may cause the API to reject the request.
  • If pagination is used, ensure the Page Token is correctly passed to retrieve subsequent pages.
  • Common error messages include 'No credentials returned!' indicating missing credentials and 'Get tenant_token failed' indicating failure to obtain an access token. Both require checking credentials and network connectivity.

Discussion