API connections allow you to send and receive EDI files via HTTP/HTTPS endpoints. This is useful for integrating with custom systems, webhooks, or partners with API-based interfaces.
When to Use API Connections
API connections are best for:
- Partners with REST API endpoints for file delivery
- Custom integrations with business applications
- Webhook-based workflows
- Real-time file delivery needs
Information You Need
Get the following from your partner:
| Information | Required | Description |
|---|---|---|
| Endpoint URL | Yes | The URL where files should be sent |
| HTTP Method | Yes | POST, PUT, GET, or PATCH |
| Authentication | Optional | Credentials if the API requires authentication (see below) |
| Health Check URL | Optional | Endpoint to test connectivity |
| Payload Format | Optional | Custom payload template if required |
Note: A credential is optional for API connections. Some APIs do not require authentication, in which case you can select "None" for the credential or skip it entirely during setup.
Authentication Methods
Modalius supports several authentication methods for API connections. If the API does not require authentication, you can leave the credential unset.
Basic Authentication
Username and password sent in the Authorization header. Credentials are base64-encoded.
API Key / Header Value
A token or key sent in a custom header. You specify:
- Header name - e.g., "X-API-Key" or "Authorization"
- Prefix - Optional, e.g., "Bearer" or "Token"
- Value - The API key or token
OAuth 2.0
Token-based authentication using OAuth 2.0 flow. Modalius will:
- Request an access token from the OAuth endpoint
- Include the token in subsequent requests
- Refresh tokens as needed
To enable OAuth, click Add OAuth during connection setup and provide the Token URL, request method, OAuth credential, and optional header prefix.
File Delivery Options
Files can be delivered in two formats:
Multipart Form (Default)
File is sent as a multipart form attachment. This is the standard approach for file uploads.
Custom Payload
For partners requiring a specific JSON or XML format, you can define a custom payload template. Use placeholders:
[[filename]]- Replaced with the file name[[filecontent]]- Replaced with base64-encoded file content
Setting Up an API Connection
- Navigate to Connections & Routing in the sidebar
- Click Add Connection
- Select API as the connection type
- Enter a Connection Name and the Endpoint URL
- Select the HTTP Method (POST, GET, PUT, or PATCH) and set the Expected Response Code
- Optionally select or create a credential for authentication (select "None" if the API does not require it)
- Optionally define a Payload Specification for custom request formats
- Optionally click Add Health Check to configure a health check endpoint and method
- Optionally click Add OAuth to configure OAuth 2.0 token-based authentication
- Click Save
- Test the connection to verify it works
Adding Routing Rules
After creating the connection, add routing rules to control how files are delivered:
- Open the connection detail page
- Go to the Routing Rules tab
- Click Add a Routing Rule
- Configure the direction, business unit, and any file filters
- Click Save
Connection Health
If you configure a health check URL, Modalius will:
- Monitor the endpoint availability
- Update the connection health indicator
- Queue files if the endpoint becomes unreachable
- Automatically retry when connectivity is restored
Security: All credentials are encrypted and stored securely. Never share API keys or tokens. Rotate them regularly for security.
Comments
0 comments
Please sign in to leave a comment.