Wiki source code of Status

Version 9.1 by michaely on 2015/07/09 15:05

Show last authors
1 {{layout}}
2 {{layout-section ac:type="two_right_sidebar"}}
3 {{layout-cell}}
4 (% style="color: rgb(0,0,0);font-size: 24.0px;line-height: 1.25;" %)Description
5
6 The live status REST resource allows access to information about the status of a specific user in the system. ThisĀ resourceĀ also provides an action to update the status of a user.
7 {{/layout-cell}}
8
9 {{layout-cell}}
10 {{panel title="On this page:"}}
11
12
13 {{toc maxLevel="2" indent="1"/}}
14 {{/panel}}
15 {{/layout-cell}}
16 {{/layout-section}}
17
18 {{layout-section ac:type="single"}}
19 {{layout-cell}}
20 (% style="color: rgb(0,0,0);" %)
21
22
23 = (% style="color: rgb(0,0,0);" %)Root Resource Path(%%) =
24
25 {{code}}
26 communication_manager/rest/live/coreServers/[{core_server_id} | getByName/{core_server_slug}]/users/[{user_id} | getByName/{username}]/status
27 {{/code}}
28
29 = JSON Representation =
30
31 {{code}}
32 {
33 "id": "99c6c017-7c86-4d78-89ca-dbc1267ffe76",
34 "configurationId": "215734e0-383d-11e2-81c1-0800200c9a66",
35 "name": "Available",
36 "type": "available",
37 "note": "",
38 "returnTime": -1,
39 "userCreated": false
40 }
41 {{/code}}
42
43 |=(((
44 Property
45 )))|=(((
46 Type
47 )))|=(((
48 Description
49 )))
50 |(((
51 {{{id}}}
52 )))|(((
53 String
54 )))|(((
55 The id of the user status.
56 )))
57 |(% colspan="1" %)(% colspan="1" %)
58 (((
59 {{{configurationId}}}
60 )))|(% colspan="1" %)(% colspan="1" %)
61 (((
62 String
63 )))|(% colspan="1" %)(% colspan="1" %)
64 (((
65 The id of the configuration object that represents the user status.
66 )))
67 |(% colspan="1" %)(% colspan="1" %)
68 (((
69 {{{name}}}
70 )))|(% colspan="1" %)(% colspan="1" %)
71 (((
72 String
73 )))|(% colspan="1" %)(% colspan="1" %)
74 (((
75 The status name.
76 )))
77 |(% colspan="1" %)(% colspan="1" %)
78 (((
79 type
80 )))|(% colspan="1" %)(% colspan="1" %)
81 (((
82 String
83 )))|(% colspan="1" %)(% colspan="1" %)
84 (((
85 The status type. Determines the icon used for the status. See Status Types below.
86 )))
87 |(% colspan="1" %)(% colspan="1" %)
88 (((
89 (% style="font-family: monospace;" %)note
90 )))|(% colspan="1" %)(% colspan="1" %)
91 (((
92 String
93 )))|(% colspan="1" %)(% colspan="1" %)
94 (((
95 The note set for the status.
96 )))
97 |(% colspan="1" %)(% colspan="1" %)
98 (((
99 returnTime
100 )))|(% colspan="1" %)(% colspan="1" %)
101 (((
102 Long
103 )))|(% colspan="1" %)(% colspan="1" %)
104 (((
105 The time the user has set to return, or -1 if no return time has been set. Represented as a unix timestamp, in milliseconds.
106 )))
107 |(% colspan="1" %)(% colspan="1" %)
108 (((
109 userCreated
110 )))|(% colspan="1" %)(% colspan="1" %)
111 (((
112 Boolean
113 )))|(% colspan="1" %)(% colspan="1" %)
114 (((
115 True, if the status is a custom status set by the user; false, if the status is a pre-configured status.
116 )))
117
118 = Status Types =
119
120 The following is a list of accepted status types. These types will be used in the JSON representation of the status, and in the set action when changing the status.
121
122 {{info}}
123 The current status type set on a user does not effect call flow or any other actions in the panel. The status is simply used for informational purposes.
124 {{/info}}
125
126
127
128 * available
129 * unavailable
130 * away
131 * xa
132 * dnd
133 * chat
134 * altblue
135 * altgreen
136 * altpink
137 * altpurple
138 * altred
139
140 = Resource Paths =
141
142 |=(% colspan="2" %)(% colspan="2" %)
143 (((
144 {{{communication_manager/rest/live/coreServers/[{core_server_id} | getByName/{core_server_slug}]/users/[{user_id} | getByName/{username}]/status}}}
145 )))
146 |(% class="highlight-grey" data-highlight-colour="grey" %)(% class="highlight-grey" data-highlight-colour="grey" %)
147 (((
148 **Description**
149 )))|(((
150 Accesses the status state of a specified user, in a core server.
151
152 {{info}}
153 This resource will not be available if the user is not licensed/full, or no license is installed on the core server.
154 {{/info}}
155
156 (% style="line-height: 1.4285715;" %)**Parameters:**
157
158 * core_server_id: the id of the parent core server\\
159 * core_server_slug: the slug of the parent core server
160 * user_id: the id of the parent user
161 * user_name: the username of the parent user
162
163 **Errors:**
164
165 * 404 Not Found: Returned if no core server with the given id or slug exists
166 * 404 Not Found: Returned if no user with the given id or username exists in the specified core server
167 * 403 Forbidden: Returned if the user is not licensed/full, or no license is installed on the core server.
168 )))
169 |(% class="highlight-grey" data-highlight-colour="grey" %)(% class="highlight-grey" data-highlight-colour="grey" %)
170 (((
171 **GET**
172 )))|(((
173 Gets the status state of a specified user, in a core server.
174 )))
175
176 = Actions =
177
178 |=(% colspan="2" %)(% colspan="2" %)
179 (((
180 {{{communication_manager/rest/live/coreServers/[{core_server_id} | getByName/{core_server_slug}]/users/[{user_id} | getByName/{username}]/status/set}}}
181 )))
182 |(% class="highlight-grey" data-highlight-colour="grey" %)(% class="highlight-grey" data-highlight-colour="grey" %)
183 (((
184 **Description**
185 )))|(((
186 Updates the status of a user.
187
188 {{info}}
189 This action will not be available if the user is not licensed/full, or no license is installed on the core server.
190 {{/info}}
191
192
193
194 **Parameters:**
195
196 * core_server_id: the id of the parent core server\\
197 * core_server_slug: the slug of the parent core server
198 * user_id: the id of the user to update status on
199 * user_name: the username of the user to update status on
200
201 **Errors:**
202
203 * 404 Not Found: Returned if no core server with the given id or slug exists
204 * 404 Not Found: Returned if no user with the given id or username exists in the specified core server
205 * 422 Unprocessable Entity: Returned if no JSON name property is given
206 * 422 Unprocessable Entity: Returned if no JSON type property is given
207 * 422 Unprocessable Entity: Returned if the JSON type property value is not valid
208 * 422 Unprocessable Entity: Returned if the JSON returnTime property value is to large, or non numerical value.
209 * 403 Forbidden: Returned if the user is not licensed/full, or no license is installed on the core server.
210 )))
211 |(% class="highlight-grey" data-highlight-colour="grey" %)(% class="highlight-grey" data-highlight-colour="grey" %)
212 (((
213 (% style="font-family: monospace;" %)**POST**
214 )))|(((
215 Updates the status of the user.
216 )))
217 |(% class="highlight-grey" colspan="1" data-highlight-colour="grey" %)(% class="highlight-grey" colspan="1" data-highlight-colour="grey" %)
218 (((
219 **JSON**
220 )))|(% colspan="1" %)(% colspan="1" %)
221 (((
222 {{code}}
223 {
224 "name" : "Went back in time",
225 "type" : "away",
226 "note" : "Let Doc Brown know",
227 "returnTime" : 499132800
228 }
229 {{/code}}
230
231 **Properties:**
232
233 |=(((
234 Property
235 )))|=(((
236 Type
237 )))|=(((
238 Description
239 )))
240 |(% colspan="1" %)(% colspan="1" %)
241 (((
242 {{{name}}}
243 )))|(% colspan="1" %)(% colspan="1" %)
244 (((
245 String
246 )))|(% colspan="1" %)(% colspan="1" %)
247 (((
248 The status name.
249 )))
250 |(% colspan="1" %)(% colspan="1" %)
251 (((
252 type
253 )))|(% colspan="1" %)(% colspan="1" %)
254 (((
255 String
256 )))|(% colspan="1" %)(% colspan="1" %)
257 (((
258 The status type. Determines the icon used for the status. See Status Types above.
259 )))
260 |(% colspan="1" %)(% colspan="1" %)
261 (((
262 note
263 )))|(% colspan="1" %)(% colspan="1" %)
264 (((
265 String
266 )))|(% colspan="1" %)(% colspan="1" %)
267 (((
268 The note for the status.
269 )))
270 |(% colspan="1" %)(% colspan="1" %)
271 (((
272 returnTime
273 )))|(% colspan="1" %)(% colspan="1" %)
274 (((
275 Long
276 )))|(% colspan="1" %)(% colspan="1" %)
277 (((
278 The time the user has set to return, or -1 for not return time. Represented as a unix timestamp, in milliseconds.
279 )))
280
281 **
282 **
283 )))
284
285 =
286 Curl Examples =
287
288 === Get the status of a user in a specific core server ===
289
290 {{code language="bash"}}
291 curl --user manager:manag3rpa55word -i -H "Accept: application/json" http://localhost:58080/communication_manager/rest/live/coreServers/ca5de6c4-17bd-46ce-95a2-8b29c7812ca4/users/status
292 {{/code}}
293
294 === Set the status of a user in a specific core server ===
295
296 {{code language="bash"}}
297 curl --user manager:manag3rpa55word -i -H "Content-Type: application/json" -X POST -d '{"name" : "Went back in time","type" : "away","note" : "Let Doc Brown know","returnTime" : 499132800}' curl --user manager:manag3rpa55word -i -H "Accept: application/json" http://localhost:58080/communication_manager/rest/live/coreServers/ca5de6c4-17bd-46ce-95a2-8b29c7812ca4/users/status/set
298 {{/code}}
299 {{/layout-cell}}
300 {{/layout-section}}
301 {{/layout}}