Aigency icon

Aigency

Interact with Aigency API

Overview

The node interacts with the Aigency API, providing various operations related to user messages, subscriptions, capabilities, and other user-related data. Specifically, the "Remove Subscription" operation allows users to delete a subscription associated with a given user ID and subscription ID.

This node is beneficial in scenarios where automated management of user subscriptions is required, such as cleaning up inactive or unwanted subscriptions programmatically. For example, an application could use this node to remove a user's subscription when they unsubscribe from a service or when a subscription expires.

Properties

Name Meaning
User ID The numeric identifier of the user whose subscription is to be removed.
ID The string identifier of the subscription to be removed for the specified user.

Output

The node outputs JSON data representing the result of the API call. On successful removal of a subscription, the output contains the result field with relevant details returned by the Aigency API. If an error occurs, the output includes an error field describing the issue.

The output structure is:

{
  "json": {
    // On success
    "result": { /* details about the removed subscription or confirmation */ }

    // On failure
    "error": "Error message describing what went wrong"
  }
}

No binary data output is produced by this operation.

Dependencies

  • Requires access to the Aigency API.
  • Needs an API key credential and API URL configured either via environment variables (AIGENCY_API_KEY and AIGENCY_API_URL) or through n8n credentials configuration.
  • Uses HTTP POST requests with JSON-RPC 2.0 protocol to communicate with the API.

Troubleshooting

  • Missing Credentials: If the API key or URL is not set, the node will throw an error instructing to configure these either as environment variables or in the n8n UI.
  • API Errors: If the API returns an error (e.g., invalid user ID or subscription ID), the node will either throw an error or continue on fail depending on the node's settings.
  • Network Issues: Connectivity problems to the Aigency API endpoint will cause failures; ensure the API URL is reachable and correct.
  • Invalid Parameters: Providing incorrect types or missing required parameters (userId, id) will cause errors.

Links and References

Discussion