Aigency icon

Aigency

Interact with Aigency API

Overview

The node interacts with the Aigency API, allowing users to perform various operations related to user capabilities, messages, subscriptions, and other account-related actions. Specifically, the "Disable Capability" operation disables a particular capability for a given user by their User ID and the capability's ID.

This node is beneficial in scenarios where automated management of user permissions or features is required within the Aigency platform. For example, disabling a capability could be used to restrict access to certain functionalities dynamically based on business logic or user status changes.

Practical example:

  • Automatically disable a premium feature (capability) for a user when their subscription expires.
  • Disable development mode capabilities during production deployments.

Properties

Name Meaning
User ID The numeric identifier of the user for whom the capability will be disabled.
ID The string identifier of the capability to disable.

Output

The node outputs JSON data containing the result of the API call. The structure typically includes a result field with the response from the Aigency API. If an error occurs, the output JSON contains an error field describing the issue.

Example output JSON structure:

{
  "result": {
    // API-specific response details about the disabled capability
  }
}

If the node encounters an error and is set to continue on failure, it outputs:

{
  "error": "Error message describing what went wrong"
}

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 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 Aigency 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 (e.g., invalid user ID or capability ID), the node will throw an error unless "Continue On Fail" is enabled, in which case the error is returned in the output JSON.
  • Network Issues: Connection failures to the API endpoint will cause errors; verify network connectivity and API URL correctness.
  • Invalid Parameters: Providing incorrect types or missing required parameters (userId, id) will cause the node to fail.

Links and References

Discussion