Aigency icon

Aigency

Interact with Aigency API

Overview

The node interacts with the Aigency API, providing various operations to manage user messages, subscriptions, capabilities, and other related data. Specifically, the Get Messages operation retrieves a list of messages for a specified user session, supporting pagination through limit and offset parameters.

This node is useful in scenarios where you want to programmatically access or manipulate user-related data within the Aigency platform, such as fetching chat history, managing subscriptions, or querying user capabilities.

Example use case:
You want to fetch the latest 50 messages from a user's session to display in a custom dashboard or to process them further in an automation workflow.

Properties

Name Meaning
User ID The numeric identifier of the user whose messages are being retrieved.
Limit Maximum number of message results to return (minimum 1).
Offset Number of messages to skip before starting to collect the result set (for pagination).
Session ID Identifier of the user session from which to retrieve messages.

Output

The output is an array of JSON objects representing the messages retrieved from the Aigency API. Each item in the output corresponds to one message or an error object if the request failed for that item.

  • The json field contains the message data returned by the API under the result key.
  • If an error occurs and the node is configured to continue on failure, the json field will contain an error property describing the issue.

The node does not output binary data.

Dependencies

  • Requires an API key credential and API URL for authenticating requests to the Aigency API.
  • These credentials can be provided either via n8n credentials configuration or environment variables named AIGENCY_API_KEY and AIGENCY_API_URL.
  • The node uses HTTP POST requests with JSON-RPC 2.0 format to communicate with the API.

Troubleshooting

  • Missing Credentials Error:
    If neither credentials nor environment variables are set, the node throws an error indicating missing credentials. Ensure you configure the API key and URL properly.

  • API Errors:
    If the API returns an error response, it will be surfaced in the node output. Common causes include invalid user IDs, session IDs, or exceeding rate limits. Check the error message for details.

  • Pagination Issues:
    Using incorrect limit or offset values may result in empty or incomplete message lists. Make sure limit is at least 1 and offset is non-negative.

  • Network or Authorization Failures:
    Connection issues or invalid API keys will cause the node to fail. Verify network connectivity and API credentials.

Links and References

Discussion