Call this operation to notify a specified gateway to build topological relationships with sub-devices.

Notes

  • The successful result returned only indicates that the request to build topological relationships was successfully sent to the gateway, however, it does not mean that the gateway has successfully built the topological relationships.
  • When you develop the device SDK of the gateway, configure it to subscribe to the topic for topologicalrelationship building notifications. For more information about the topic and data format, see Notify the gateway to add topological relationships of the connected sub-devices.

Request parameters

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

The identifier (IotId) of the gateway device that you want to notify.

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

The unique identifier of the product which the gateway device belongs to.

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

The name of the gateway device.

Note If you use this parameter, GwProductKey is required.
DeviceListStr List Yes The sub-devices that you want to mount to the specified gateway. The value of DeviceListStr is a JSON string. For more information, see the following table DeviceList.
Common Request Parameters - Yes See Common parameters.
Table 1. DeviceList
Parameter Type Required Description
ProductKey String No The ProductKey of a sub-device.
Note If you use this parameter, DeviceName is required.
DeviceName String No The name of a sub-device.
Note If you specify this parameter, you must also specify ProductKey.
IotId String No

The identifier of a sub-device.

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

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 data returned when the call is successful. For more information, see the following table Data.
Table 2. Data
Parameter Type Description
MessageId String The ID of the message which IoT Platform sends to the gateway device.

Examples

Request example

https://iot.cn-shanghai.aliyuncs.com/?Action=NotifyAddThingTopo
&GwProductKey=al34634xvd
&GwDeviceName=test
&DeviceListStr=[{"productKey":"al3452sljee","deviceName":"test1"},{"productKey":"al123dfadd","deviceName":"test2"}]
&Public Request Parameters

Response example

  • JSON format

    {
      "RequestId":"419A3FC1-B517-4958-9414-5546765FA51F",
      "Success":true,
      "Data":{
         "MessageId":"abcabc123"
      }
    }
  • XML format

    <? xml version='1.0' encoding='UTF-8'? >
    <NotifyAddThingTopoResponse>
        <RequestId>419A3FC1-B517-4958-9414-5546765FA51F</RequestId>
        <Success>true</Success>
        <Data>
        <MessageId>abcabc123</MessageId>
        </Data>
    </NotifyAddThingTopoResponse>