Skip to content

Commit 0a8f7e7

Browse files
committed
changes after review
1 parent a781c5b commit 0a8f7e7

File tree

1 file changed

+50
-19
lines changed

1 file changed

+50
-19
lines changed

articles/iot-central/core/howto-manage-organizations-with-rest-api.md

Lines changed: 50 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,50 +18,77 @@ Every IoT Central REST API call requires an authorization header. To learn more,
1818

1919
For the reference documentation for the IoT Central REST API, see [Azure IoT Central REST API reference](/rest/api/iotcentral/).
2020

21+
To learn more about organizations in IoT Central Application, see [Manage IoT Central organizations](howto-create-organizations.md).
22+
2123
## Organizations REST API
2224

2325
The IoT Central REST API lets you:
2426

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
2830
* Get a list of the organizations in the application
29-
* Delete a organization in your application
31+
* Delete an organization in your application
3032

31-
### Create Organizations
33+
### Create organizations
3234

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:
3436

3537
```http
3638
PUT https://{subdomain}.{baseDomain}/api/organizations/{organizationId}?api-version=1.1-preview
3739
```
3840

3941
* organizationId - Unique Id of the organization
4042

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.
4244

4345
```json
4446
{
4547
"displayName": "Seattle",
46-
"parent": "washington"
4748
}
4849
```
4950

5051
The request body has some required fields:
5152

5253
* `@displayName`: Display name of the organization.
5354

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:
5560

5661
```json
5762
{
5863
"id": "seattle",
59-
"displayName": "Seattle",
60-
"parent": "washington"
64+
"displayName": "Seattle"
6165
}
6266
```
6367

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
6592

6693
Use the following request to retrieve details of a individual organization from your application:
6794

@@ -87,7 +114,7 @@ Use the following request to update details of an organization in your applicati
87114
PATCH https://{subdomain}.{baseDomain}/api/organizations/{organizationId}?api-version=1.1-preview
88115
```
89116

90-
The following example shows a request body that updates a organization.
117+
The following example shows a request body that updates an organization.
91118

92119
```json
93120
{
@@ -115,11 +142,15 @@ Use the following request to retrieve a list of organizations from your applicat
115142
GET https://{your app subdomain}.azureiotcentral.com/api/organizations?api-version=1.1-preview
116143
```
117144

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.
119146

120147
```json
121148
{
122149
"value": [
150+
{
151+
"id": "washington",
152+
"displayName": "Washington"
153+
},
123154
{
124155
"id": "redmond",
125156
"displayName": "Redmond"
@@ -131,25 +162,25 @@ The response to this request looks like the following example. The role value id
131162
{
132163
"id": "spokane",
133164
"displayName": "Spokane",
134-
"parent": "Washington"
165+
"parent": "washington"
135166
},
136167
{
137168
"id": "seattle",
138169
"displayName": "Seattle",
139-
"parent": "Washington"
170+
"parent": "washington"
140171
}
141172
]
142173
}
143174
```
144175

145-
### Delete a user
176+
### Delete an organization
146177

147-
Use the following request to delete a organization:
178+
Use the following request to delete an organization:
148179

149180
```http
150181
DELETE https://{your app subdomain}.azureiotcentral.com/api/organizations/{organizationId}?api-version=1.1-preview
151182
```
152183

153184
## Next steps
154185

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

Comments
 (0)