Call this operation to query the groups that a device is in.

Limit

Currently, a device can be included in up to ten groups.

Request parameters

Parameter Type Required Description
Action String Yes The operation that you want to perform. Set the value to QueryDeviceGroupByDevice.
ProductKey String Yes The unique identifier of the product that the device belongs to.
DeviceName String Yes The device name.
Common request parameters - Yes SeeCommon 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.
Code String The error code returned when the call fails. See Error codes.
ErrorMessage String The error message returned when the call fails.
GroupInfos List<GroupInfo> The group information returned when the call is successful. See the following table GroupInfo.
Table 1. GroupInfo
Parameter Type Description
GroupId String The group ID.
GroupName String The group name.
UtcCreate String The time when the group was created.
GroupDesc String The description of the group.

Examples

Request example

http://iot.cn-shanghai.aliyuncs.com/?Action=QueryDeviceGroupByDevice
&DeviceName=test456
&ProductKey=a1SKk9K****
&Public Request Parameters

Response example

  • JSON format

    {
      "RequestId": "7941C8CD-7764-4A94-8CD9-E2762D4A73AC",
      "GroupInfos": {
        "GroupInfo": [
          {
            "GroupDesc": "father desc",
            "GroupName": "father1543152336554",
            "UtcCreate": "2018-11-25T13:25:37.000Z",
            "GroupId": "6a3FF2XE2BKayWsM"
          }
        ]
      },
      "Success": true
    }
  • XML format

    <? xml version="1.0" encoding="UTF-8" ? >
    <QueryDeviceGroupByDevice>
    	<RequestId>7941C8CD-7764-4A94-8CD9-E2762D4A73AC</RequestId>
    	<GroupInfos>
    		<GroupInfo>
    			<GroupDesc>father desc</GroupDesc>
    			<GroupName>father1543152336554</GroupName>
    			<UtcCreate>2018-11-25T13:25:37.000Z</UtcCreate>
    			<GroupId>6a3FF2XE2BKayWsM</GroupId>
    		</GroupInfo>
    	</GroupInfos>
    	<Success>true</Success>
    </QueryDeviceGroupByDevice>