You can call this operation to query products by tags.

Request parameters

Parameter Type Required Description
Action String Yes The operation that you want to perform. Set the value to ListProductByTags.
ProductTags List<String> Yes The tags of the products. A tag consists of a TagKey and a TagValue, which correspond to the key and value of the tag respectively. For more information, see ProductTag.
  • You can search products by combining TagKey and TagValue.
  • You can search products by TagKey only.
  • When you specify multiple tags, the logical relationship among these tags is OR.
Page​Size Integer​ No The number of products displayed per page in the response. Maximum value: 50. Default value: 10.
CurrentPage Integer No The page of returned results to be displayed. Default value: 1.
Common request parameters - Yes See Common parameters.
Table 1. ProductTag
Parameter Type Required Description
TagKey String Yes The key of the tag.
TagValue String No The value of the tag.

Response parameters

Parameter Type Description
RequestId String The GUID 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.
ProductInfos List<String> The list of products returned when the call is successful. For more information, see the table ProductInfo.
Table 2. ProductInfo
Parameter Type Description
ProductKey String The unique identifier of the product.
ProductName String The name of the product.
NodeType Integer The node type of the product.
CreateTime Long The time when the product was created.
Description String The description of the product.

Examples

Request example

https://iot.cn-shanghai.aliyuncs.com/&Action=ListProductByTags
&CurrentPage=1
&PageSize=10
&ProductTag. 1. TagKey=Reen
&ProductTag. 1. TagValue=reen
&ProductTag. 2. TagKey=Lock
&ProductTag. 2. TagValue=1234
&Common request parameters

Response example

JSON format

{
  "ProductInfos": {
    "ProductInfo": [
      {
        "Description": "Bulbs in the rooms",
        "ProductKey": "a1h7knJdld1",
        "NodeType": 0,
        "CreateTime": 1545355537000,
        "ProductB: "Bulbs"
      }
    ]
  },
  "RequestId": "2E410BE3-C688-487B-9BF1-F04B33632CCC",
  "Success": true
}

XML format

<ListProductByTagsResponse>
    <ProductInfos>
		<ProductInfo>
			<Description>Bulbs in the rooms</Description>
			<ProductKey>a1h7knJdld1</ProductKey>
			<NodeType>0</NodeType>
			<CreateTime>1545355537000</CreateTime>
			<ProductName>Bulbs</ProductName>
		</ProductInfo>
	</ProductInfos>
	<RequestId>2E410BE3-C688-487B-9BF1-F04B33632CCC</RequestId>
	<Success>true</Success>
</ListProductByTagsResponse>