Wiki source code of Asterisk Extension Managing User
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 extension managing user REST resource allows access to the managing user (user that owns the extension) of a specific extension. This resource allows you to set and unset the user that manages the extension. | ||
15 | {{/layout-cell}} | ||
16 | |||
17 | {{layout-cell}} | ||
18 | {{panel title="On this page:"}} | ||
19 | |||
20 | |||
21 | {{toc maxLevel="2" indent="1"/}} | ||
22 | {{/panel}} | ||
23 | {{/layout-cell}} | ||
24 | {{/layout-section}} | ||
25 | |||
26 | {{layout-section ac:type="single"}} | ||
27 | {{layout-cell}} | ||
28 | = (% style="color: rgb(0,0,0);" %)Root Resource Path(%%) = | ||
29 | |||
30 | {{code}} | ||
31 | communication_manager/rest/config/asterisk/{serverId}/extensions/{extensionId}/managingUser | ||
32 | {{/code}} | ||
33 | |||
34 | = JSON Representation = | ||
35 | |||
36 | {{code}} | ||
37 | { | ||
38 | "id": "56cf70a3-1ee0-4b09-8f40-297430eeeddf", | ||
39 | "username": "4224", | ||
40 | "password": "e5e9fa1ba31ecd1ae84f75caaa474f3a663f05f4", | ||
41 | "enabled": true, | ||
42 | "full": true, | ||
43 | "displayName": "Steve S", | ||
44 | "lastPasswordChangedAt": null, | ||
45 | "permissionDisplayName": "Steve S", | ||
46 | "permissionId": "56cf70a3-1ee0-4b09-8f40-297430eeeddf" | ||
47 | } | ||
48 | {{/code}} | ||
49 | |||
50 | |=((( | ||
51 | Property | ||
52 | )))|=((( | ||
53 | Type | ||
54 | )))|=((( | ||
55 | Description | ||
56 | ))) | ||
57 | |((( | ||
58 | {{{id}}} | ||
59 | )))|((( | ||
60 | String | ||
61 | )))|((( | ||
62 | Configuration id of the user. | ||
63 | ))) | ||
64 | |(% colspan="1" %)(% colspan="1" %) | ||
65 | ((( | ||
66 | username | ||
67 | )))|(% colspan="1" %)(% colspan="1" %) | ||
68 | ((( | ||
69 | String | ||
70 | )))|(% colspan="1" %)(% colspan="1" %) | ||
71 | ((( | ||
72 | Username of the user. | ||
73 | ))) | ||
74 | |(% colspan="1" %)(% colspan="1" %) | ||
75 | ((( | ||
76 | password | ||
77 | )))|(% colspan="1" %)(% colspan="1" %) | ||
78 | ((( | ||
79 | String | ||
80 | )))|(% colspan="1" %)(% colspan="1" %) | ||
81 | ((( | ||
82 | SHA-1 hash of the user's password. | ||
83 | ))) | ||
84 | |(% colspan="1" %)(% colspan="1" %) | ||
85 | ((( | ||
86 | enabled | ||
87 | )))|(% colspan="1" %)(% colspan="1" %) | ||
88 | ((( | ||
89 | Boolean | ||
90 | )))|(% colspan="1" %)(% colspan="1" %) | ||
91 | ((( | ||
92 | Flag specifying if the user is enabled. | ||
93 | ))) | ||
94 | |(% colspan="1" %)(% colspan="1" %) | ||
95 | ((( | ||
96 | full | ||
97 | )))|(% colspan="1" %)(% colspan="1" %) | ||
98 | ((( | ||
99 | Boolean | ||
100 | )))|(% colspan="1" %)(% colspan="1" %) | ||
101 | ((( | ||
102 | Flag specifying if the user is a full or lite user. | ||
103 | ))) | ||
104 | |(% colspan="1" %)(% colspan="1" %) | ||
105 | ((( | ||
106 | displayName | ||
107 | )))|(% colspan="1" %)(% colspan="1" %) | ||
108 | ((( | ||
109 | String | ||
110 | )))|(% colspan="1" %)(% colspan="1" %) | ||
111 | ((( | ||
112 | The display name for the user. | ||
113 | ))) | ||
114 | |(% colspan="1" %)(% colspan="1" %) | ||
115 | ((( | ||
116 | {{{lastPasswordChangedAt}}} | ||
117 | )))|(% colspan="1" %)(% colspan="1" %) | ||
118 | ((( | ||
119 | Long | ||
120 | )))|(% colspan="1" %)(% colspan="1" %) | ||
121 | ((( | ||
122 | The last time the user changed their password from the client interface. Represented as a Unix timestamp in milliseconds. Can be null. | ||
123 | ))) | ||
124 | |(% colspan="1" %)(% colspan="1" %) | ||
125 | ((( | ||
126 | {{{permissionDisplayName}}} | ||
127 | )))|(% colspan="1" %)(% colspan="1" %) | ||
128 | ((( | ||
129 | String | ||
130 | )))|(% colspan="1" %)(% colspan="1" %) | ||
131 | ((( | ||
132 | Display name of the user in the permission system. | ||
133 | ))) | ||
134 | |(% colspan="1" %)(% colspan="1" %) | ||
135 | ((( | ||
136 | {{{permissionId}}} | ||
137 | )))|(% colspan="1" %)(% colspan="1" %) | ||
138 | ((( | ||
139 | String | ||
140 | )))|(% colspan="1" %)(% colspan="1" %) | ||
141 | ((( | ||
142 | Permission id of the user. | ||
143 | ))) | ||
144 | |||
145 | = Resource Paths = | ||
146 | |||
147 | |=(% colspan="2" %)(% colspan="2" %) | ||
148 | ((( | ||
149 | {{{communication_manager/rest/config/asterisk/{serverId}/extensions/{extensionId}/managingUser}}} | ||
150 | ))) | ||
151 | |(% class="highlight-grey" data-highlight-colour="grey" %)(% class="highlight-grey" data-highlight-colour="grey" %) | ||
152 | ((( | ||
153 | **Description** | ||
154 | )))|((( | ||
155 | Accesses the managing user of the extension. | ||
156 | ))) | ||
157 | |(% class="highlight-grey" data-highlight-colour="grey" %)(% class="highlight-grey" data-highlight-colour="grey" %) | ||
158 | ((( | ||
159 | **GET** | ||
160 | )))|((( | ||
161 | Gets the managing user for the extension. | ||
162 | |||
163 | Errors: | ||
164 | |||
165 | * 404 'Extension has not set user': The extension does not have a managing user set. | ||
166 | ))) | ||
167 | |(% class="highlight-grey" colspan="1" data-highlight-colour="grey" %)(% class="highlight-grey" colspan="1" data-highlight-colour="grey" %) | ||
168 | ((( | ||
169 | **POST | ||
170 | ** | ||
171 | )))|(% colspan="1" %)(% colspan="1" %) | ||
172 | ((( | ||
173 | Sets the provided user as the managing user for the extension. | ||
174 | |||
175 | {{info title="Extension Stealing"}} | ||
176 | The endpoint will automatically reassign a extensions to the posted user if it belonged to another user. | ||
177 | {{/info}} | ||
178 | |||
179 | (% style="line-height: 1.42857;" %)**Errors:** | ||
180 | |||
181 | * 409 'The Extension's managed user is already set to the given user.': Returned if the provided user is already the managing user for the extension. | ||
182 | * 409 'A user with the given username already exists.': Returned if a user with the given username already exists. | ||
183 | * 412 'No username provided.': Returned if no username was provided. | ||
184 | * 412 'No password provided.': Returned if no password was provided. | ||
185 | ))) | ||
186 | |(% class="highlight-grey" colspan="1" data-highlight-colour="grey" %)(% class="highlight-grey" colspan="1" data-highlight-colour="grey" %) | ||
187 | ((( | ||
188 | **DELETE | ||
189 | ** | ||
190 | )))|(% colspan="1" %)(% colspan="1" %) | ||
191 | ((( | ||
192 | Clears any currently set managing user on the extension. | ||
193 | ))) | ||
194 | |||
195 | = Curl Examples = | ||
196 | |||
197 | === Gets the managing user for an extension === | ||
198 | |||
199 | {{code language="bash"}} | ||
200 | curl --user manager:manag3rpa55word -k -i -H "Accept: application/json" http://localhost:58080/communication_manager/rest/config/asterisk/ee828da8-5ee6-412d-82ac-1273f598659d/extensions/56cf70a3-1ee0-4b09-8f40-297430eeeddf/managingUser | ||
201 | {{/code}} | ||
202 | |||
203 | === Set a managing user for an extension === | ||
204 | |||
205 | {{code language="bash"}} | ||
206 | curl --user manager:manag3rpa55word -k -i -H "Content-Type: application/json" -H "Accept: application/json" -X POST -d '{"id":"ed38fe4d-13ad-4fd0-be25-d3404c421370","username":"4224","password":"60b6e3843f2b26d3a24c27c4f3f071861c2f14e4","enabled":true,"full":false,"displayName":"Michael Y (desk)","lastPasswordChangedAt":null,"permissionDisplayName":"Michael Y (desk)","permissionId":"ed38fe4d-13ad-4fd0-be25-d3404c421370"}' http://localhost:58080/communication_manager/rest/config/asterisk/ee828da8-5ee6-412d-82ac-1273f598659d/extension/56cf70a3-1ee0-4b09-8f40-297430eeeddf/managingUser | ||
207 | {{/code}} | ||
208 | |||
209 | === Clear the managing user on the extension === | ||
210 | |||
211 | {{code language="bash"}} | ||
212 | curl --user manager:manag3rpa55word -k -i -X DELETE http://localhost:58080/communication_manager/rest/config/asterisk/ee828da8-5ee6-412d-82ac-1273f598659d/extensions/56cf70a3-1ee0-4b09-8f40-297430eeeddf/managingUser | ||
213 | {{/code}} | ||
214 | {{/layout-cell}} | ||
215 | {{/layout-section}} | ||
216 | {{/layout}} |