Green API icon

Green API

Send WhatsApp messages via Green API

Chat → Get Chat History

AI-generated

Overview

This node operation retrieves the chat history from a specified WhatsApp chat using the Green API. It is useful for scenarios where you need to access past messages from a chat, such as for customer support, data analysis, or archiving conversations. For example, you can fetch the last 100 messages from a chat to review recent interactions or to process message data programmatically.

Use Case Examples

  1. Fetch the last 50 messages from a customer support chat to analyze conversation trends.
  2. Retrieve chat history from a group chat to monitor discussions and extract important information.

Properties

Name Meaning
Chat ID The unique identifier of the chat from which to retrieve the history. It is required and typically formatted as a phone number with '@c.us' for private chats.
Count The number of messages to retrieve from the chat history. Defaults to 100 if not specified.
Override Credentials Optional credentials to override the default API instance ID and token for this specific operation.

Output

JSON

  • chatId - The ID of the chat for which the history was retrieved.
  • messages - An array of message objects representing the chat history.

Dependencies

  • Green API credentials including instance ID and API token for authentication.

Troubleshooting

  • Ensure the Chat ID is correctly formatted and corresponds to an existing chat.
  • Verify that the API credentials (instance ID and API token) are valid and have the necessary permissions.
  • Check network connectivity and API endpoint availability if requests fail.
  • Common error messages include failures to get chat history due to invalid parameters or authentication issues; verify input parameters and credentials to resolve these.

Discussion