Overview #
The API Call Node is a powerful tool for connecting your WordPress site to external services, internal WordPress APIs, and third-party platforms. This node allows you to send requests to any API endpoint and process the responses, enabling endless integration possibilities.
Key Features #
- Multiple HTTP Methods: Support for GET, POST, PUT, DELETE, PATCH, HEAD, and OPTIONS requests
- Dynamic Parameters: Insert data from previous nodes into your API calls
- Authentication Support: Basic auth, Bearer tokens, and API keys
- Smart Data Extraction: Easily pull specific data from complex responses
- Request Caching: Improve performance by caching API responses
- Built-in Testing: Test your API calls directly in the editor
- Error Handling: Retry capabilities for failed requests
Basic Configuration #
Setting Up an API Call #
- Node Name: Give your node a descriptive name
- HTTP Method: Choose from GET, POST, PUT, DELETE, etc.
- URL: Enter the API endpoint URL
- Query Parameters: Add key-value pairs for URL parameters
- Headers: Set request headers like Content-Type
- Body: Add JSON data for POST/PUT requests
- Authentication: Configure security credentials
- Response Settings: Specify how to extract and process the response
Practical Examples #
1. WooCommerce Product Management #
Scenario: Fetch and display product information from your WooCommerce store.
Setup:
- Method: GET
- URL:
/wp-json/wc/v3/products
- Authentication:
- Type: Basic Auth
- Username: Your WooCommerce API key
- Password: Your WooCommerce API secret
- Response Extraction:
products.*.name
to get all product names
Extended Example: Create a workflow that updates product stock based on external inventory systems:
- First Node: API Call to external inventory system
- Extract inventory data with
inventory.*.stock
- Extract inventory data with
- Second Node: API Call to WooCommerce
- Method: PUT
- URL:
/wp-json/wc/v3/products/[[product_id]]
- Body:
{"stock_quantity": [[inventory_count]]}
This workflow automatically synchronizes your WooCommerce inventory with external systems.
2. Weather-Based Content #
Scenario: Display weather-specific content based on user location.
Setup:
- Method: GET
- URL:
https://api.weatherapi.com/v1/current.json
- Query Parameters:
- key: Your Weather API key
- q:
[[user_location]]
(dynamic from previous node)
- Response Extraction:
current.condition.text
to get current weather
Application: Use this in a Chat Node to provide weather-specific recommendations:
If the weather is [[weather_condition]], I recommend the following products:
- Rain: Our waterproof jackets
- Sun: Our UV-protective hats
- Snow: Our insulated boots
3. CRM Integration with HubSpot #
Scenario: Add new contacts to HubSpot when users submit a form.
Setup:
- Method: POST
- URL:
https://api.hubapi.com/crm/v3/objects/contacts
- Headers:
- Content-Type: application/json
- Authorization: Bearer
[[hubspot_token]]
- Body:
{
"properties": {
"email": "[[user_email]]",
"firstname": "[[user_name]]",
"phone": "[[user_phone]]",
"website": "[[user_website]]"
}
}
- Response Extraction:
id
to get the new contact ID
Workflow: Form submission → Format data → API Call to HubSpot → Email notification with confirmation
4. Automating WooCommerce Order Processing #
Scenario: Send order details to a fulfillment service when an order status changes to “processing”.
Setup:
- Method: POST
- URL:
https://your-fulfillment-service.com/api/orders
- Headers:
- Content-Type: application/json
- API-Key:
[[fulfillment_api_key]]
- Body:
{
"order_id": "[[order_id]]",
"customer": {
"name": "[[customer_name]]",
"address": "[[shipping_address]]"
},
"items": [[order_items]],
"shipping_method": "[[shipping_method]]"
}
Implementation Steps:
- Set up a Trigger Node for WooCommerce order status changes
- Use a Conditional Node to check if the status is “processing”
- Use an API Call Node to fetch complete order details from WooCommerce
- Use another API Call Node to send the formatted data to your fulfillment service
- Add a Notification Node to alert staff of the handoff
5. Currency Conversion for International Pricing #
Scenario: Update product prices based on current exchange rates.
Setup:
- Method: GET
- URL:
https://api.exchangerate.host/latest
- Query Parameters:
- base: USD
- Response Extraction:
rates.EUR
to get the USD to EUR exchange rate
Application: Create a workflow that:
- Fetches base prices from your database
- Gets current exchange rates via API Call
- Calculates prices in different currencies
- Updates products with new international prices
6. Content Translation Service #
Scenario: Automatically translate blog posts for international audiences.
Setup:
- Method: POST
- URL:
https://translation-service.com/api/translate
- Headers:
- Content-Type: application/json
- Authorization: Bearer
[[translation_api_key]]
- Body:
{
"text": "[[post_content]]",
"source_language": "en",
"target_language": "es"
}
- Response Extraction:
translated_text
to get the translated content
Implementation: When publishing a post in English, automatically create Spanish, French, and German versions with translated content.
Advanced Features #
Data Extraction #
The API Call Node features a simplified, intuitive data extraction system that makes it easy to pull exactly what you need from complex API responses. This system is designed to be more straightforward than traditional JSONPath while still providing powerful capabilities.
Basic Extraction Patterns #
For straightforward data access:
- Direct field access:
fieldname
– Get values for a specific field directly- Example: In
{"user": "John"}
, the patternuser
returns"John"
- Example: In
- Array indexing:
0.fieldname
– Get a field from the first item in an array- Example: In
[{"name": "John"}]
, the pattern0.name
returns"John"
- Example: In
- Nested navigation:
users.0.name
– Navigate through nested structures- Example: In
{"users": [{"name": "John"}]}
, the patternusers.0.name
returns"John"
- Example: In
Finding Specific Values #
To locate items that match certain criteria:
- Equality filtering:
id=123.price
– Find the item where the id is 123, then return its price- Example: In
[{"id": 123, "price": 99.99}, {"id": 456, "price": 149.99}]
, this returns99.99
- Example: In
- String matching:
name="Product X".description
– Find the item where name equals “Product X”, then return its description- Example: In a product catalog, find a specific product by name and get its description
- Numeric comparison:
price>100.name
– Find all items with price greater than 100, return their names- Example: In a product list, get names of all premium products
Working with Arrays #
When dealing with arrays of data:
- Full array:
products
– Return the entire products array- Example: In
{"products": [...]}
, get all products
- Example: In
- First item:
products.0
– Get the first product in the array- Example: In
{"products": [{"name": "Widget", "price": 19.99}, ...]}
, get the first product object
- Example: In
- Specific property:
products.0.price
– Get the price of the first product- Example: Return just
19.99
from the above data
- Example: Return just
- All matches:
products.*.price
– Get prices of all products (returns an array of prices)- Example: From a product list, get all prices as an array like
[19.99, 29.99, 39.99]
- Example: From a product list, get all prices as an array like
Comparison Operations #
The extraction pattern supports these comparison operations:
=
Equal to (example:status="active"
)>
Greater than (example:price>100
)<
Less than (example:stock<10
)>=
Greater than or equal to (example:rating>=4
)<=
Less than or equal to (example:discount<=50
)!=
Not equal to (example:status!="deleted"
)
Real-World Examples #
WooCommerce Products API:
For a response like:
{
"products": [
{"id": 101, "name": "Smartphone", "price": 699.99, "categories": [{"id": 5, "name": "Electronics"}], "stock_status": "instock"},
{"id": 102, "name": "T-shirt", "price": 29.99, "categories": [{"id": 8, "name": "Apparel"}], "stock_status": "instock"},
{"id": 103, "name": "Bluetooth Speaker", "price": 89.99, "categories": [{"id": 5, "name": "Electronics"}], "stock_status": "outofstock"}
]
}
Useful extraction patterns:
products.*.name
– Get all product namesproducts.categories.name="Electronics".*.name
– Get names of all Electronics productsproducts.stock_status="outofstock".*.id
– Get IDs of out-of-stock productsproducts.price<50.name
– Get names of products under $50products.id=102
– Get all data for product with ID 102
Order API Response:
For an order response like:
{
"id": 12345,
"customer": {
"id": 42,
"name": "Jane Smith",
"email": "jane@example.com"
},
"items": [
{"product_id": 101, "name": "Smartphone", "quantity": 1, "price": 699.99},
{"product_id": 102, "name": "T-shirt", "quantity": 2, "price": 29.99}
],
"shipping": {
"method": "express",
"address": {
"street": "123 Main St",
"city": "Anytown",
"zip": "12345"
}
},
"totals": {
"subtotal": 759.97,
"tax": 45.60,
"shipping": 15.00,
"total": 820.57
}
}
Useful extraction patterns:
customer.name
– Get customer nameitems.*.product_id
– Get all product IDs in the ordershipping.address.city
– Get the shipping cityitems.quantity>1.name
– Get names of products ordered in quantity greater than 1totals.total
– Get the order total amount
Tips for Effective Extraction #
- Examine the API response first – Use the Test tab to see the actual structure
- Start simple – Extract top-level fields first, then add complexity
- Use dots (.) for nesting – Navigate through objects with dot notation
- Use conditions wisely – Conditions help find specific items in complex data
- Extract only what you need – Don’t pull the entire response if you only need specific fields
Authentication Methods #
Choose the right authentication method for your API:
- No Auth: Public APIs that don’t require authentication
- Basic Auth: Username and password encoded in the request header
- Bearer Token: JWT or OAuth access tokens
- API Key: A key sent either in headers, query parameters, or request body
Response Caching #
Improve performance by caching API responses:
- Enable “Cache Response” in the Response tab
- Set a cache duration (in seconds)
- The API Call Node will store responses and reuse them until the cache expires
This is especially useful for:
- Rate-limited APIs
- Slow external services
- Data that doesn’t change frequently
Retry Settings #
Handle temporary failures gracefully:
- Set a “Retry Count” in the Response tab
- The node will automatically retry failed requests
- A timeout setting lets you control how long to wait for responses
Troubleshooting #
Common Issues #
API returns an error status code:
- Check your authentication details
- Verify the URL and parameters
- Use the Test feature to see the exact error message
- Check the API documentation for specific requirements
Extraction pattern not working:
- Examine the actual API response in the Test tab
- Verify that the data structure matches your extraction pattern
- Try simpler patterns first, then add complexity
Rate limiting or throttling:
- Implement response caching
- Add delay nodes between multiple API calls
- Consider batching multiple operations into a single request
Testing Tips #
Always test your API calls before connecting them to other nodes:
- Click the “Test” button in the node header
- Review the response in the Test tab
- Try different extraction patterns to ensure you’re getting the right data
- Check both successful and error responses
Security Best Practices #
- Don’t hardcode sensitive credentials in the node settings
- Set appropriate cache times to balance performance and data freshness
- Consider using webhook-based approaches for sensitive operations
Integration Ideas #
- Connect to email marketing platforms (Mailchimp, SendGrid)
- Integrate with payment processors (Stripe, PayPal)
- Fetch data from analytics services (Google Analytics, Matomo)
- Connect to social media platforms (Twitter, Instagram, Facebook)
- Integrate with project management tools (Trello, Asana, JIRA)
- Pull data from CRMs (Salesforce, HubSpot)
- Connect to AI services (OpenAI, Google AI, Claude)
The API Call Node is your gateway to connecting WP AI Workflows with virtually any external service, making it one of the most versatile and powerful nodes in your toolkit.