Devices - Get
Get a device by ID
Get details about an existing device by device ID.
GET https://{subdomain}.{baseDomain}/api/devices/{deviceId}?api-version=2022-07-31
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
base
|
path | True |
string |
The base domain for all Azure IoT Central service requests. |
|
device
|
path | True |
string |
Unique ID of the device. |
|
subdomain
|
path | True |
string |
The application subdomain. |
|
api-version
|
query | True |
string |
The version of the API being called. |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK |
Success |
|
| Other Status Codes |
An error response received from the IoT Central Service. Headers x-ms-error-code: string |
Security
azure_auth
Azure Active Directory OAuth2 Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
| Name | Description |
|---|---|
| user_impersonation | impersonate your user account |
Examples
Get device by ID
Sample request
GET https://appsubdomain.azureiotcentral.com/api/devices/CheckoutThermostat?api-version=2022-07-31
Sample response
{
"id": "CheckoutThermostat",
"etag": "eyJoZWFkZXIiOiJcIjAyMDA4YzMyLTAwMDAtMGQwMC0wMDAwLTVkOTY4YjdhMDAwMFwiIn0",
"displayName": "CheckoutThermostat",
"template": "dtmi:contoso:testDeviceTemplate;1",
"simulated": true,
"provisioned": true,
"enabled": true,
"organizations": [
"seattle"
]
}
Definitions
| Name | Description |
|---|---|
| Device |
The device definition. |
| Error |
The response error definition. |
|
Error |
The detail information of the error. |
Device
The device definition.
| Name | Type | Description |
|---|---|---|
| displayName |
string |
Display name of the device. |
| enabled |
boolean |
Whether the device connection to IoT Central has been enabled. |
| etag |
string |
ETag used to prevent conflict in device updates. |
| id |
string |
Unique ID of the device. |
| organizations |
string[] |
List of organization IDs that the device is a part of, only one organization is supported today, multiple organizations will be supported soon. |
| provisioned |
boolean |
Whether resources have been allocated for the device. |
| simulated |
boolean |
Whether the device is simulated. |
| template |
string |
The device template definition for the device. |
Error
The response error definition.
| Name | Type | Description |
|---|---|---|
| error |
Error details for current request. |
ErrorDetails
The detail information of the error.
| Name | Type | Description |
|---|---|---|
| code |
string |
Error code. |
| message |
string |
Error message details. |
| requestId |
string |
Correlation Id for current request. |
| time |
string (date-time-rfc1123) |
The time that error request failed. |