Actions12
Message → Get Messages History
AI-generatedOverview
The node interacts with a Coach Trigger development server API to perform various operations related to user data, activities, messages, and reports. Specifically, the Get Messages History operation retrieves the history of messages exchanged between a specified sender and receiver. This is useful for scenarios where you want to analyze past communications, audit conversations, or display message threads in an application.
Practical examples include:
- Fetching chat history between two users in a coaching platform.
- Retrieving previous AI coach messages sent to a user.
- Auditing communication logs for compliance or review.
Properties
| Name | Meaning |
|---|---|
| Authentication | Choose between "Company Api" (using a company API key) or "System Api" (using a system API key) for authenticating requests. |
| Sender ID | The unique identifier of the message sender whose message history you want to retrieve. |
| Receiver ID | The unique identifier of the message receiver involved in the message history retrieval. |
| Message Amount | The number of messages to retrieve from the history. |
| Type | A string parameter (default "0") that can specify the type/category of messages to fetch. |
Output
The output is a JSON array where each item contains the response from the API call to fetch message history. The structure of the JSON depends on the API response but generally includes details about messages exchanged between the sender and receiver, such as message content, timestamps, sender/receiver IDs, and possibly message metadata.
The node does not output binary data.
Dependencies
- Requires access to the Coach Trigger development server API at
https://dev.mymatrixapp.com/crmApi/message/history. - Requires either a company API key credential or a system API key credential configured in n8n for authentication.
- The node uses HTTP POST requests with appropriate headers containing authentication keys.
Troubleshooting
- Authentication errors: Ensure that the correct API key credential is selected and properly configured. Using the wrong authentication option or expired keys will cause authorization failures.
- Missing required parameters: The operation requires
Sender ID,Receiver ID, andMessage Amount. Omitting any of these will likely result in errors or empty responses. - Invalid message amount: Providing a non-numeric or excessively large value for
Message Amountmay cause the API to reject the request or return errors. - API response parsing errors: If the API returns malformed JSON or unexpected data, the node might throw parsing errors. Verify API availability and response format.
- Network issues: Connectivity problems to the API endpoint will cause request failures; check network settings and firewall rules.
Links and References
- Coach Trigger API Documentation (Assumed URL based on API domain, verify actual docs location)
- n8n HTTP Request Node documentation for understanding how HTTP calls are made: https://docs.n8n.io/nodes/n8n-nodes-base.httpRequest/