Demo API Key Request

Hace una petición HTTP con API Key en el header

Overview

This node performs an HTTP request to a specified API endpoint using an API key for authentication. It is designed to send either GET or POST requests, attaching the API key in the request header. This node is useful when you need to interact with APIs that require an API key passed as a header for authorization.

Practical examples include:

  • Fetching data from a third-party service that requires an API key.
  • Sending data to an external system via POST while authenticating with an API key.
  • Automating workflows that depend on authenticated API calls without complex OAuth flows.

Properties

Name Meaning
Endpoint The relative path appended to the base URL of the API to specify the target resource.
Método The HTTP method used for the request. Options: GET, POST.

Output

The node outputs an array of items where each item contains a json field holding the parsed JSON response from the API call. The structure of this JSON depends on the API's response format.

No binary data output is produced by this node.

Dependencies

  • Requires an API key credential and a base URL configured in the node’s credentials.
  • Uses n8n’s built-in HTTP request helper to perform the API calls.
  • No additional external dependencies beyond the API key and base URL configuration.

Troubleshooting

  • Common issues:

    • Incorrect or missing API key will cause authentication failures.
    • Invalid endpoint paths may result in 404 errors.
    • Network connectivity problems can cause request timeouts or failures.
  • Error messages:

    • Errors thrown during the HTTP request are wrapped and reported with the item index to help identify which input caused the failure.
    • Typical error messages include HTTP status codes and messages from the API, such as "401 Unauthorized" if the API key is invalid.
  • Resolution tips:

    • Verify the API key and base URL are correctly set in the credentials.
    • Double-check the endpoint path for correctness.
    • Ensure network access to the API server is available.

Links and References

Discussion