Queries the sub-devices of a specified gateway device.
Limits
Each Alibaba Cloud account can initiate a maximum of 500 queries per second (QPS).
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | GetThingTopo |
The operation that you want to perform. Set the value to GetThingTopo. |
PageNo | Integer | Yes | 1 |
The number of the page to return. |
PageSize | Integer | Yes | 10 |
The number of entries to return on each page. Maximum value: 50. |
IotInstanceId | String | No | iot_instc_pu****_c*-v64******** |
The ID of the Internet of Things (IoT) service instance. This parameter is not required for public instances. However, this parameter is required for enterprise-edition instances. |
ProductKey | String | No | a1BwAGV**** |
The ProductKey of the product to which the gateway device belongs. Note If you specify this parameter, you must also specify the DeviceName parameter.
|
DeviceName | String | No | light |
The name of the gateway device. Note If you specify this parameter, you must also specify the ProductKey parameter.
|
IotId | String | No | Q7uOhVRdZRRlDnTLv****00100 |
The ID of the gateway device. The ID is the unique identifier that is issued by IoT Platform to the gateway device. Note If you specify this parameter, you do not need to specify the ProductKey or DeviceName parameter. The IotId parameter specifies a unique identifier for the device, and corresponds to a combination
of the ProductKey and DeviceName parameters. If you specify the IotId parameter and a combination of the ProductKey and DeviceName parameters at the same time, the IotId parameter takes precedence.
|
In addition to the preceding operation-specific request parameters, you must specify common request parameters when you call this API operation. For more information, see Common request parameters.
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
Code | String | iot.system.SystemException |
The error code returned if the call fails. For more information, see Error codes. |
Data | Struct |
The data returned if the call succeeds. For more information, see the following parameters. |
|
CurrentPage | Integer | 1 |
The page number of the returned page. |
List | Array of deviceInfo |
The details of the sub-device. The details of the sub-device are included in the deviceInfo parameter. |
|
deviceInfo | |||
DeviceName | String | light |
The DeviceName of the sub-device. |
IotId | String | Q7uOhVRdZRRlDnTLv****00100 |
The ID of the sub-device. The ID is the unique identifier that is issued by IoT Platform to the sub-device. |
ProductKey | String | a1BwAGV**** |
The ProductKey of the product to which the sub-device belongs. |
PageCount | Long | 1 |
The total number of pages returned. |
PageSize | Integer | 10 |
The number of entries returned on each page. |
Total | Long | 1 |
The total number of entries returned. |
ErrorMessage | String | A system exception occurred. |
The error message returned if the call fails. |
RequestId | String | E55E50B7-40EE-4B6B-8BBE-D3ED55CCF565 |
The ID of the request. |
Success | Boolean | true |
Indicates whether the call succeeds.
|
Examples
Sample requests
https://iot.cn-shanghai.aliyuncs.com/?Action=GetThingTopo
&ProductKey=a1BwAGV****
&DeviceName=device1
&PageSize=10
&PageNo=1
&<Common request parameters>
Sample success responses
XML
format
<GetThingTopoResponse>
<Data>
<PageCount>1</PageCount>
<PageSize>2</PageSize>
<CurrentPage>1</CurrentPage>
<List>
<deviceInfo>
<DeviceName>APItest</DeviceName>
<ProductKey>a1T27vz****</ProductKey>
<IotId>vWxNur6BUApsqjv****000100</IotId>
</deviceInfo>
</List>
<Total>1</Total>
</Data>
<RequestId>93F05C63-9FD1-4CC8-B0FF-6D6C1A6632D1</RequestId>
<Success>true</Success>
</GetThingTopoResponse>
JSON
format
{
"Data": {
"PageCount": 1,
"PageSize": 2,
"CurrentPage": 1,
"List": {
"deviceInfo": [
{
"DeviceName": "APItest",
"ProductKey": "a1T27vz****",
"IotId": "vWxNur6BUApsqjv****000100"
}
]
},
"Total": 1
},
"RequestId": "93F05C63-9FD1-4CC8-B0FF-6D6C1A6632D1",
"Success": true
}
Error codes
For a list of error codes, visit the API Error Center.