Actions35
- Add Message
- Add Subscription
- Call Capability
- Delete All Memories
- Delete All Messages
- Delete All Warnings
- Delete Last Messages
- Delete Memory
- Delete Message
- Disable Capability
- Disable Dev Mode
- Disable Subscription
- Enable Capability
- Enable Dev Mode
- Enable Subscription
- Get Balance
- Get Capabilities
- Get Current User
- Get Dev Mode
- Get File URL
- Get Memories
- Get Messages
- Get Next Scan
- Get Reward Amount
- Get Subscriptions
- Get Usage History
- Get Warnings
- Login
- Logout
- Remove Capability
- Remove Subscription
- Scan Subscriptions
- Send Message
- Sync Capabilities
- Throw Error
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_KEYandAIGENCY_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
limitandoffsetmay 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
- Aigency API Documentation (Replace with actual URL if available)
- JSON-RPC 2.0 Specification