@@ -18,50 +18,77 @@ Every IoT Central REST API call requires an authorization header. To learn more,
18
18
19
19
For the reference documentation for the IoT Central REST API, see [ Azure IoT Central REST API reference] ( /rest/api/iotcentral/ ) .
20
20
21
+ To learn more about organizations in IoT Central Application, see [ Manage IoT Central organizations] ( howto-create-organizations.md ) .
22
+
21
23
## Organizations REST API
22
24
23
25
The IoT Central REST API lets you:
24
26
25
- * Add a organization to your application
26
- * Get a organization by ID
27
- * Update a organization in your application
27
+ * Add an organization to your application
28
+ * Get an organization by ID
29
+ * Update an organization in your application
28
30
* Get a list of the organizations in the application
29
- * Delete a organization in your application
31
+ * Delete an organization in your application
30
32
31
- ### Create Organizations
33
+ ### Create organizations
32
34
33
- The REST API lets you create organizations in your IoT Central application. Use the following request to create a organization in your application:
35
+ The REST API lets you create organizations in your IoT Central application. Use the following request to create an organization in your application:
34
36
35
37
``` http
36
38
PUT https://{subdomain}.{baseDomain}/api/organizations/{organizationId}?api-version=1.1-preview
37
39
```
38
40
39
41
* organizationId - Unique Id of the organization
40
42
41
- The following example shows a request body that adds a organization to a IoT Central application.
43
+ The following example shows a request body that adds an organization to a IoT Central application.
42
44
43
45
``` json
44
46
{
45
47
"displayName" : " Seattle" ,
46
- "parent" : " washington"
47
48
}
48
49
```
49
50
50
51
The request body has some required fields:
51
52
52
53
* ` @displayName ` : Display name of the organization.
53
54
54
- The response to this request looks like the following example:
55
+ The request body has some optional fields:
56
+
57
+ * ` @parent ` : ID of the parent of the organization.
58
+
59
+ The response to this request looks like the following example:
55
60
56
61
``` json
57
62
{
58
63
"id" : " seattle" ,
59
- "displayName" : " Seattle" ,
60
- "parent" : " washington"
64
+ "displayName" : " Seattle"
61
65
}
62
66
```
63
67
64
- ### Get a organization
68
+ You can create an organization with hierarchy, for example you can create a sales organization with a parent organization.
69
+
70
+ The following example shows a request body that adds an organization to a IoT Central application.
71
+
72
+ ``` json
73
+ {
74
+ "displayName" : " Sales" ,
75
+ "parent" :" seattle"
76
+ }
77
+ ```
78
+
79
+ The response to this request looks like the following example:
80
+
81
+ ``` json
82
+ {
83
+ "id" : " sales" ,
84
+ "displayName" : " Sales" ,
85
+ "parent" :" Seattle"
86
+ }
87
+ ```
88
+
89
+
90
+
91
+ ### Get an organization
65
92
66
93
Use the following request to retrieve details of a individual organization from your application:
67
94
@@ -87,7 +114,7 @@ Use the following request to update details of an organization in your applicati
87
114
PATCH https://{subdomain}.{baseDomain}/api/organizations/{organizationId}?api-version=1.1-preview
88
115
```
89
116
90
- The following example shows a request body that updates a organization.
117
+ The following example shows a request body that updates an organization.
91
118
92
119
``` json
93
120
{
@@ -115,11 +142,15 @@ Use the following request to retrieve a list of organizations from your applicat
115
142
GET https://{your app subdomain}.azureiotcentral.com/api/organizations?api-version=1.1-preview
116
143
```
117
144
118
- The response to this request looks like the following example. The role value identifies the role ID the user is associated with:
145
+ The response to this request looks like the following example.
119
146
120
147
``` json
121
148
{
122
149
"value" : [
150
+ {
151
+ "id" : " washington" ,
152
+ "displayName" : " Washington"
153
+ },
123
154
{
124
155
"id" : " redmond" ,
125
156
"displayName" : " Redmond"
@@ -131,25 +162,25 @@ The response to this request looks like the following example. The role value id
131
162
{
132
163
"id" : " spokane" ,
133
164
"displayName" : " Spokane" ,
134
- "parent" : " Washington "
165
+ "parent" : " washington "
135
166
},
136
167
{
137
168
"id" : " seattle" ,
138
169
"displayName" : " Seattle" ,
139
- "parent" : " Washington "
170
+ "parent" : " washington "
140
171
}
141
172
]
142
173
}
143
174
```
144
175
145
- ### Delete a user
176
+ ### Delete an organization
146
177
147
- Use the following request to delete a organization:
178
+ Use the following request to delete an organization:
148
179
149
180
``` http
150
181
DELETE https://{your app subdomain}.azureiotcentral.com/api/organizations/{organizationId}?api-version=1.1-preview
151
182
```
152
183
153
184
## Next steps
154
185
155
- Now that you've learned how to manage users and roles with the REST API, a suggested next step is to [ How to use the IoT Central REST API to manage data exports.] ( howto-manage-data-export-with-rest-api.md )
186
+ Now that you've learned how to manage organizations with the REST API, a suggested next step is to [ How to use the IoT Central REST API to manage data exports.] ( howto-manage-data-export-with-rest-api.md )
0 commit comments