Websocket API Documentation (Event)
Connecting To The Websocket
The following URL can be used to connect to the websocket event API:
Security
By default the Event API websocket will be restricted via HTTP Realm Auth and ACLs. The default credentials will be set to manager:manag3rpa55word, and the ACLs will be set up to only allow connections from localhost. You can also secure the connection further with SSL encryption. See Security for more information.
sdfasdfasdfasdfasfd
JSON
All messages sent to or from the Event API websocket must be in JSON format. Each event will contain a set of properties providing details of the event. Each event documentation page will specify the JSON representation, and properties, of the event.
Object IDs
Most events generated by the event API will contain UUIDs that can be used to identify objects the event relates to. Some events will reference multiple ids. These UUIDs are the same ids that are used to reference resources in the Live REST API, allowing collaboration between the Live REST API and the Event API.
Event Filtering
The Event API allows connections to specify which events they want to receive from the websocket, by specifying property filters.
The Filter Message
A message, with the following format, can be sent to the websocket, in order to set the current filters for the connection.
"type" : "filter",
"filters" : [
{"property" : "<property name>" : "value" : "<filter value>"},
{"property" : "<property name>" : "value" : "<filter value>"},
...
]
}
Where <property name> is the name of the property to filter, and <filter value> is the property value to filter on. Multiple property filters can be specified.
Filter Message Response
When a filter message is sent, the websocket will respond with one of the following messages:
Wildcard
If you specify a value of "*" for a filter property value, the property filter will match on any value of the property.
Examples
The following filter will only allow events of type dial:
"type" : "filter",
"filters" : [
{"property" : "type" : "value" : "dial"}
]
}
The following filter will only allow events of type login and logout:
"type" : "filter",
"filters" : [
{"property" : "type" : "value" : "login"},
{"property" : "type" : "value" : "logout"}
]
}
The following filter will only allow events of type login and logout, for user mikey.
"type" : "filter",
"filters" : [
{"property" : "type" : "value" : "login"},
{"property" : "type" : "value" : "logout"},
{"property" : "username" : "value" : "mikey"}
]
}
The following filter will only allow events that reference a user:
"type" : "filter",
"filters" : [
{"property" : "username" : "value" : "*"}
]
}
REST Resources
The Live API exposes several REST resources, that allow access to the current state of specific objects in the system. All current live resources are listed below. Details concerning each resource, and their actions, can be found within the individual resource documentation pages.
Resource List
Notes on Resource Documentation
Due to the interdependent nature of resources in the system, the resource path information in the documentation is split into several sections. Paths in a specific section may relate to, or require, paths specified in other sections.
- Root Resource Paths : Specifies paths that can be used to access sets (multiple instances) of a resource, in relation to a parent resource.
- Instance Resource Paths : Specifies paths that can be used to access a specific instance of a resource. These paths require a Root Resource Path, in most cases, but not all.
- Sub Resource Paths : Specifies paths that provide access to the child resources, of a specific resource instance. These paths require an Instance Resource Path.
- Action Paths: Specifies paths that are used to perform actions on a specific resource instance. These paths require an Instance Resource Path.