Wiki source code of User Configuration
Last modified by ryanp on 2021/09/10 23:34
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | {{layout}} | ||
2 | {{layout-section ac:type="two_right_sidebar"}} | ||
3 | {{layout-cell}} | ||
4 | {{warning}} | ||
5 | This page is currently being written. Although the information below is probably accurate, it may not be complete or may have errors. | ||
6 | {{/warning}} | ||
7 | |||
8 | {{info}} | ||
9 | The information on this page applies to **iSymphony 3.1+**. | ||
10 | {{/info}} | ||
11 | |||
12 | = (% style="color: rgb(0,0,0);" %)Description(%%) = | ||
13 | |||
14 | The user REST resource allows access to the configuration for users in the system. This resource allows adding, removing, and updating of users in the system. | ||
15 | |||
16 | |||
17 | {{/layout-cell}} | ||
18 | |||
19 | {{layout-cell}} | ||
20 | {{panel title="On this page:"}} | ||
21 | |||
22 | |||
23 | {{toc maxLevel="2" indent="1"/}} | ||
24 | {{/panel}} | ||
25 | {{/layout-cell}} | ||
26 | {{/layout-section}} | ||
27 | |||
28 | {{layout-section ac:type="single"}} | ||
29 | {{layout-cell}} | ||
30 | = (% style="color: rgb(0,0,0);" %)Root Resource Path(%%) = | ||
31 | |||
32 | {{code}} | ||
33 | communication_manager/rest/config/core/{coreServerId}/users | ||
34 | {{/code}} | ||
35 | |||
36 | = JSON Representation = | ||
37 | |||
38 | {{code}} | ||
39 | { | ||
40 | "id": "56cf70a3-1ee0-4b09-8f40-297430eeeddf", | ||
41 | "username": "4224", | ||
42 | "password": "e5e9fa1ba31ecd1ae84f75caaa474f3a663f05f4", | ||
43 | "enabled": true, | ||
44 | "full": true, | ||
45 | "displayName": "Steve S", | ||
46 | "lastPasswordChangedAt": null, | ||
47 | "permissionDisplayName": "Steve S", | ||
48 | "permissionId": "56cf70a3-1ee0-4b09-8f40-297430eeeddf" | ||
49 | } | ||
50 | {{/code}} | ||
51 | |||
52 | |=((( | ||
53 | Property | ||
54 | )))|=((( | ||
55 | Type | ||
56 | )))|=((( | ||
57 | Description | ||
58 | ))) | ||
59 | |((( | ||
60 | {{{id}}} | ||
61 | )))|((( | ||
62 | String | ||
63 | )))|((( | ||
64 | Configuration id of the user. | ||
65 | ))) | ||
66 | |(% colspan="1" %)(% colspan="1" %) | ||
67 | ((( | ||
68 | username | ||
69 | )))|(% colspan="1" %)(% colspan="1" %) | ||
70 | ((( | ||
71 | String | ||
72 | )))|(% colspan="1" %)(% colspan="1" %) | ||
73 | ((( | ||
74 | Username of the user. | ||
75 | ))) | ||
76 | |(% colspan="1" %)(% colspan="1" %) | ||
77 | ((( | ||
78 | password | ||
79 | )))|(% colspan="1" %)(% colspan="1" %) | ||
80 | ((( | ||
81 | String | ||
82 | )))|(% colspan="1" %)(% colspan="1" %) | ||
83 | ((( | ||
84 | SHA-1 hash of the user's password. | ||
85 | ))) | ||
86 | |(% colspan="1" %)(% colspan="1" %) | ||
87 | ((( | ||
88 | enabled | ||
89 | )))|(% colspan="1" %)(% colspan="1" %) | ||
90 | ((( | ||
91 | Boolean | ||
92 | )))|(% colspan="1" %)(% colspan="1" %) | ||
93 | ((( | ||
94 | Flag specifying if the user is enabled. | ||
95 | ))) | ||
96 | |(% colspan="1" %)(% colspan="1" %) | ||
97 | ((( | ||
98 | full | ||
99 | )))|(% colspan="1" %)(% colspan="1" %) | ||
100 | ((( | ||
101 | Boolean | ||
102 | )))|(% colspan="1" %)(% colspan="1" %) | ||
103 | ((( | ||
104 | Flag specifying if the user is a full or lite user. | ||
105 | ))) | ||
106 | |(% colspan="1" %)(% colspan="1" %) | ||
107 | ((( | ||
108 | displayName | ||
109 | )))|(% colspan="1" %)(% colspan="1" %) | ||
110 | ((( | ||
111 | String | ||
112 | )))|(% colspan="1" %)(% colspan="1" %) | ||
113 | ((( | ||
114 | The display name for the user. | ||
115 | ))) | ||
116 | |(% colspan="1" %)(% colspan="1" %) | ||
117 | ((( | ||
118 | {{{lastPasswordChangedAt}}} | ||
119 | )))|(% colspan="1" %)(% colspan="1" %) | ||
120 | ((( | ||
121 | Long | ||
122 | )))|(% colspan="1" %)(% colspan="1" %) | ||
123 | ((( | ||
124 | The last time the user changed their password from the client interface. Represented as a Unix timestamp in milliseconds. Can be null. | ||
125 | ))) | ||
126 | |(% colspan="1" %)(% colspan="1" %) | ||
127 | ((( | ||
128 | {{{permissionDisplayName}}} | ||
129 | )))|(% colspan="1" %)(% colspan="1" %) | ||
130 | ((( | ||
131 | String | ||
132 | )))|(% colspan="1" %)(% colspan="1" %) | ||
133 | ((( | ||
134 | Display name of the user in the permission system. This value is read only. | ||
135 | ))) | ||
136 | |(% colspan="1" %)(% colspan="1" %) | ||
137 | ((( | ||
138 | {{{permissionId}}} | ||
139 | )))|(% colspan="1" %)(% colspan="1" %) | ||
140 | ((( | ||
141 | String | ||
142 | )))|(% colspan="1" %)(% colspan="1" %) | ||
143 | ((( | ||
144 | Permission id of the user. This value is read only. | ||
145 | ))) | ||
146 | |||
147 | = Resource Paths = | ||
148 | |||
149 | |=(% colspan="2" %)(% colspan="2" %) | ||
150 | ((( | ||
151 | {{{communication_manager/rest/config/core/{coreServerId}/users}}} | ||
152 | ))) | ||
153 | |(% class="highlight-grey" data-highlight-colour="grey" %)(% class="highlight-grey" data-highlight-colour="grey" %) | ||
154 | ((( | ||
155 | **Description** | ||
156 | )))|((( | ||
157 | Accesses all the users in the core server. | ||
158 | ))) | ||
159 | |(% class="highlight-grey" data-highlight-colour="grey" %)(% class="highlight-grey" data-highlight-colour="grey" %) | ||
160 | ((( | ||
161 | **GET** | ||
162 | )))|((( | ||
163 | Gets all the users in the core server. | ||
164 | ))) | ||
165 | |(% class="highlight-grey" colspan="1" data-highlight-colour="grey" %)(% class="highlight-grey" colspan="1" data-highlight-colour="grey" %) | ||
166 | ((( | ||
167 | **POST | ||
168 | ** | ||
169 | )))|(% colspan="1" %)(% colspan="1" %) | ||
170 | ((( | ||
171 | Adds a user to the configuration. | ||
172 | |||
173 | {{info}} | ||
174 | This resource URL will take in a plain text password for the user and create a SHA-1 hashed version of it in the configuration. | ||
175 | |||
176 | If you want to pass in a pre-hashed version of the password that will be stored without modification you can use the following URL instead: | ||
177 | |||
178 | **communication_manager/rest/config/core/{coreServerId}/users/noHash** | ||
179 | {{/info}} | ||
180 | |||
181 | (% style="line-height: 1.42857;" %)**Errors:** | ||
182 | |||
183 | * 409 'A user with the given id already exists.': Returned if a user with the given id already exists. | ||
184 | * 409 'A user with the given username already exists.': Returned if a user with the given username already exists. | ||
185 | * 412 'No username provided.': Returned if no username was provided. | ||
186 | * 412 'No password provided.': Returned if no password was provided. | ||
187 | ))) | ||
188 | |(% colspan="2" %)(% colspan="2" %) | ||
189 | ((( | ||
190 | |||
191 | ))) | ||
192 | |=(% colspan="2" %)(% colspan="2" %) | ||
193 | ((( | ||
194 | {{{communication_manager/rest/config/core/{coreServerId}/users/{userId}}}} | ||
195 | ))) | ||
196 | |(% class="highlight-grey" data-highlight-colour="grey" %)(% class="highlight-grey" data-highlight-colour="grey" %) | ||
197 | ((( | ||
198 | **Description** | ||
199 | )))|((( | ||
200 | Accesses the configuration of a specific user. | ||
201 | |||
202 | **Parameters:** | ||
203 | |||
204 | * userId: The configuration id of the user. | ||
205 | ))) | ||
206 | |(% class="highlight-grey" data-highlight-colour="grey" %)(% class="highlight-grey" data-highlight-colour="grey" %) | ||
207 | ((( | ||
208 | **GET** | ||
209 | )))|((( | ||
210 | Gets the configuration of the specified user. | ||
211 | |||
212 | **Errors:** | ||
213 | |||
214 | * 404 'A user with the given id does not exist': Returned if no user exists with the given id. | ||
215 | ))) | ||
216 | |(% class="highlight-grey" colspan="1" data-highlight-colour="grey" %)(% class="highlight-grey" colspan="1" data-highlight-colour="grey" %) | ||
217 | ((( | ||
218 | **PUT** | ||
219 | )))|(% colspan="1" %)(% colspan="1" %) | ||
220 | ((( | ||
221 | Updates the specified user configuration. | ||
222 | |||
223 | {{info}} | ||
224 | This resource URL will take in a plain text password for the user and create a SHA-1 hashed version of it in the configuration. | ||
225 | |||
226 | If you want to pass in a pre-hashed version of the password that will be stored without modification you can use the following URL instead: | ||
227 | |||
228 | **communication_manager/rest/config/core/{coreServerId}/users/noHash/{userId}** | ||
229 | {{/info}} | ||
230 | |||
231 | **Errors:** | ||
232 | |||
233 | * 404 'A user with the given id does not exist': Returned if no user exists with the given id. | ||
234 | * 409 'A user with the given username already exists.': Returned if a user with the given username already exists. | ||
235 | * 412 'No username provided.': Returned if no username was provided. | ||
236 | * 412 'No password provided.': Returned if no password was provided. | ||
237 | ))) | ||
238 | |(% class="highlight-grey" colspan="1" data-highlight-colour="grey" %)(% class="highlight-grey" colspan="1" data-highlight-colour="grey" %) | ||
239 | ((( | ||
240 | **DELETE** | ||
241 | )))|(% colspan="1" %)(% colspan="1" %) | ||
242 | ((( | ||
243 | Deletes the specified user configuration. | ||
244 | |||
245 | **Errors:** | ||
246 | |||
247 | * 404 'A user with the given id does not exist': Returned if no user exists with the given id. | ||
248 | ))) | ||
249 | |||
250 | = Sub/Child Resource Paths = | ||
251 | |||
252 | |=(% colspan="2" %)(% colspan="2" %) | ||
253 | ((( | ||
254 | {{{communication_manager/rest/config/core/{coreServerId}/users/{userId}/userStatusColors}}} | ||
255 | ))) | ||
256 | |(% class="highlight-grey" colspan="1" data-highlight-colour="grey" %)(% class="highlight-grey" colspan="1" data-highlight-colour="grey" %) | ||
257 | ((( | ||
258 | **Description** | ||
259 | )))|(% colspan="1" %)(% colspan="1" %) | ||
260 | ((( | ||
261 | Access the sub/child resource for the colors the user has set for call status in the client. | ||
262 | |||
263 | (% style="line-height: 1.42857;" %)**Parameters:** | ||
264 | |||
265 | * userId: The configuration id of the user. | ||
266 | |||
267 | **Errors:** | ||
268 | |||
269 | * 404 'A user with the given id does not exist': Returned if no user exists with the given id. | ||
270 | |||
271 | See [[doc:User Status Color Configuration]] for more information. | ||
272 | ))) | ||
273 | |||
274 | = Curl Examples = | ||
275 | |||
276 | === Get all users in a core server === | ||
277 | |||
278 | {{code language="bash"}} | ||
279 | curl --user manager:manag3rpa55word -k -i -H "Accept: application/json" http://localhost:58080/communication_manager/rest/config/core/ee828da8-5ee6-412d-82ac-1273f598659d/users | ||
280 | {{/code}} | ||
281 | |||
282 | === Get the configuration for a specific user === | ||
283 | |||
284 | {{code language="bash"}} | ||
285 | curl --user manager:manag3rpa55word -k -i -H "Accept: application/json" http://localhost:58080/communication_manager/rest/config/core/ee828da8-5ee6-412d-82ac-1273f598659d/users/56cf70a3-1ee0-4b09-8f40-297430eeeddf | ||
286 | {{/code}} | ||
287 | |||
288 | === Add a new user === | ||
289 | |||
290 | {{code language="bash"}} | ||
291 | curl --user manager:manag3rpa55word -k -i -H "Content-Type: application/json" -H "Accept: application/json" -X POST -d '{"id":"56cf70a3-1ee0-4b09-8f40-297430eeeddf","username":"4224","password":"mypassword","enabled":true,"full":true,"displayName":"Steve S","lastPasswordChangedAt":null,"permissionDisplayName":"Steve S","permissionId":"56cf70a3-1ee0-4b09-8f40-297430eeeddf"}' http://localhost:58080/communication_manager/rest/config/core/ee828da8-5ee6-412d-82ac-1273f598659d/users | ||
292 | {{/code}} | ||
293 | |||
294 | === Delete a user === | ||
295 | |||
296 | {{code language="bash"}} | ||
297 | curl --user manager:manag3rpa55word -k -i -X DELETE http://localhost:58080/communication_manager/rest/config/core/ee828da8-5ee6-412d-82ac-1273f598659d/users/56cf70a3-1ee0-4b09-8f40-297430eeeddf | ||
298 | {{/code}} | ||
299 | |||
300 | === Update a user === | ||
301 | |||
302 | {{code language="bash"}} | ||
303 | curl --user manager:manag3rpa55word -k -i -H "Content-Type: application/json" -H "Accept: application/json" -X PUT -d '{"id":"56cf70a3-1ee0-4b09-8f40-297430eeeddf","username":"4224","password":"mynewpassword","enabled":true,"full":true,"displayName":"Steve S","lastPasswordChangedAt":null,"permissionDisplayName":"Steve S","permissionId":"56cf70a3-1ee0-4b09-8f40-297430eeeddf"}' http://localhost:58080/communication_manager/rest/config/core/ee828da8-5ee6-412d-82ac-1273f598659d/users/56cf70a3-1ee0-4b09-8f40-297430eeeddf | ||
304 | {{/code}} | ||
305 | {{/layout-cell}} | ||
306 | {{/layout-section}} | ||
307 | {{/layout}} |