CT Coach Dev icon

CT Coach Dev

Interact with HttpBin API

Message → Get Messages History

AI-generated

Overview

This node interacts with the Coach API to retrieve message history between two users. Specifically, the "Get Messages History" operation fetches a specified number of messages exchanged between a sender and a receiver. This is useful in scenarios where you want to analyze past communications, audit conversations, or display chat history within an automation workflow.

For example, you could use this node to:

  • Retrieve recent messages between a sales representative and a client for review.
  • Fetch conversation history to trigger follow-up actions based on message content.
  • Aggregate communication data for reporting or analytics purposes.

Properties

Name Meaning
Authentication Choose the authentication method: "Company Api" or "System Api" (different API keys).
Sender ID The unique identifier of the message sender whose messages you want to retrieve.
Receiver ID The unique identifier of the message receiver involved in the conversation.
Message Amount The number of messages to retrieve from the conversation history.

Output

The node outputs an array of JSON objects representing the retrieved messages history. Each item in the output corresponds to the response from the Coach API's message history endpoint. The exact structure depends on the API but typically includes message details such as sender, receiver, timestamp, and message content.

No binary data output is produced by this operation.

Dependencies

  • Requires access to the Coach API endpoints.
  • Requires an API key credential configured in n8n, selectable via the "Authentication" property.
  • The node makes HTTP POST requests to https://coachtriggerapp.com/crmApi/message/history with appropriate headers and body parameters.

Troubleshooting

  • Invalid Credentials: If the API key or authentication token is incorrect or missing, the request will fail. Ensure that the correct API key is configured and selected.
  • Missing Required Parameters: The operation requires Sender ID, Receiver ID, and Message Amount. Omitting any of these will likely cause errors or empty responses.
  • API Response Errors: Network issues or API downtime can cause request failures. Check connectivity and API status.
  • Parsing Errors: The node attempts to parse the API response as JSON. If the response is malformed, it may throw parsing errors.

To resolve common errors:

  • Verify all required input fields are correctly filled.
  • Confirm API credentials are valid and have necessary permissions.
  • Review API documentation or logs for specific error messages returned by the Coach API.

Links and References

Discussion