Call External API
Connect to an external service or website
Call External API
Connect to an external service or website to send or receive data. You can use this to integrate with other apps, send data to third-party services, or fetch information from external sources.
Technical Name: CallExternalApiFunc
Properties
- Execution Mode: SYNC
- Type: NATIVE
- Category: External API
- Function ID:
8f7a2ea8-6d8a-4f2b-b8f6-9f6b6d8a2ea8
Input Schema
Required Parameters
| Parameter | Type | Description |
|---|---|---|
connectionId | string (uuid) | Connection containing URL, method, auth, and defaults |
Optional Parameters
| Parameter | Type | Description |
|---|---|---|
headers | object | Additional headers (overrides connection headers) |
queryParams | object | Additional query params (overrides connection params) |
body | string | JSON template with {variable} placeholders |
bodyVariables | object | Variables for {placeholder} substitution in body |
timeoutSeconds | integer | Request timeout in seconds (default: 30, max: 300) |
[Image placeholder: CallExternalApi configuration panel]
Input Example
{
"connectionId": "api-connection-uuid",
"headers": {
"X-Custom-Header": "value",
"Accept": "application/json"
},
"queryParams": {
"page": 1,
"limit": 50
},
"body": "{\"customerId\": \"{customerId}\", \"orderAmount\": {amount}}",
"bodyVariables": {
"customerId": "cust-123",
"amount": 250.00
},
"timeoutSeconds": 60
}Connection Configuration
API connections store reusable configuration:
{
"name": "Payment Gateway API",
"url": "https://api.payment-gateway.com/v1",
"method": "POST",
"headers": {
"Authorization": "Bearer ${API_KEY}",
"Content-Type": "application/json"
},
"timeout": 30
}[Image placeholder: Connection configuration screen]
Output Schema
| Field | Type | Description |
|---|---|---|
success | boolean | True if HTTP status 200-299 |
statusCode | integer | HTTP response status code |
headers | object | Response headers |
responseBody | any | Response body (parsed as JSON if possible) |
Output Example
{
"success": true,
"statusCode": 200,
"headers": {
"content-type": "application/json",
"x-rate-limit-remaining": "99"
},
"responseBody": {
"transactionId": "txn-789",
"status": "completed",
"amount": 250.00,
"currency": "USD",
"timestamp": "2024-01-15T10:30:00Z"
}
}[Image placeholder: API response visualization]
Use Cases
Payment Processing
Integrate with payment gateways:
Start → ValidatePayment → CallExternalApi(ProcessPayment) → UpdateOrder → EndData Synchronization
Sync data with external systems:
{
"connectionId": "crm-api-connection",
"body": "{\"name\": \"{customerName}\", \"email\": \"{email}\"}",
"bodyVariables": {
"customerName": "${fetchCustomer.output.name}",
"email": "${fetchCustomer.output.email}"
}
}Webhook Callbacks
Send data to webhook endpoints:
{
"connectionId": "webhook-connection",
"body": "${prepareWebhookPayload.output.payload}"
}[Image placeholder: External API integration patterns]
HTTP Methods
Supported HTTP methods:
- GET: Retrieve data
- POST: Create resources
- PUT: Update resources (full)
- PATCH: Update resources (partial)
- DELETE: Remove resources
- HEAD: Get headers only
- OPTIONS: Get supported methods
Authentication
Bearer Token
{
"headers": {
"Authorization": "Bearer ${API_TOKEN}"
}
}API Key
{
"headers": {
"X-API-Key": "${API_KEY}"
}
}Basic Auth
{
"headers": {
"Authorization": "Basic ${BASE64_CREDENTIALS}"
}
}[Image placeholder: Authentication methods diagram]
Error Handling
HTTP Errors
{
"success": false,
"statusCode": 404,
"headers": {...},
"responseBody": {
"error": "Resource not found",
"code": "NOT_FOUND"
}
}Retry Logic
Implement retry with exponential backoff:
Start → CallExternalApi → CheckStatus → Retry(if failed) → End[Image placeholder: Retry logic workflow]
Best Practices
- Timeout Configuration: Set appropriate timeouts for different APIs
- Error Handling: Always check success field and status code
- Rate Limiting: Implement rate limiting for external APIs
- Secrets Management: Store API keys in environment variables
- Response Validation: Validate response structure before processing
- Logging: Log requests and responses for debugging
- Idempotency: Use idempotency keys for critical operations
Related Functions
- EmailNotification - Send emails
- JavaScript - Transform requests/responses
- SubFlow - Modular API integration
Workflow Example
Start
→ FetchOrder
→ PreparePayload
→ CallExternalApi(Payment Gateway)
→ CheckResponse
→ UpdateOrderStatus
→ EmailNotification
→ End[Image placeholder: Complete API integration workflow]
Limitations
- Maximum request size: 10MB
- Maximum response size: 50MB
- Timeout range: 1-300 seconds
- Maximum headers: 50 per request
[Image placeholder: API testing workflow]