QueryDevice

Last Updated on : 2025-10-09 09:26:11Copy for LLMView as MarkdownDownload PDF

Call this operation to query the device list of a specified product.

Request Parameters

Name Type Required Sample Values Description
Action String Yes QueryDevice System defined parameters. Value: QueryDevice.
ProductKey String Yes A1BwAGV * * * * Of the product to which the device to be queried belongs ProductKey .
PageSize Integer no 10 Specifies the number of records displayed on each page in the returned results. The maximum value is 50. The default value is 10.
CurrentPage Integer No 1 Specifies which page of the returned result is displayed. The default value is 1.
NextToken String No TGlzdFJlc291cm * * * The identifier of the next page. You do not need to pass it in for the first query. Required for subsequent queries NextToken from the return result of the previous query. When PageSize X CurrentPage when the value is greater than 10,000, you must pass in NextToken . Otherwise, data cannot be returned.

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.

Return data

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 Array of DeviceInfo When the call is successful, return the device information list ( DeviceInfo ).
DeviceInfo
DeviceName String Light The device name.
DeviceSecret String No * * * * The device key.
DeviceStatus String Online Device status. Value: ●Online : equipment online. ●Offline : The device is offline. ●Unactived : The device is not activated. ●Disable : Device is disabled.
DeviceType String Lighting The category of the product to which the device belongs.
GmtCreate String Wed, 20-Feb-2019 02:16:09 GMT Device Creation time, in GMT format.
GmtModified String Wed, 20-Feb-2019 02:16:09 GMT The time when the device information was last updated, in GMT format.
IoTID String **** 00100 The device ID. The ID issued by IoT platform for the device. The unique identifier of the device.
Nickname String Intelligent lamp equipment Note name of the device.
ProductKey String A1BwAGV * * * * The ProductKey of the product to which the device belongs.
UtcCreate String 2019-02-20 T02:16:09.000Z The device creation time, in UTC format.
UtcModified String 2019-02-20 T02:16:09.000Z The time when the device information was last updated, in UTC format.
ErrorMessage String System Exception Error information returned when the call fails.
NextToken String TGlzdFJlc291cm * * * Next page identification. Can be passed in the next request to get the next page of data. If NextToken value is null, indicating that there is no next page of data.
Page Integer 1 The current page number.
PageCount Integer 1 Total number of pages.
PageSize Integer 10 The number of devices displayed per page.
RequestID String E55E50B7-40EE-4B6B-8BBE-D3ED55CCF565 The unique identifier generated for this request.
Success Boolean True Whether the call was successful. ●True : The call succeeded. ●False : The call failed.
Total Integer 2 Total number of devices.

Example

Request Example

curl 'https://si-d6e8******8054.tuyacloud.com:8686/?Action=QueryDevice&SignatureNonce=32e7a9cdcb744116a594040fff3bdf42&AccessKeyId=xMr9wgwXQLhv5AUa65o03mcD&SignatureMethod=HMAC-SHA1&Timestamp=2024-11-19T08%3A35%3A11Z&ProductKey=k1ymv1DuLfE&Signature=Om8wdBXCHymhxBOhNQPThcmj3Vg%3D'

Normal Return Example

{
  "PageCount": 1,
  "NextToken":"TGlzdFJlc291cm***", 
  "Data": {
    "DeviceInfo": [
      {
        "DeviceId": "Av8NGHGtwPrH9BYG****", 
        "DeviceName": "Av8NGHGtwPrH9BYGLMBi", 
        "ProductKey": "a1dafDE****", 
        "DeviceSecret": "d7GYhf5hfcPHDe1bXSd3n9MjO1G3****", 
        "UtcModified": "2019-02-20T02:16:09.000Z", 
        "GmtCreate": "Wed, 20-Feb-2019 02:16:09 GMT", 
        "UtcCreate": "2019-02-20T02:16:09.000Z", 
        "GmtModified": "Wed, 20-Feb-2019 02:16:09 GMT", 
        "IotId": "Av8NGHGtwPrH9BYGLMBi00****", 
        "DeviceStatus": "UNACTIVE", 
        "Nickname": "SensorInShanghai"
      }, 
      {
        "DeviceId": "zNIcSmWQ9BPJlmkj****", 
        "DeviceName": "zNIcSmWQ9BPJlmkjn3H1", 
        "ProductKey": "a1dafDE****", 
        "DeviceSecret": "C27XXmC18yLIEDXvUj6FSlvgO7ag****", 
        "UtcModified": "2019-02-20T02:16:09.000Z", 
        "GmtCreate": "Wed, 20-Feb-2019 02:16:09 GMT", 
        "UtcCreate": "2019-02-20T02:16:09.000Z", 
        "GmtModified": "Wed, 20-Feb-2019 02:16:09 GMT", 
        "IotId": "zNIcSmWQ9BPJlmkjn3H100****", 
        "DeviceStatus": "UNACTIVE", 
        "Nickname": "DriverInShanghai"
      }
    ]
  }, 
  "Page": 1, 
  "PageSize": 10, 
  "RequestId": "CD9E5F99-A095-4A05-9256-D924EA3075E8", 
  "Success": true, 
  "Total": 2
}