Queries products by tag.

Limits

Each Alibaba Cloud account can run a maximum of 500 queries per second (QPS).

Note Resource Access Management (RAM) users of an Alibaba Cloud account share the quota of the account.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ListProductByTags

The operation that you want to perform. Set the value to ListProductByTags.

IotInstanceId String No iot_instc_pu****_c*-v64********

The instance ID. This parameter is not required for public instances. However, the parameter is required for the instances that you have purchased.

CurrentPage Integer No 1

The number of the page to return.

PageSize Integer No 10

The number of entries to return on each page. Valid values: 1 to 50.

ProductTag.N.TagKey String No room

The keys of product tags.

ProductTag.N.TagValue String No 102

The values of the product tags.

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.

Note You can search products by a combination of a tag key and tag value. You can also search products by tag key. Multiple product tags that you specify are related by the logic OR relation.

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.

ErrorMessage String A system exception occurred.

The error message returned if the call fails.

ProductInfos Array of ProductInfo

The details of the products returned if the call succeeds. The details are included in the ProductInfo parameter.

Note The returned product information is sorted in reverse-chronological order based on the time when the products were created.
ProductInfo
CreateTime Long 1545355537000

The creation time of each product.

Description String This is a test product.

The description of the product.

NodeType Integer 0

The node type of the product. Valid values:

  • 0: device. Sub-devices cannot be attached to a device. A device can connect to IoT Platform directly or as a sub-device of a gateway.
  • 1: gateway. Sub-devices can be attached to a gateway. A gateway can manage sub-devices, maintain the topologies with sub-devices, and synchronize the topologies to IoT Platform.
ProductKey String a1BwAGV****

The key of the product. A product key is a globally unique identifier (GUID) that is issued by IoT Platform to a new product.

ProductName String Street light

The name of the product.

RequestId String E55E50B7-40EE-4B6B-8BBE-D3ED55CCF565

The ID of the request.

Success Boolean true

Indicates whether the call succeeds.

  • true: The call succeeded.
  • false: The call failed.

Examples

Sample requests

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>

Sample success responses

XML format

<ListProductByTagsResponse>
  <RequestId>09AA366E-81EC-4CF0-B49E-61BCD7C95338</RequestId>
  <Success>true</Success>
  <ProductInfos>
        <ProductInfo>
              <ProductKey>a1T27vzfrCj</ProductKey>
              <NodeType>0</NodeType>
              <CreateTime>1581595942000</CreateTime>
              <ProductName>Street light</ProductName>
        </ProductInfo>
        <ProductInfo>
              <ProductKey>a1POX0c3iug</ProductKey>
              <NodeType>0</NodeType>
              <CreateTime>1580898565000</CreateTime>
              <ProductName>TSL test</ProductName>
        </ProductInfo>
  </ProductInfos>
</ListProductByTagsResponse>

JSON format

{
    "RequestId": "09AA366E-81EC-4CF0-B49E-61BCD7C95338",
    "Success": true,
    "ProductInfos": {
        "ProductInfo": [
            {
                "ProductKey": "a1T27vzfrCj",
                "NodeType": 0,
                "CreateTime": 1581595942000,
                "productName": "Street light"
            },
            {
                "ProductKey": "a1POX0c3iug",
                "NodeType": 0,
                "CreateTime": 1580898565000,
                "ProductName": "TSL test"
            }
        ]
    }
}

Error codes

For a list of error codes, visit the API Error Center.