Aigency icon

Aigency

Interact with Aigency API

Overview

The "Add Subscription" operation of the Aigency node allows users to create a new subscription for a specified user by providing details such as the source and link associated with the subscription. This node interacts with the Aigency API to manage subscriptions programmatically.

This operation is useful in scenarios where you want to automate subscription management, for example:

  • Automatically subscribing users to content feeds or notification sources.
  • Integrating subscription creation into workflows that respond to user actions or external events.
  • Managing user subscriptions without manual intervention via API calls.

Properties

Name Meaning
User ID The unique numeric identifier of the user for whom the subscription will be added.
Source The source or origin of the subscription (e.g., a service name, feed identifier, etc.).
Link The URL or link related to the subscription source.

Output

The output JSON contains the result returned from the Aigency API after attempting to add the subscription. It typically includes confirmation details or any relevant data about the newly created subscription.

If an error occurs during the operation, the output JSON will contain an error field describing the issue.

No binary data output is involved in this operation.

Example output structure:

{
  "result": {
    // Details about the added subscription, e.g. subscription ID, status, etc.
  }
}

or on error:

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

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 set as environment variables (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 the API key or URL is not provided, the node will throw an error instructing to set these either via environment variables or n8n credentials.
  • API Errors: If the API returns an error (e.g., invalid parameters, unauthorized access), the node outputs the error message. Users should verify the correctness of input properties and API credentials.
  • Network Issues: Connectivity problems to the API endpoint will cause failures; ensure the API URL is reachable from the n8n environment.
  • Invalid Input: Providing incorrect types or missing required fields like User ID, Source, or Link will cause errors. Ensure all required inputs are correctly set.

Links and References

Discussion