Event Handling
The globalMOO API provides event notifications for important state changes and asynchronous operations.
Event Format
Events follow this structure:
{
"id": 123,
"created_at": "2025-01-31T10:00:00.000Z",
"updated_at": "2025-01-31T10:00:00.000Z",
"disabled_at": null,
"name": "project.created",
"subject": "optional-subject-id",
"data": {
// Event-specific data object
}
}Event Types
project.created
New project created
Project
inverse.suggested
New inverse step suggested
Inverse
SDK Event Handling
Validation & Error Handling
Events are validated before processing:
Basic JSON validation
Required fields check
Event name validation
Data type mapping
Field type validation
Possible exceptions:
InvalidArgumentException: Invalid JSON or missing fields
InvalidEventException: Unknown event type
ValidationException: Invalid data format
Example error handling:
Best Practices
Always validate event payloads
Use type-safe event handling
Implement idempotency checks
Log event processing
Handle errors gracefully
Process events asynchronously
Monitor event throughput
Integration Example
Complete webhook handler example:
Last updated