API Client Overview
Integrate WiLicensor licensing into your applications with our simple REST API.
Base URL
https://your-server.com/api
Replace your-server.com with your WiLicensor server address.
Authentication
The public API endpoints require no authentication. License validation is performed using:
- Encrypted key - Generated from the machine ID
- Email - User's email address
- Product name - Must match a registered product
Available Endpoints
| Endpoint | Purpose |
|---|---|
/api/check |
Validate a license key |
/api/find |
Find and activate a license with machine binding |
/api/gen |
Generate or retrieve a license key |
/api/replace |
Transfer license to a new machine |
Key Encryption
License keys are encrypted using the machine ID combined with the user's email for uniqueness. Your client application must:
- Get the unique machine identifier (hardware ID, volume serial, etc.)
- Combine with user's email:
machineId + email - Generate the encrypted key using the same algorithm as the server
- Send the encrypted key in API requests
Note: The server accepts both new format (machineId + email) and legacy format (machineId only) for backwards compatibility. New clients should use the combined format.
See language-specific documentation for encryption implementation.
Response Format
All responses are JSON. Successful responses return license data:
{
"key": "encrypted_key_string",
"condition": "activated",
"type": "trial",
"machineId": "abc123def456",
"productId": 1,
"email": "user@example.com",
"settings": "1",
"endAt": "2025-12-25T00:00:00.000Z"
}
Error responses:
{
"error": "Error description"
}
License Conditions
| Condition | Meaning |
|---|---|
activated |
License is active and valid |
purchased |
Paid license, not yet activated |
expired |
Trial or subscription has expired |
deactivated |
License was manually deactivated |
License Types
| Type | Meaning |
|---|---|
trial |
Time-limited trial license |
lifetime |
Permanent license |
subscription |
Recurring subscription |
demo |
Demo/evaluation license |
Client Libraries
- C# Client - For .NET/NinjaTrader applications
- Python Client - For Python applications
- JavaScript Client - For Node.js/browser applications
- Integration Examples - Common integration patterns
Error Handling
Always handle these scenarios:
- Network errors - Server unreachable
- Invalid key - Wrong encryption or tampering
- Expired license - Check
conditionandendAt - Machine mismatch - License bound to different machine
Rate Limiting
Currently no rate limiting is enforced. However, best practices:
- Cache license status locally
- Check license at startup and periodically (not every operation)
- Implement exponential backoff on failures