The OpCon API provides a way to send legacy or external events, similar to traditional messaging events used in older versions of OpCon. This feature is useful for backward compatibility and for integrating with systems that still rely on legacy event formats.
Use Cases
- Triggering legacy event handlers configured in OpCon.
- Sending console display messages for monitoring purposes.
- Integrating with external systems that use legacy event formats.
Example Request
Below is a PowerShell example that demonstrates how to send a legacy console display event using the OpCon API:
$body = @{
events = @(
@{
id = "1"
eventType = "ConsoleDisplay"
message = "Legacy event triggered via API"
}
)
} | ConvertTo-Json -Depth 3
Invoke-RestMethod -Uri "$url/events/legacy" -Method Post -Body $body -ContentType "application/json" -Headers @{Authorization = $token}
Considerations
- The API will confirm submission of the event but does not validate the success of the event execution.
- For validation, check the SAM log or other relevant logs in OpCon.
- This method is best used for compatibility and should be replaced with direct API calls when possible for better feedback and control.