You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/iot-hub/iot-hub-rm-rest.md
+5-7Lines changed: 5 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ ms.custom: devx-track-csharp
13
13
14
14
# Create an IoT hub using the resource provider REST API (.NET)
15
15
16
-
You can use the [IoT Hub Resource](/rest/api/iothub/iothubresource) REST API to create and manage Azure IoT hubs programmatically. This article shows you how to use the IoT Hub Resource to create an IoT hub using **Postman**. Alternatively, you can use **cURL**.
16
+
You can use the [IoT Hub Resource](/rest/api/iothub/iothubresource) REST API to create and manage Azure IoT hubs programmatically. This article shows you how to use the IoT Hub Resource to create an IoT hub using **Postman**. Alternatively, you can use **cURL**. If any of these REST commands fail, find help with the [IoT Hub API common error codes](/rest/api/iothub/common-error-codes).
@@ -47,12 +47,10 @@ You can use the [IoT Hub Resource](/rest/api/iothub/iothubresource) REST API to
47
47
:::image type="content" source="media/iot-hub-rm-rest/select-bearer-token.png" alt-text="Screenshot that shows how to select the Bearer Token type of authorization in **Postman**.":::
48
48
49
49
1. Paste the access token into the field labeled **Token**.
50
-
51
-
## Use the REST API to create, view, update, or delete an IoT hub
52
50
53
-
The following commands are from the [IoT Hub Resource](/rest/api/iothub/iot-hub-resource) reference. If any of these REST commands fail, find help with the [IoT Hub API common error codes](/rest/api/iothub/common-error-codes). Keep in mind the access token expires after 5-60 minutes, so you may need to generate another one.
51
+
Keep in mind the access token expires after 5-60 minutes, so you may need to generate another one.
54
52
55
-
###Create an IoT hub
53
+
## Create an IoT hub
56
54
57
55
1. Select the REST command dropdown list and choose the PUT command. Copy the URL below, replacing the values in the `{}` with your own values. The `{resourceName}` value is the name you'd like for your new IoT hub. Paste the URL into the field next to the PUT command.
58
56
@@ -88,7 +86,7 @@ The following commands are from the [IoT Hub Resource](/rest/api/iothub/iot-hub-
88
86
89
87
1. Select **Send** to send your request and create a new IoT hub. A successful request will return a **201 Created** response with a JSON printout of your IoT hub specifications. You can save your request if you're using **Postman**.
90
88
91
-
## View / show an IoT hub
89
+
## View an IoT hub
92
90
93
91
To see all the specifications of your new IoT hub, use a GET request. You can use the same URL that you used with the PUT request, but must erase the **Body** of that request (if not already blank) because a GET request can't have a body. Here's the GET request template:
94
92
@@ -98,7 +96,7 @@ GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{
98
96
99
97
See the [GET command in the IoT Hub Resource](/rest/api/iothub/iot-hub-resource/get?tabs=HTTP).
100
98
101
-
###Update an IoT hub
99
+
## Update an IoT hub
102
100
103
101
Updating is as simple as using the same PUT request from when we created the IoT hub and editing the JSON body to contain parameters of your choosing. Edit the body of the request by adding a **tags** property, then run the PUT request.
0 commit comments