Actions21
- Message Actions
- Group Actions
- Chat Actions
- Contact Actions
Chat → Get Chat History
AI-generatedOverview
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 archiving, analysis, or displaying conversation history in an application. For example, you can get the last 100 messages from a chat by providing the chat ID and the number of messages to retrieve.
Use Case Examples
- Retrieve the last 50 messages from a customer support chat to analyze conversation trends.
- Fetch chat history from a group chat to display recent discussions in a dashboard.
Properties
| Name | Meaning |
|---|---|
| Chat ID | The unique identifier of the chat to get history from, e.g., a phone number with '@c.us' for private chats. |
| Count | The number of messages to retrieve from the chat history, with a default of 100. |
Output
JSON
messages- Array of messages retrieved from the chat history.chatId- The chat ID for which the history was retrieved.count- The number of messages requested from the chat history.
Dependencies
- Requires Green API credentials including instance ID and API token for authentication.
Troubleshooting
- Common errors include failure to connect to the Green API service, which may be due to invalid credentials or network issues.
- Errors may also occur if the chat ID is invalid or the count parameter is out of acceptable range.
- Error messages typically include details about the failure and the data sent, aiding in debugging.