Call this operation to query the topological relationships of a specified device.

Request parameters

Parameter Type Required Description
Action String Yes The operation that you want to perform. Set the value to GetThingTopo.
IotId String No

A unique identifier of the device whose topological relationships you want to query.

Note If you use this parameter, ProductKey and DeviceName are not required. IotId is a globally unique identifier (GUID) of a device, and corresponds to a combination of ProductKey and DeviceName. If you specify both IotId and the combination of ProductKey and DeviceName, the system follows IotId.
ProductKey String No

The ProductKey of the device whose topological relationships you want to query.

Note If you use this parameter, DeviceName is required.
DeviceName String No

The name of the device whose topological relationships you want to query.

Note If you use this parameter, ProductKey is required.
PageSize Integer Yes The number of devices which have topological relationships with this device displayed on each page. Limit: A maximum of 50 devices can be displayed on one page.
PageNo Integer Yes The page of returned results to be displayed.
Common Request Parameters - Yes See Common parameters.

Response parameters

Parameter Type Description
RequestId String The globally unique ID generated by Alibaba Cloud for the request.
Success Boolean Indicates whether the call is successful. A value of true indicates that the call is successful. A value of false indicates that the call has failed.
ErrorMessage String The error message returned when the call fails.
Code String The error code returned when the call fails. For more information about error codes, see Error codes.
Data Data The information of devices which have topological relationships with this specified device. For more information, see the following table DeviceDataInfo.
Table 1. DeviceDataInfo
Parameter Type Description
PageCount Integer The total page number.
PageSize Integer The number of devices displayed on each page.
List List A collection of device information. For more information , see DeviceInfo.
CurrentPage Integer The current page number.
Total Integer The total number of devices which have topological relationships with this device.
Table 2. DeviceInfo
Parameter Type Description
IotId String The device ID which is a unique identifier of the device.
ProductKey String The unique identifier of the product that the device belongs to.
DeviceName String The device name.
DeviceSecret String The device secret.

Examples

Request example

https://iot.cn-shanghai.aliyuncs.com/?Action=GetThingTopo
&ProductKey=al*********
&DeviceName=device1
&PageSize=10
&PageNo=1
&Public Request Parameters

Response example

  • JSON format

    {
       "RequestId":"57b144cf-09fc-4916-a272-a62902d5b207",
      "Success": true
        "Data": {
            "PageCount": 1,
            "PageSize": 10,
            "List": {
                "deviceInfo": [
                    {
                        "DeviceName": "device1",
                        "ProductKey": "al*********",
    		    "DeviceSecret":"abc******"
                        "IotId": "SR8FiTu1R9tlUR2V1bmi0010*****"
                    }
                ]
            },
            "CurrentPage": 1,
            "Total": 1
        },
        
    }
  • XML format

    <? xml version='1.0' encoding='UTF-8'? >
    <GetThingTopoResponse>
        <RequestId>57b144cf-09fc-4916-a272-a62902d5b207</RequestId>
        <Success>true</Success>
        <Data>
            <PageCount>1</PageCount>
            <PageSize>10</PageSize>
            <List>
                <DeviceInfo>
                    <DeviceName>device1</DeviceName>
                    <ProductKey>al*********</ProductKey>
                    <DeviceSecret>abc******</DeviceSecret>
                    <IotId>SR8FiTu1R9tlUR2V1bmi0010*****</IotId>
                </DeviceInfo>
            </List>
            <CurrentPage>1</CurrentPage>
            <Total>1</Total>
        </Data>
    </GetThingTopoResponse>