Lectful icon

Lectful

Interact with the VIPay Lectful API

Authentication → Login

AI-generated

Overview

The "Lectful" node integrates with the VIPay Lectful API, enabling automation workflows to interact with various aspects of the Lectful platform. Specifically, for the Authentication - Login operation, this node allows users to authenticate by providing their email and password. This is useful in scenarios where you want to programmatically log in a user to obtain an access token or session information for subsequent API calls.

Typical use cases include:

  • Automating login processes before performing further actions on behalf of a user.
  • Validating user credentials within a workflow.
  • Integrating Lectful authentication into broader automation pipelines.

Example: A workflow that logs in a user to Lectful, retrieves their profile, and then updates some user-specific data based on external triggers.


Properties

Name Meaning
Authentication Mode Choose how to authenticate with the Lectful API:
- Use Stored Credentials
- Manual Configuration (provide base URL and API key manually)
Credentials Note Notice shown when using Manual Configuration mode explaining credential usage.
Base URL Override Optional base URL to override the stored credential's base URL (without /api/v1).
API Key Override Optional API key to override the stored credential's API key.
Email User email address used for login.
Password User password used for login.

Output

The output of the Login operation is the JSON response returned by the Lectful API after attempting to authenticate the user. This typically includes:

  • Access tokens or session tokens if login is successful.
  • User-related metadata or authentication status.
  • Error messages if authentication fails.

The output is provided as a JSON object under the json field of the node's output. There is no binary data output for this operation.


Dependencies

  • Requires access to the Lectful API endpoint.
  • Needs either stored credentials configured in n8n (including base URL and API key) or manual configuration of these parameters.
  • The node uses HTTP requests with Bearer token authorization for manual mode or built-in credential authentication for stored credentials mode.

Troubleshooting

Common Issues

  • Missing or invalid credentials: If neither stored credentials nor manual overrides are properly set, the node will throw an error indicating missing credentials.
  • Base URL or API key not provided in manual mode: Both must be supplied when using manual configuration; otherwise, execution will fail.
  • Incorrect email or password: The API will return an authentication error if credentials are invalid.
  • Network or connectivity issues: Failure to reach the Lectful API endpoint will cause request errors.

Error Messages and Resolutions

  • "Base URL Override is required when using Manual Configuration mode"
    Resolution: Provide a valid base URL without /api/v1 when manual mode is selected.

  • "API Key Override is required when using Manual Configuration mode"
    Resolution: Provide a valid API key when manual mode is selected.

  • "Valid credentials are required when using 'Use Stored Credentials' mode."
    Resolution: Configure Lectful API credentials in the node's credential settings or switch to manual mode.

  • API authentication errors (e.g., 401 Unauthorized)
    Resolution: Verify email and password correctness and ensure the API key is valid.


Links and References

  • Lectful API Documentation (Assumed official API docs URL, replace with actual if known)
  • n8n Documentation on Credentials
  • n8n HTTP Request Node documentation for understanding request options

Summary of execute() logic for Authentication - Login

  • Reads input items and iterates over each.
  • Determines authentication mode (stored credentials or manual).
  • Constructs base URL and authorization headers accordingly.
  • For resource auth and operation login, it:
    • Retrieves email and password from node parameters.
    • Sends a POST request to /auth/login endpoint with { email, password } in the body.
  • Captures the API response and returns it as JSON output.
  • Handles errors gracefully, optionally continuing on failure if configured.

This design ensures flexible authentication handling and straightforward login integration within n8n workflows.

Discussion