Overview
This node allows making HTTP requests to APIs defined by Swagger/OpenAPI specifications. It dynamically loads the API operations from a Swagger spec (either from a URL or JSON), enabling users to select an operation and configure path parameters, query parameters, headers, and request body. It supports various authentication methods and flexible request options, making it useful for integrating with any Swagger-documented API without custom coding.
Use Case Examples
- Calling a REST API operation to retrieve user data by specifying path and query parameters.
- Sending a POST request with a JSON body to create a new resource in an API defined by Swagger.
- Customizing headers and authentication to interact with secured Swagger APIs.
Properties
| Name | Meaning |
|---|---|
| Path Parameters | Path parameters required for the selected API endpoint, allowing dynamic URL construction. |
| Query Parameters | Query parameters to append to the request URL, supporting dynamic API queries. |
| Headers | Additional HTTP headers to include in the request, such as Content-Type or Authorization. |
| Send Body | Boolean flag indicating whether to send a request body with the HTTP request. |
| Body Content Type | The content type of the request body when sending data (JSON, form-data, form-urlencoded, raw). |
| Body | The actual request body content, either as JSON or raw string depending on the content type. |
| Options | Additional request options such as response format, full response return, redirect following, ignoring HTTP errors, and timeout. |
Output
JSON
json- The parsed response data from the API call, or error information if the request failed.
Dependencies
- An API key credential or other authentication credentials for the Swagger API.
Troubleshooting
- Ensure the Swagger specification URL or JSON is valid and accessible; errors loading or parsing the spec will cause failures.
- Select an actual operation from the list, not a tag header placeholder, to avoid errors.
- Verify that required path and query parameters are provided and correctly named.
- Check authentication credentials and their configuration (API key location, bearer token, basic auth, OAuth2).
- Timeouts can occur if the API is slow or unreachable; adjust the timeout option accordingly.
Links
- Swagger/OpenAPI Specification - Official documentation for Swagger/OpenAPI specifications.
- n8n Swagger API Node - Official n8n documentation for the Swagger API node usage and configuration.