Version 33.1 by michaely on 2015/07/13 20:28

Show last authors
1 {{layout}}
2 {{layout-section ac:type="two_right_sidebar"}}
3 {{layout-cell}}
4 {{info}}
5 The information on this page applies to **iSymphony 3.2+**.
6 {{/info}}
7
8 = (% style="color: rgb(0,0,0);" %)Description(%%) =
9
10 The websocket API provides realtime events about the current state of the iSymphony server. External applications can utilize this API to integrate with the iSymphony server, by reacting to events pertaining to users, and call state. In conjunction with the CRM widget, this API can also be utilized to create custom widgets for the iSymphony client interface.
11 {{/layout-cell}}
12
13 {{layout-cell}}
14 {{panel title="On this page:"}}
15
16
17 {{toc maxLevel="2" indent="1"/}}
18 {{/panel}}
19 {{/layout-cell}}
20 {{/layout-section}}
21
22 {{layout-section ac:type="single"}}
23 {{layout-cell}}
24
25
26 = Connecting To The Websocket =
27
28 The following URL can be used to connect to the websocket event API:
29
30 {{code}}
31 ws://manager:manag3rpa55word@<hostname or ip of the iSymphony server>:58080/communication_manager/ws/event
32 {{/code}}
33
34 = (% style="color: rgb(0,0,0);" %)Security(%%) =
35
36 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>>url:http://docs.getisymphony.com/display/ISYMDOCS/Security||shape="rect"]] for more information.
37
38 {{info}}
39 When securing the rest API with SSL, the URL used to connect to the Event API websocket must use** wss and port 55050**, instead of ws and port 58080.
40 {{/info}}
41
42 (% class="confluence-information-macro confluence-information-macro-information" %)
43 = JSON =
44
45 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.
46
47 = Object IDs =
48
49 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>>doc:Live API]], allowing collaboration between the Live REST API and the Event API.
50
51 {{note title="Note on UUID persistance"}}
52 The UUIDs do not persist across restarts of the iSymphony server. If the server is restarted, the objects will contain new UUIDs. Also, if an object is destroyed then re-added, even with the same configuration, the UUID that represents that object will be different from the original.
53 {{/note}}
54
55 = Event Filtering =
56
57 The Event API allows connections to specify which events they want to receive from the websocket, by specifying property filters.
58
59 {{info}}
60 **Filters specify which events to filter in**, not filter out.
61 {{/info}}
62
63 == The Filter Message ==
64
65 A message, with the following format, can be sent to the websocket, in order to set the current filters for the connection.
66
67 {{code language="js"}}
68 {
69 "type" : "filter",
70 "filters" : [
71 {"property" : "<property name>" : "value" : "<filter value>"},
72 {"property" : "<property name>" : "value" : "<filter value>"},
73 ...
74 ]
75 }
76 {{/code}}
77
78 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.
79
80
81
82 {{info}}
83 If an event does not contain a property specified in one of the filters, the event will not be received.
84 {{/info}}
85
86 == Filter Message Response ==
87
88 When a filter message is sent, the websocket will respond with one of the following messages:
89
90 == Wildcard ==
91
92 If you specify a value of **"*"** for a filter property value, the property filter will match on any value of the property.
93
94 == Examples ==
95
96 The following filter will only allow events of type dial:
97
98 {{code language="js"}}
99 {
100 "type" : "filter",
101 "filters" : [
102 {"property" : "type" : "value" : "dial"}
103 ]
104 }
105 {{/code}}
106
107 The following filter will only allow events of type login and logout:
108
109 {{code language="js"}}
110 {
111 "type" : "filter",
112 "filters" : [
113 {"property" : "type" : "value" : "login"},
114 {"property" : "type" : "value" : "logout"}
115 ]
116 }
117 {{/code}}
118
119 The following filter will only allow events of type login and logout, for user mikey.
120
121 {{code language="js"}}
122 {
123 "type" : "filter",
124 "filters" : [
125 {"property" : "type" : "value" : "login"},
126 {"property" : "type" : "value" : "logout"},
127 {"property" : "username" : "value" : "mikey"}
128 ]
129 }
130 {{/code}}
131
132 The following filter will only allow events that reference a user:
133
134 {{code language="js"}}
135 {
136 "type" : "filter",
137 "filters" : [
138 {"property" : "username" : "value" : "*"}
139 ]
140 }
141 {{/code}}
142
143 = REST Resources =
144
145 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.
146
147 == Resource List ==
148
149
150
151 {{children/}}
152
153 == Notes on Resource Documentation ==
154
155 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.
156
157 * **Root Resource Paths : **Specifies paths that can be used to access sets (multiple instances) of a resource, in relation to a parent resource.
158 * **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.
159 * **Sub Resource Paths : **Specifies paths that provide access to the child resources, of a specific resource instance. These paths require an **Instance Resource Path.**
160 * **Action Paths: **Specifies paths that are used to perform actions on a specific resource instance. These paths require an **Instance Resource Path.**
161
162 \\
163 {{/layout-cell}}
164 {{/layout-section}}
165 {{/layout}}