Call this operation to query the products of an account.
Description
You can query all the products of an account, or query only Pro Edition products or Basic Edition products.
Request parameters
Parameter | Type | Required | Description |
---|---|---|---|
Action | String | Yes | The operation that you want to perform. Set the value to QueryProductList. |
CurrentPage | Integer | Yes | The page of returned results to be displayed. |
PageSize | Integer | Yes | The number of products per page in the response. The maximum limit is 200. |
AliyunCommodityCode | String | No | The edition of products that you want to query. Value options: iothub_senior: Pro Edition products. iothub: Basic Edition products.
Note If you do not specify this parameter, all the products of the account will be returned.
|
Common Request Parameters | - | Yes | See Common 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. |
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 | Product data returned when the call is successful. See the following table Data. |
Parameter | Type | Description |
---|---|---|
PageSize | Integer | The number of products displayed per page. |
PageCount | Integer | The total number of pages. |
CurrentPage | Integer | The current page number. |
Total | Integer | The total number of products. |
List | List | Information of all the products that have been queried. See the following table ProductInfo.
Note Product information is listed in reverse chronological order.
|
Parameter | Type | Description |
---|---|---|
DataFormat | Integer | The data format in which devices of the product communicate with IoT Platform. 0: Do not parse/Custom (passthrough mode), indicating a custom serial port data format. In this mode, devices can report raw data such as binary data to IoT Platform. Alibaba Cloud IoT Platform runs the data parsing script that you have configured in the console to convert the raw data into Alink JSON-formatted data. 1: Alink JSON. The standard data format which is defined by IoT Platform for data communication between devices and IoT Platform is JSON.
Note This parameter is only available for Pro Edition products.
|
ProductKey | String | The product key. It is the globally unique identifier (GUID) of the product. |
NodeType | Integer | The node type of the product. Values: 0: Device. A device cannot be mounted with sub-devices. It can connect to IoT Platform either directly or as a sub-device of a gateway. 1: Gateway. A gateway can be mounted with sub-devices. It can manage sub-devices, maintain the topological relationships with sub-devices, and synchronize the topological relationships to IoT Platform. |
ProductName | String | The name of the product. |
DeviceCount | Integer | The number of devices of the product. |
GmtCreate | Long | The time when the product was created. |
Description | String | The product description. |
Examples
https://iot.cn-shanghai.aliyuncs.com/?Action=QueryProductList
&CurrentPage=1
&PageSize=10
&Public Request Parameters
Response example
- JSON format
{ "RequestId":"57b144cf-09fc-4916-a272-a62902d5b207", "Success": true, "Data": { "PageCount": 4, "PageSize": 20, "List": { "ProductInfo": [ { "DataFormat": 0, "ProductKey": "a1*********", "NodeType": 0, "ProductName": "test123123123", "DeviceCount": 4, "GmtCreate": 1517479077000, "Description": "Description" }, { "DataFormat": 1, "ProductKey": "a1*********", "NodeType": 0, "ProductName": "Test Event", "DeviceCount": 0, "GmtCreate": 1517466635000 "Description": "Description" } ] }, "CurrentPage": 1, "Total": 79 } }
- XML format
<? xml version="1.0" encoding="UTF-8"? > <QueryProductListResponse> <RequestId>57b144cf-09fc-4916-a272-a62902d5b207</RequestId> <Success>true</Success> <Data> <PageCount>4</PageCount> <PageSize>20</PageSize> <List> <ProductInfo> <DataFormat>0</DataFormat> <ProductKey>a1*********</ProductKey> <NodeType>0</NodeType> <ProductName>test123123123</ProductName> <DeviceCount>4</DeviceCount> <GmtCreate>1517479077000</GmtCreate> <Description>Description</Description> </ProductInfo> <ProductInfo> <DataFormat>1</DataFormat> <ProductKey>a1*********</ProductKey> <NodeType>0</NodeType> <ProductName>Test Event</ProductName> <DeviceCount>0</DeviceCount> <GmtCreate>1517466635000</GmtCreate> <Description>Description</Description> </ProductInfo> </List> <CurrentPage>1</CurrentPage> <Total>79</Total> </Data> </QueryProductListResponse>