Queries all products.

Description

  • Each Alibaba Cloud account can run a maximum of 50 queries per second (QPS).
    Note RAM users of an Alibaba Cloud account share the quota of the account.
  • If the value of the CurrentPage parameter multiplied by the value of the PageSize parameter equals a value greater than or equal to 100000, the QPS of this operation decreases.

    In this case, each Alibaba Cloud account can run a maximum of 2 QPS.

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 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 instance ID. This parameter is not required for public instances. However, this parameter is required for enterprise-edition instances.

AliyunCommodityCode String No iothub_senior

The edition of the service. Valid values:

  • iothub_senior: A Thing Specification Language (TSL) model is required.
  • iothub: No TSL model is required.
Note If you do not specify this parameter, the details of all services are returned.
ResourceGroupId String No rg-acfmxazb4ph****

The ID of the resource group to which the service belongs. You can log on to the Resource Management console to view the details of the resource group.

If you do not specify this parameter, the system queries the services of all the resource groups in the current account.

In addition to the preceding operation-specific request parameters, you must specify common request parameters when you call this API operation. For more information about common request parameters, see Common 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 service information returned if the call succeeds. 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 services.

Note The returned service information is sorted in reverse-chronological order based on the time when the services were created.
ProductInfo
AuthType String secret

The authentication method that is used to connect the devices of the product to IoT Platform. Valid values:

  • secret: Device secrets are used as the authentication method.
  • id2: IoT Internet Device ID is used as the authentication method.
  • x509: X.509 certificates are used as the authentication method.
DataFormat Integer 1

The data format that is used by a communication protocol to transmit data between the devices and IoT Platform. This parameter is specified only when the AliyunCommodityCode parameter is set to iothub_senior.

Valid values:

  • 0: custom. A custom serial data format is used. In this mode, the device can report raw data, such as binary data streams. IoT Platform converts the raw data into standard Alink JSON data based on the specified data parsing script.
  • 1: Alink JSON. Alink JSON data is transmitted between the devices and IoT Platform. Alink is a data exchange protocol that is pre-defined by IoT Platform.
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 creation time of the product. The value is a timestamp in milliseconds.

NodeType Integer 0

The node type of the product. This parameter is specified only when the AliyunCommodityCode parameter is set to iothub_senior. 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 a1T27vz****

The key of the product. When you create the product, the key is the globally unique identifier (GUID) that is issued by IoT Platform to the product.

ProductName String Street light

The name of the product.

PageCount Integer 92

The total number of pages returned.

PageSize Integer 2

The number of entries returned per page.

Total Integer 184

The total number of products.

ErrorMessage String A system exception has occurred.

The error message returned if the call fails.

RequestId String 4B4ECF2C-6222-42EC-A4B5-C12202E71CEA

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=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
}

Error codes

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