HTTP Request
The HTTP Request node provides a flexible way to make HTTP calls to any API or web service. Unlike service-specific nodes that are pre-configured for particular APIs, this node gives you complete control over request configuration, making it ideal for custom integrations and APIs that don't have dedicated Splice nodes.
Overview
The HTTP Request node is essential when you need to:
- Integrate custom APIs - Connect to proprietary or internal systems
- Call third-party services - Access APIs that don't have dedicated Splice nodes
- Prototype integrations - Test API calls before building dedicated nodes
- Handle dynamic endpoints - Construct URLs based on workflow data
- Implement webhooks - Send data to external systems
- Fetch external data - Retrieve information from web services
Configuration
Request Method
Choose the appropriate HTTP method for your API call:
- 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
- HEAD - Get headers without response body
URL Configuration
- Base URL - The endpoint you want to call
- Dynamic URLs - Use workflow data to construct URLs
- Query parameters - Add URL parameters for filtering or configuration
- Path variables - Include dynamic segments in the URL path
Headers
Configure HTTP headers for authentication and content specification:
- Authentication headers - API keys, bearer tokens, basic auth
- Content-Type - Specify request body format (JSON, XML, form data)
- Accept - Define expected response format
- Custom headers - Add any required headers for your API
- Dynamic headers - Use workflow data in header values
Request Body
For POST, PUT, and PATCH requests:
- JSON - Send structured data as JSON
- Form data - Submit form-encoded data
- Raw text - Send plain text or custom formats
- Binary data - Upload files or binary content
- Dynamic content - Use workflow data to construct request body
Authentication
Support for various authentication methods:
- API Key - In headers, query parameters, or custom locations
- Bearer Token - OAuth and JWT token authentication
- Basic Auth - Username and password authentication
- Custom Auth - Implement custom authentication schemes
- No Auth - For public APIs or pre-authenticated requests
Response Handling
Response Data
- JSON parsing - Automatically parse JSON responses
- XML parsing - Handle XML response formats
- Text responses - Process plain text or custom formats
- Binary responses - Handle file downloads or binary data
- Status codes - Access HTTP status codes for error handling
Error Handling
- HTTP errors - Handle 4xx and 5xx status codes
- Network errors - Manage connection timeouts and failures
- Parsing errors - Handle malformed response data
- Custom error logic - Define specific error handling rules
Example Usage
Simple GET Request
Method: GET
URL: https://api.example.com/shipments/{{data.trackingNumber}}
Headers:
Authorization: Bearer {{credentials.apiToken}}
Accept: application/json
POST with JSON Data
Method: POST
URL: https://api.logistics.com/shipments
Headers:
Content-Type: application/json
Authorization: API-Key {{credentials.apiKey}}
Body:
{
"tracking_number": "{{data.trackingNumber}}",
"status": "{{data.status}}",
"location": "{{data.currentLocation}}",
"timestamp": "{{data.lastUpdate}}"
}
Dynamic URL Construction
Method: GET
URL: https://{{data.region}}.api.carrier.com/v2/tracking/{{data.trackingId}}
Query Parameters:
format: json
include_history: true
api_version: 2.1
File Upload
Method: POST
URL: https://api.documents.com/upload
Headers:
Authorization: Bearer {{credentials.token}}
Body Type: Form Data
Fields:
file: {{data.documentFile}}
document_type: BOL
shipment_id: {{data.shipmentId}}
Webhook Notification
Method: POST
URL: {{data.webhookUrl}}
Headers:
Content-Type: application/json
X-Signature: {{data.signature}}
Body:
{
"event": "shipment.delivered",
"shipment_id": "{{data.shipmentId}}",
"delivered_at": "{{data.deliveryTime}}",
"location": "{{data.deliveryLocation}}"
}
Advanced Features
Timeout Configuration
- Request timeout - Maximum time for complete request/response
- Custom timeouts - Different timeouts for different endpoints
Response Processing
- Data extraction - Pull specific fields from responses
- Response transformation - Convert response format
- Conditional processing - Handle responses based on status or content
- Response caching - Store responses for subsequent use
Best Practices
URL and Parameter Management
- Use variables - Leverage workflow data for dynamic URLs
- Validate URLs - Ensure URLs are properly formatted
- Encode parameters - Properly encode query parameters and path segments
- Document endpoints - Keep track of API documentation and requirements
Authentication Security
- Use credentials store - Never hardcode API keys or tokens
- Rotate credentials - Regularly update API keys and tokens
- Least privilege - Use credentials with minimal required permissions
- Monitor usage - Track API calls for security and billing
Error Handling
- Check status codes - Always verify HTTP response status
- Log errors - Capture error details for troubleshooting
- Graceful degradation - Continue workflow when possible despite API failures
Performance Optimization
- Minimize requests - Batch operations when APIs support it
- Use appropriate timeouts - Balance responsiveness with reliability
- Cache responses - Store frequently accessed data
- Monitor performance - Track response times and success rates
Common Patterns
API Polling
Regularly check for updates from external systems:
Scheduled Trigger → HTTP Request (GET status) → Process Response → Update Database
Data Synchronization
Keep external systems updated with workflow data:
Data Change → Transform Data → HTTP Request (POST/PUT) → Verify Response
Webhook Delivery
Send notifications to external systems:
Event Trigger → Format Payload → HTTP Request (POST) → Handle Response
Multi-step API Workflows
Chain multiple API calls for complex operations:
HTTP Request (Auth) → Extract Token → HTTP Request (Data) → Process Results
Troubleshooting
Common Issues
- Authentication failures - Verify credentials and header format
- Timeout errors - Check network connectivity and increase timeouts
- Malformed requests - Validate JSON syntax and required fields
- Rate limiting - Implement delays and retry logic
Debugging Tips
- Test externally - Use tools like Postman to verify API behavior
- Check logs - Review request/response details in workflow logs
- Validate data - Ensure workflow data matches API requirements
- Monitor responses - Track API response patterns and errors
Response Validation
- Status codes - Verify successful response codes (200-299)
- Response format - Ensure response matches expected structure
- Required fields - Check that necessary data is present
- Data types - Validate that response data types are correct
The HTTP Request node provides the flexibility to integrate with virtually any web API, making it an essential tool for custom integrations in your logistics workflows.