Aigency icon

Aigency

Interact with Aigency API

Overview

The node interacts with the Aigency API, providing various operations to manage user data and system capabilities. Specifically, the "Get Usage History" operation retrieves a paginated list of usage records for a specified user. This is useful for monitoring user activity, auditing, or generating reports on how a user has interacted with the system over time.

Practical examples include:

  • Fetching recent usage logs for a user to analyze their engagement.
  • Integrating usage history into dashboards or notifications.
  • Auditing user actions for compliance or troubleshooting.

Properties

Name Meaning
User ID The unique numeric identifier of the user whose usage history is being requested.
Limit Maximum number of usage history records to return in one request (minimum 1).
Offset Number of records to skip before starting to collect the result set (for pagination).

Output

The output is an array of JSON objects representing usage history entries for the specified user. Each entry contains details as returned by the Aigency API's getUsageHistory method under the result field.

If an error occurs during the API call, the output will contain an object with an error property describing the issue.

No binary data is produced by this operation.

Dependencies

  • Requires an API key credential and API URL for authenticating requests to the Aigency API.
  • These credentials can be configured either in the n8n credentials interface or via 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: If neither credentials nor environment variables are set, the node throws an error indicating missing credentials. Ensure that the API key and URL are properly configured.
  • API Errors: If the API returns an error response, it will be surfaced in the node output. Common causes include invalid user IDs or exceeding rate limits.
  • Pagination Issues: Incorrect use of limit and offset may result in unexpected subsets of data. Verify these values when paginating through large datasets.
  • Network Issues: Connectivity problems or incorrect API URLs will cause failures. Confirm network access and correct endpoint configuration.

Links and References

Discussion