Shuffle RESTful URL's around.
[asterisk/asterisk.git] / rest-api / api-docs / events.json
1 {
2         "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.",
3         "_author": "David M. Lee, II <dlee@digium.com>",
4         "_svn_revision": "$Revision$",
5         "apiVersion": "0.0.1",
6         "swaggerVersion": "1.1",
7         "basePath": "http://localhost:8088/stasis",
8         "resourcePath": "/api-docs/events.{format}",
9         "apis": [
10                 {
11                         "path": "/events",
12                         "description": "Events from Asterisk to applications",
13                         "operations": [
14                                 {
15                                         "httpMethod": "GET",
16                                         "upgrade": "websocket",
17                                         "websocketProtocol": "ari",
18                                         "summary": "WebSocket connection for events.",
19                                         "nickname": "eventWebsocket",
20                                         "responseClass": "Event",
21                                         "parameters": [
22                                                 {
23                                                         "name": "app",
24                                                         "description": "Comma seperated list of applications to subscribe to.",
25                                                         "paramType": "query",
26                                                         "required": true,
27                                                         "allowMultiple": true,
28                                                         "dataType": "string"
29                                                 }
30                                         ]
31                                 }
32                         ]
33                 }
34         ],
35         "models": {
36                 "Event": {
37                         "id": "Event",
38                         "description": "Asynchronous events from Asterisk. The non-required fields of this object are mutually exclusive.",
39                         "properties": {
40                                 "application": {
41                                         "type": "string",
42                                         "description": "Name of the application receiving the event.",
43                                         "required": true
44                                 },
45                                 "application_replaced": { "type": "ApplicationReplaced" },
46                                 "bridge_created": { "type": "BridgeCreated" },
47                                 "bridge_destroyed": { "type": "BridgeDestroyed" },
48                                 "bridge_merged": { "type": "BridgeMerged" },
49                                 "channel_created": { "type": "ChannelCreated" },
50                                 "channel_destroyed": { "type": "ChannelDestroyed" },
51                                 "channel_snapshot": { "type": "ChannelSnapshot" },
52                                 "channel_entered_bridge": { "type": "ChannelEnteredBridge" },
53                                 "channel_left_bridge": { "type": "ChannelLeftBridge" },
54                                 "channel_state_change": { "type": "ChannelStateChange" },
55                                 "channel_dtmf_received": { "type": "ChannelDtmfReceived" },
56                                 "channel_dialplan": { "type": "ChannelDialplan" },
57                                 "channel_caller_id": { "type": "ChannelCallerId" },
58                                 "channel_userevent": { "type": "ChannelUserevent" },
59                                 "channel_hangup_request": { "type": "ChannelHangupRequest" },
60                                 "channel_varset": { "type": "ChannelVarset" },
61                                 "stasis_end": { "type": "StasisEnd" },
62                                 "stasis_start": { "type": "StasisStart" },
63                                 "playback_started": { "type": "PlaybackStarted" },
64                                 "playback_finished": { "type": "PlaybackFinished" }
65                         }
66                 },
67                 "PlaybackStarted": {
68                         "id": "PlaybackStarted",
69                         "description": "Event showing the start of a media playback operation.",
70                         "properties": {
71                                 "playback": {
72                                         "type": "Playback",
73                                         "description": "Playback control object",
74                                         "required": true
75                                 }
76                         }
77                 },
78                 "PlaybackFinished": {
79                         "id": "PlaybackFinished",
80                         "description": "Event showing the completion of a media playback operation.",
81                         "properties": {
82                                 "playback": {
83                                         "type": "Playback",
84                                         "description": "Playback control object",
85                                         "required": true
86                                 }
87                         }
88                 },
89                 "ApplicationReplaced": {
90                         "id": "ApplicationReplaced",
91                         "description": "Notification that another WebSocket has taken over for an application.",
92                         "notes": "An application may only be subscribed to by a single WebSocket at a time. If multiple WebSockets attempt to subscribe to the same application, the newer WebSocket wins, and the older one receives this event.",
93                         "properties": {
94                                 "application": {
95                                         "required": true,
96                                         "type": "string"
97                                 }
98                         }
99                 },
100                 "BridgeCreated": {
101                         "id": "BridgeCreated",
102                         "description": "Notification that a bridge has been created.",
103                         "properties": {
104                                 "bridge": {
105                                         "required": true,
106                                         "type": "Bridge"
107                                 }
108                         }
109                 },
110                 "BridgeDestroyed": {
111                         "id": "BridgeDestroyed",
112                         "description": "Notification that a bridge has been destroyed.",
113                         "properties": {
114                                 "bridge": {
115                                         "required": true,
116                                         "type": "Bridge"
117                                 }
118                         }
119                 },
120                 "BridgeMerged": {
121                         "id": "BridgeMerged",
122                         "description": "Notification that one bridge has merged into another.",
123                         "properties": {
124                                 "bridge": {
125                                         "required": true,
126                                         "type": "Bridge"
127                                 },
128                                 "bridge_from": {
129                                         "required": true,
130                                         "type": "Bridge"
131                                 }
132                         }
133                 },
134                 "ChannelCreated": {
135                         "id": "ChannelCreated",
136                         "description": "Notification that a channel has been created.",
137                         "properties": {
138                                 "channel": {
139                                         "required": true,
140                                         "type": "Channel"
141                                 }
142                         }
143                 },
144                 "ChannelSnapshot": {
145                         "id": "ChannelSnapshot",
146                         "description": "Some part of channel state changed.",
147                         "properties": {
148                                 "channel": {
149                                         "required": true,
150                                         "type": "Channel"
151                                 }
152                         }
153                 },
154                 "ChannelDestroyed": {
155                         "id": "ChannelDestroyed",
156                         "description": "Notification that a channel has been destroyed.",
157                         "properties": {
158                                 "cause": {
159                                         "required": true,
160                                         "description": "Integer representation of the cause of the hangup",
161                                         "type": "integer"
162                                 },
163                                 "cause_txt": {
164                                         "required": true,
165                                         "description": "Text representation of the cause of the hangup",
166                                         "type": "string"
167                                 },
168                                 "channel": {
169                                         "required": true,
170                                         "type": "Channel"
171                                 }
172                         }
173                 },
174                 "ChannelEnteredBridge": {
175                         "id": "ChannelEnteredBridge",
176                         "description": "Notification that a channel has entered a bridge.",
177                         "properties": {
178                                 "bridge": {
179                                         "required": true,
180                                         "type": "Bridge"
181                                 },
182                                 "channel": {
183                                         "type": "Channel"
184                                 }
185                         }
186                 },
187                 "ChannelLeftBridge": {
188                         "id": "ChannelLeftBridge",
189                         "description": "Notification that a channel has left a bridge.",
190                         "properties": {
191                                 "bridge": {
192                                         "required": true,
193                                         "type": "Bridge"
194                                 },
195                                 "channel": {
196                                         "required": true,
197                                         "type": "Channel"
198                                 }
199                         }
200                 },
201                 "ChannelStateChange": {
202                         "id": "ChannelStateChange",
203                         "description": "Notification of a channel's state change.",
204                         "properties": {
205                                 "channel": {
206                                         "required": true,
207                                         "type": "Channel"
208                                 }
209                         }
210                 },
211                 "ChannelDtmfReceived": {
212                         "id": "ChannelDtmfReceived",
213                         "description": "DTMF received on a channel.",
214                         "notes": "This event is sent when the DTMF ends. There is no notification about the start of DTMF",
215                         "properties": {
216                                 "digit": {
217                                         "required": true,
218                                         "type": "string",
219                                         "description": "DTMF digit received (0-9, A-E, # or *)"
220                                 },
221                                 "channel": {
222                                         "required": true,
223                                         "type": "Channel",
224                                         "description": "The channel on which DTMF was received"
225                                 }
226                         }
227                 },
228                 "ChannelDialplan": {
229                         "id": "ChannelDialplan",
230                         "description": "Channel changed location in the dialplan.",
231                         "properties": {
232                                 "application": {
233                                         "required": true,
234                                         "type": "string",
235                                         "description": "The application that the channel is currently in."
236                                 },
237                                 "application_data": {
238                                         "required": true,
239                                         "type": "string",
240                                         "description": "The data that was passed to the application when it was invoked."
241                                 },
242                                 "channel": {
243                                         "required": true,
244                                         "type": "Channel",
245                                         "description": "The channel that changed dialplan location."
246                                 }
247                         }
248                 },
249                 "ChannelCallerId": {
250                         "id": "ChannelCallerId",
251                         "description": "Channel changed Caller ID.",
252                         "properties": {
253                                 "caller_presentation": {
254                                         "required": true,
255                                         "type": "integer",
256                                         "description": "The integer representation of the Caller Presentation value."
257                                 },
258                                 "caller_presentation_txt": {
259                                         "required": true,
260                                         "type": "string",
261                                         "description": "The text representation of the Caller Presentation value."
262                                 },
263                                 "channel": {
264                                         "required": true,
265                                         "type": "Channel",
266                                         "description": "The channel that changed Caller ID."
267                                 }
268                         }
269                 },
270                 "ChannelUserevent": {
271                         "id": "ChannelUserevent",
272                         "description": "User-generated event with additional user-defined fields in the object.",
273                         "properties": {
274                                 "eventname": {
275                                         "required": true,
276                                         "type": "string",
277                                         "description": "The name of the user event."
278                                 },
279                                 "channel": {
280                                         "required": true,
281                                         "type": "Channel",
282                                         "description": "The channel that signaled the user event."
283                                 }
284                         }
285                 },
286                 "ChannelHangupRequest": {
287                         "id": "ChannelHangupRequest",
288                         "description": "A hangup was requested on the channel.",
289                         "properties": {
290                                 "cause": {
291                                         "type": "integer",
292                                         "description": "Integer representation of the cause of the hangup."
293                                 },
294                                 "soft": {
295                                         "type": "boolean",
296                                         "description": "Whether the hangup request was a soft hangup request."
297                                 },
298                                 "channel": {
299                                         "required": true,
300                                         "type": "Channel",
301                                         "description": "The channel on which the hangup was requested."
302                                 }
303                         }
304                 },
305                 "ChannelVarset": {
306                         "id": "ChannelVarset",
307                         "description": "Channel variable changed.",
308                         "properties": {
309                                 "variable": {
310                                         "required": true,
311                                         "type": "string",
312                                         "description": "The variable that changed."
313                                 },
314                                 "value": {
315                                         "required": true,
316                                         "type": "string",
317                                         "description": "The new value of the variable."
318                                 },
319                                 "channel": {
320                                         "required": true,
321                                         "type": "Channel",
322                                         "description": "The channel on which the variable was set."
323                                 }
324                         }
325                 },
326                 "StasisEnd": {
327                         "id": "StasisEnd",
328                         "description": "Notification that a channel has left a Stasis appliction.",
329                         "properties": {
330                                 "channel": {
331                                         "required": true,
332                                         "type": "Channel"
333                                 }
334                         }
335                 },
336                 "StasisStart": {
337                         "id": "StasisStart",
338                         "description": "Notification that a channel has entered a Stasis appliction.",
339                         "properties": {
340                                 "args": {
341                                         "required": true,
342                                         "type": "List[string]",
343                                         "description": "Arguments to the application"
344                                 },
345                                 "channel": {
346                                         "required": true,
347                                         "type": "Channel"
348                                 }
349                         }
350                 }
351         }
352 }