Queries all products.
QPS limits
-
Each Alibaba Cloud account can run up to 50 queries per second (QPS).Note The RAM users of an Alibaba Cloud account share the quota of the Alibaba Cloud account.
-
If the product of the value of the CurrentPage parameter and the value of the PageSize parameter is greater than or equal to 100,000, the QPS of this operation decreases.
In this case, each Alibaba Cloud account can run up to 2 QPS.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | QueryProductList |
The operation that you want to perform. Set the value to QueryProductList. |
CurrentPage | Integer | Yes | 1 |
The number of the page to return. |
PageSize | Integer | Yes | 2 |
The number of entries to return on each page. Valid values: 1 to 200. |
IotInstanceId | String | No | iot_instc_pu****_c*-v64******** |
The ID of the instance. You can view the ID of the instance on the Overview page in the IoT Platform console. Notice
For more information, see Overview. |
ResourceGroupId | String | No | rg-acfmxazb4ph**** |
The ID of the resource group to which the product belongs. You can log on to the Resource Management console to view the details of the resource group. Notice
You can specify a value for this parameter only if you have activated Resource Management. If you leave this parameter empty, the information about all products in the current account is queried. |
AliyunCommodityCode | String | No | iothub_senior |
The type of the product. Valid values:
Note If you do not configure this parameter, all products are returned.
|
In addition to the preceding operation-specific request parameters, you must configure common request parameters when you call this operation. For more information, see Common request parameters.
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. |
Data | Struct |
The product information returned if the call is successful. For more information, see the following parameters. |
|
CurrentPage | Integer | 1 |
The page number of the returned page. |
List | Array of ProductInfo |
The details of the products. Note The returned product information is sorted in reverse-chronological order based on
the time when the products were created.
|
|
ProductInfo | |||
AuthType | String | secret |
The authentication method that was used to connect the devices of the product to IoT Platform. Valid values:
|
DataFormat | Integer | 1 |
The data format that was used by a communication protocol to transmit data between the devices and IoT Platform. This parameter is available only if the AliyunCommodityCode parameter is set to iothub_senior. Valid values:
|
Description | String | This is a test product. |
The description of the product. |
DeviceCount | Integer | 128 |
The number of devices in the product. |
GmtCreate | Long | 1581595942000 |
The time when the product was created. The value is a timestamp in milliseconds. |
NodeType | Integer | 0 |
The node type of the product. This parameter is available only if the AliyunCommodityCode parameter is set to iothub_senior. Valid values:
|
ProductKey | String | a1T27vz**** |
The ProductKey of the product. When you create a product, a ProductKey is a globally unique identifier (GUID) that is issued by IoT Platform to the product. |
ProductName | String | Street light |
The name of the service. |
PageCount | Integer | 92 |
The total number of returned pages. |
PageSize | Integer | 2 |
The number of entries returned per page. |
Total | Integer | 184 |
The total number of products. |
ErrorMessage | String | A system exception occurred. |
The error message returned if the request fails. |
RequestId | String | 4B4ECF2C-6222-42EC-A4B5-C12202E71CEA |
The ID of the request. |
Success | Boolean | true |
Indicates whether the call was successful.
|
Examples
Sample requests
https://iot.cn-shanghai.aliyuncs.com/?Action=QueryProductList
&CurrentPage=1
&PageSize=2
&ResourceGroupId=rg-acfmxazb4ph****
&<Common request parameters>
Sample success responses
XML
format
<QueryProductListResponse>
<Data>
<PageCount>92</PageCount>
<PageSize>2</PageSize>
<List>
<ProductInfo>
<DataFormat>1</DataFormat>
<ProductKey>a1A0D4t****</ProductKey>
<NodeType>0</NodeType>
<ProductName>Street light</ProductName>
<DeviceCount>1</DeviceCount>
<GmtCreate>1569233025000</GmtCreate>
<AuthType>secret</AuthType>
</ProductInfo>
<ProductInfo>
<DataFormat>1</DataFormat>
<ProductKey>a1dEvuQ****</ProductKey>
<NodeType>0</NodeType>
<ProductName>Custom sub-device</ProductName>
<DeviceCount>0</DeviceCount>
<GmtCreate>1568690432000</GmtCreate>
<AuthType>secret</AuthType>
</ProductInfo>
</List>
<CurrentPage>1</CurrentPage>
<Total>184</Total>
</Data>
<RequestId>4B4ECF2C-6222-42EC-A4B5-C12202E71CEA</RequestId>
<Success>true</Success>
</QueryProductListResponse>
JSON
format
{
"Data": {
"PageCount": 92,
"PageSize": 2,
"List": {
"ProductInfo": [
{
"DataFormat": 1,
"ProductKey": "a1A0D4t****",
"NodeType": 0,
"ProductName": "Street light",
"DeviceCount": 1,
"GmtCreate": 1569233025000,
"AuthType": "secret"
},
{
"DataFormat": 1,
"ProductKey": "a1dEvuQ****",
"NodeType": 0,
"ProductName": "Custom sub-device",
"DeviceCount": 0,
"GmtCreate": 1568690432000,
"AuthType": "secret"
}
]
},
"CurrentPage": 1,
"Total": 184
},
"RequestId": "4B4ECF2C-6222-42EC-A4B5-C12202E71CEA",
"Success": true
}