# QueryProductList

调用该接口查看所有产品列表。

# 使用说明

  • 调用本接口时,如果指定页数“CurrentPage”大于查询结果的总页数“PageCount”,返回的“ProductInfo”会为空。此时,您可以根据返回结果总条数“Total”,重新指定“CurrentPage”和“PageSize”,再次调用接口查看产品信息。
  • 例如:假设查询结果共20条,请求参数“PageSize”为5,查询结果总页数“PageCount”会为20÷5=4页,“CurrentPage”设置为1、2、3或4时,“ProductInfo”才会有产品具体信息。如果“CurrentPage”大于4,例如为5,第5页是没有数据的,此时“ProductInfo”就会为空。

# 请求参数

名称 类型 是否必选 示例值 描述
Action String QueryProductList 系统规定参数。取值:QueryProductList。
CurrentPage Integer 1 指定显示返回结果中的第几页。
PageSize Integer 2 指定返回结果中每页显示的产品数量,最大值是200。
IotInstanceId String 6912917943269**** 实例ID。您可在物联网平台控制台的实例概览页面,查看当前实例的ID。

# 返回数据

名称 类型 示例值 描述
Code String iot.system.SystemException 调用失败时,返回的错误码。
Data Struct 调用成功时,返回的产品信息。具体信息请参见以下参数。
CurrentPage Integer 1 当前页号。
List Array of ProductInfo 产品信息列表。
说明
返回的产品信息按照产品创建时间倒序排列。
ProductInfo
AuthType String secret 产品下的设备接入物联网平台的认证方式。
secret:使用设备密钥进行设备身份认证。
DataFormat Integer 1 取值:
1:Alink JSON。平台物联网平台定义的设备与云端的数据交换协议,采用 AlinkJSON 格式。
2:透传/自定义。使用自定义的数据格式。
Description String This is a test product. 产品描述。
DeviceCount Integer 128 产品下的设备数量。
GmtCreate String Fri, 21-Mar-2022 10:04:24 GMT 该产品的创建时间。GMT 格式。
NodeType Integer 0 产品的节点类型。取值:
0:设备,可以直连物联网平台。
ProductKey String a1T27vz**** 产品的ProductKey。创建产品时,物联网平台为该产品颁发的全局唯一标识。
ProductName String 路灯 产品名称。
PageCount Integer 92 总页数。
PageSize Integer 2 每页显示的产品数。
Total Integer 184 产品总数。
ErrorMessage String 系统异常 调用失败时,返回的出错信息。
RequestId String 5uBO0qPQCgvK6HFOSszqN5baKBaAIxfS 平台为该请求生成的唯一标识符。
Success Boolean true 是否调用成功。
true:表示调用成功。
false:表示调用失败。

# 示例

请求示例

http://open.${区域}.fenydata.com/fenydata-java-open/?Action=QueryProductList
&IotInstanceId=70255861902711****
&CurrentPage=1
&PageSize=2
&<公共请求参数>

正常返回示例

XML格式

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<xml>
    <Data>
        <PageCount>92</PageCount>
        <PageSize>2</PageSize>
        <List>
            <ProductInfo>
                <AuthType>secret</AuthType>
                <DataFormat>1</DataFormat>
                <DeviceCount>1</DeviceCount>
                <GmtCreate>Tue, 27-May-2025 01:56:48 GMT</GmtCreate>
                <NodeType>0</NodeType>
                <ProductKey>a1A0D4t****</ProductKey>
                <ProductName>路灯产品</ProductName>
            </ProductInfo>
            <ProductInfo>
                <AuthType>secret</AuthType>
                <DataFormat>1</DataFormat>
                <DeviceCount>0</DeviceCount>
                <GmtCreate>Tue, 27-May-2025 01:56:48 GMT</GmtCreate>
                <NodeType>0</NodeType>
                <ProductKey>a1dEvuQ****</ProductKey>
                <ProductName>子设备custom</ProductName>
            </ProductInfo>
        </List>
        <CurrentPage>1</CurrentPage>
        <Total>184</Total>
    </Data>
    <RequestId>5uBO0qPQCgvK6HFOSszqN5baKBaAIxfS</RequestId>
    <Success>true</Success>
</xml>

JSON格式

{
  "Data": {
    "PageCount": 92,
    "PageSize": 2,
    "List": {
      "ProductInfo": [
        {
          "AuthType": "secret",
          "DataFormat": 1,
          "DeviceCount": 1,
          "GmtCreate": "Tue, 27-May-2025 01:56:48 GMT",
          "NodeType": 0,
          "ProductKey": "a1A0D4t****",
          "ProductName": "路灯产品"
        },
        {
          "AuthType": "secret",
          "DataFormat": 1,
          "DeviceCount": 0,
          "GmtCreate": "Tue, 27-May-2025 01:56:48 GMT",
          "NodeType": 0,
          "ProductKey": "a1dEvuQ****",
          "ProductName": "子设备custom"
        }
      ]
    },
    "CurrentPage": 1,
    "Total": 184
  },
  "RequestId": "5uBO0qPQCgvK6HFOSszqN5baKBaAIxfS",
  "Success": true
}