Call this operation to query the basic information (device ID, device certificate, and note name) of a specified device. Instructions for use
When calling this interface, you must pass in the property identifier to be emptied ( Identifies ). If not passed in Identifies , the call will fail.
A single call to this interface, Identifies up to 10 property identifiers can be passed in.
| Name | Type | Required | Sample Values | Description |
|---|---|---|---|---|
| Action | String | Yes | QueryDeviceInfo | System defined parameters. Value: QueryDeviceInfo. |
| ProductKey | String | No | A1BwAGV * * * * | To query the ProductKey of the product to which the device belongs. |
| DeviceName | String | No | Light | The device name of the device to be queried. |
| IoTID | String | No | **** 00100 | The device ID of the device to be queried. |
Note: when calling an API, in addition to the API-specific request parameters described in this topic, you must also pass in the common request parameters. For more information about common request parameters, see Common parameters.
| Name | Type | Sample Values | Description |
|---|---|---|---|
| Code | String | Iot.system.SystemException | The error code returned when the call fails. For more information, see Error codes. |
| Data | Struct | When the call is successful, the basic information of the device is returned. | |
| DeviceName | String | Light | The device name. |
| DeviceSecret | String | No * * * * | The device key. |
| IoTID | String | **** 00100 | The ID issued by IoT platform as the unique identifier of the device. |
| Nickname | String | Detectors_in_beijing | Note name of the device. |
| ProductKey | String | A1rYuVF * * * * | The ProductKey of the product to which the device belongs. |
| ErrorMessage | String | System Exception | Error information returned when the call fails. |
| RequestID | String | E55E50B7-40EE-4B6B-8BBE-D3ED55CCF565 | The unique identifier generated for this request. |
| Success | Boolean | True | Indicates whether the call succeeded. ●True : The call succeeded. ●False : The call failed. |
Request Example
curl 'https://si-d6e8d****958054.tuyacloud.com:8686/?Action=QueryDeviceInfo&SignatureNonce=d34bcbe7150a472e878bea3378cfa3a2&AccessKeyId=xMr9wgwXQLhv5AUa65o03mcD&SignatureMethod=HMAC-SHA1&Timestamp=2024-11-19T08%3A30%3A41Z&ProductKey=k1ymv1DuLfE&DeviceName=myTestDevice&Signature=SpyGkZYW3s2QJyJxXtSKbjmaHc8%3D'
Normal return example
{
"RequestId": "E55E50B7-40EE-4B6B-8BBE-D3ED55CCF565",
"Data": {
"IotId": "Q7uOhVRdZRRlDnTLv****00100",
"DeviceSecret": "mz2Canp4GB7qRVf1OYPNtRqB2anu****",
"ProductKey": "a1rYuVF****",
"Nickname": "detectors_in_beijing",
"DeviceName": "light"
},
"Success": true
}