Version 38.1 by michaely on 2015/07/13 20:25

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 (% class="confluence-information-macro confluence-information-macro-information" %)
39 (((
40 (% class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon" style="color: rgb(74,103,133);" %)
41
42 (% class="confluence-information-macro-body" %)
43 (((
44 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.
45
46 = (% style="color: rgb(0,0,0);" %)JSON(%%) =
47
48 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.
49 )))
50 )))
51
52 = Object IDs =
53
54 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.
55
56 {{note title="Note on UUID persistance"}}
57 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.
58 {{/note}}
59
60 = Event Filtering =
61
62 The Event API allows connections to specify which events they want to receive from the websocket, by specifying property filters.
63
64 {{info}}
65 **Filters specify which events to filter in**, not filter out.
66 {{/info}}
67
68 == The Filter Message ==
69
70 A message, with the following format, can be sent to the websocket, in order to set the current filters for the connection.
71
72 {{code language="js"}}
73 {
74 "type" : "filter",
75 "filters" : [
76 {"property" : "<property name>" : "value" : "<filter value>"},
77 {"property" : "<property name>" : "value" : "<filter value>"},
78 ...
79 ]
80 }
81 {{/code}}
82
83 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.
84
85
86
87 {{info}}
88 If an event does not contain a property specified in one of the filters, the event will not be received.
89 {{/info}}
90
91 == Filter Message Response ==
92
93 When a filter message is sent, the websocket will respond with one of the following messages:
94
95 == Wildcard ==
96
97 If you specify a value of **"*"** for a filter property value, the property filter will match on any value of the property.
98
99 == Examples ==
100
101 The following filter will only allow events of type dial:
102
103 {{code language="js"}}
104 {
105 "type" : "filter",
106 "filters" : [
107 {"property" : "type" : "value" : "dial"}
108 ]
109 }
110 {{/code}}
111
112 The following filter will only allow events of type login and logout:
113
114 {{code language="js"}}
115 {
116 "type" : "filter",
117 "filters" : [
118 {"property" : "type" : "value" : "login"},
119 {"property" : "type" : "value" : "logout"}
120 ]
121 }
122 {{/code}}
123
124 The following filter will only allow events of type login and logout, for user mikey.
125
126 {{code language="js"}}
127 {
128 "type" : "filter",
129 "filters" : [
130 {"property" : "type" : "value" : "login"},
131 {"property" : "type" : "value" : "logout"},
132 {"property" : "username" : "value" : "mikey"}
133 ]
134 }
135 {{/code}}
136
137 The following filter will only allow events that reference a user:
138
139 {{code language="js"}}
140 {
141 "type" : "filter",
142 "filters" : [
143 {"property" : "username" : "value" : "*"}
144 ]
145 }
146 {{/code}}
147
148 = REST Resources =
149
150 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.
151
152 == Resource List ==
153
154
155
156 {{children/}}
157
158 == Notes on Resource Documentation ==
159
160 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.
161
162 * **Root Resource Paths : **Specifies paths that can be used to access sets (multiple instances) of a resource, in relation to a parent resource.
163 * **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.
164 * **Sub Resource Paths : **Specifies paths that provide access to the child resources, of a specific resource instance. These paths require an **Instance Resource Path.**
165 * **Action Paths: **Specifies paths that are used to perform actions on a specific resource instance. These paths require an **Instance Resource Path.**
166
167 \\
168 {{/layout-cell}}
169 {{/layout-section}}
170 {{/layout}}