Skip to main content

API Caller

Make HTTP requests to external APIs and web services from your workflows.

Updated over 3 months ago

Overview

The API Caller node enables you to make HTTP requests to external APIs directly from your FluxPrompt workflow. This node supports all standard HTTP methods and provides comprehensive configuration options for headers, request bodies, authentication, and query parameters.

Basic Configuration

URL Input

Enter the target API endpoint in the URL field:

  • URL Field: Input the complete API endpoint URL (e.g., "https://example.com")

  • Connection Point: Can receive URLs from other workflow nodes

  • Placeholder: Shows "https://example.com" as an example format

HTTP Method Selection

Choose the appropriate HTTP method for your API request:

  • GET: Retrieve data from the server

  • POST: Send data to create new resources

  • PUT: Update existing resources completely

  • PATCH: Partially update existing resources

  • DELETE: Remove resources from the server

Request Configuration

Headers (JSON)

Configure HTTP headers for your request:

  • Expandable Section: Click to reveal the headers input area

  • JSON Format: Enter headers as JSON key-value pairs

  • Beautify Option: Format your JSON for better readability

  • Common Headers:

    • Content-Type: Specify the request body format

    • Authorization: Include authentication tokens

    • Accept: Define expected response format

    • User-Agent: Identify the requesting application

JSON Request Body

Configure the request payload for POST, PUT, and PATCH requests:

  • Expandable Section: Click to reveal the request body input area

  • JSON Format: Enter request data as JSON

  • Beautify Option: Format your JSON for better readability

  • Connection Point: Can receive request body data from other workflow nodes

Query Parameters

Add URL query parameters to your request:

  • Expandable Section: Click to reveal query parameter configuration

  • Key-Value Pairs: Enter parameter names and values

  • Add Parameters: Click the add button to include additional parameters

  • Remove Parameters: Delete unwanted parameters using the remove button

Authentication

Configure authentication credentials:

  • Expandable Section: Click to reveal authentication options

  • Username Field: Enter authentication username

  • Password Field: Enter authentication password

  • Connection Points: Can receive credentials from other workflow nodes

  • Basic Auth: Automatically handles HTTP Basic Authentication

Parameter Management

Adding Query Parameters

  1. Expand the Query Params section

  2. Enter the parameter name in the "Key" field

  3. Enter the parameter value in the "Value" field

  4. Use the add button to include additional parameters

Header Configuration

  1. Expand the Headers (JSON) section

  2. Enter headers in JSON format

  3. Use the Beautify button to format your JSON

  4. Include necessary headers like Content-Type and Authorization

Request Body Setup

  1. Expand the JSON Request Body section

  2. Enter your request payload in JSON format

  3. Use the Beautify button to format your JSON

  4. Ensure the JSON is valid before sending

Authentication Setup

Basic Authentication

Configure username and password authentication:

  • Username: Enter the authentication username

  • Password: Enter the corresponding password

  • Automatic Handling: The node automatically formats credentials for HTTP Basic Auth

  • Security: Credentials are securely transmitted with the request

Token-Based Authentication

Use the Headers section for token-based authentication:

  • Authorization Header: Add "Authorization": "Bearer YOUR_TOKEN"

  • API Key Headers: Include custom API key headers as required

  • Custom Authentication: Support for any header-based authentication scheme

Request Execution

Send Request Button

Execute your configured API call:

  • Send Request: Click to initiate the HTTP request

  • Processing: The node sends the request with all configured parameters

  • Response Handling: Receives and processes the API response

Output Handling

Response Display

View API responses in the Output section:

  • Response Data: Complete API response displayed in the output area

  • Status Information: HTTP status codes and response details

  • Connection Point: Response data can be passed to other workflow nodes

  • Error Handling: Displays error messages and troubleshooting information

Best Practices

Request Configuration

  • URL Validation: Ensure URLs are complete and properly formatted

  • Method Selection: Choose appropriate HTTP methods for your operations

  • Header Requirements: Include necessary headers like Content-Type

  • Authentication: Properly configure credentials and tokens

Data Formatting

  • JSON Validation: Use the Beautify feature to validate JSON structure

  • Parameter Encoding: Ensure special characters in parameters are properly encoded

  • Content Types: Match Content-Type headers with request body format

Error Management

  • Status Codes: Monitor HTTP status codes for successful requests

  • Response Validation: Check response format and structure

  • Timeout Handling: Account for potential network delays

  • Authentication Errors: Verify credentials and token validity

Use Cases

Data Retrieval

  • API Integration: Fetch data from external services

  • Real-Time Data: Access current information from live APIs

  • Content Aggregation: Combine data from multiple API sources

Data Submission

  • Form Processing: Submit form data to external services

  • Content Creation: Create resources via API endpoints

  • Notification Services: Send alerts and messages through APIs

Workflow Integration

  • Conditional Requests: Use with decision nodes for dynamic API calls

  • Data Processing: Process API responses with other workflow nodes

  • Automation: Integrate external services into automated workflows

The API Caller node provides comprehensive HTTP client functionality, enabling seamless integration between FluxPrompt workflows and external web services.

Did this answer your question?