Queries the details of a product.

Limits

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.

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 QueryProduct

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

ProductKey String Yes a1BwAGV****

The ProductKey of the product that you want to query. A ProductKey is a globally unique identifier (GUID) that is issued by IoT Platform to a new product. You can use the IoT Platform console or call the QueryProductList operation to view the details of all the products within the current account.

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

The ID of the instance. This parameter is not required for the public instance but required for Enterprise Edition instances.

In addition to the preceding operation-specific request parameters, you must specify common request parameters when you call this 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 product information returned if the call is successful.

AliyunCommodityCode String iothub_senior

The edition of the product. This parameter indicates whether a Thing Specification Language (TSL) model was used.

Valid values:

  • iothub: No TSL model was used.
  • iothub_senior: A TSL model was used.
AuthType String secret

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

  • secret: DeviceSecrets were used to authenticate the devices.
  • id2: IoT Internet Device ID was used to authenticate the devices.
  • x509: X.509 certificates were used to authenticate the devices.
CategoryKey String Lighting

The identifier of the category to which the product belongs.

This parameter is returned if the product uses the TSL model of a standard category that is pre-defined by IoT Platform.

This parameter is available if the AliyunCommodityCode parameter is set to iothub_senior.

CategoryName String Street lighting

The name of the product category.

This parameter is returned if the product uses the TSL model of a standard category that is pre-defined by IoT Platform.

This parameter is available if the AliyunCommodityCode parameter is set to iothub_senior.

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 available if the AliyunCommodityCode parameter is set to iothub_senior.

Valid values:

  • 0: custom data format. A custom serial data format is used. In this mode, the devices can report raw data, such as binary data streams. IoT Platform converts the raw data into standard Alink JSON data by using a 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 A smart street light.

The description of the product.

DeviceCount Integer 0

The number of devices under the product.

GmtCreate Long 1581595942000

The time when the product was created. The value is a timestamp in milliseconds.

Id2 Boolean false

Indicates whether IoT Internet Device ID was enabled. Valid values:

  • true: IoT Internet Device ID was enabled.
  • false: IoT Internet Device ID was disabled.
NetType Integer 3

The network connection method. Valid values:

  • 3: Wi-Fi
  • 6: cellular network (2G/3G/4G/5G)
  • 7: Ethernet
  • 8: others
NodeType Integer 0

The node type of the product. This parameter is available if 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 topological relationships with sub-devices, and synchronize the topological relationships to IoT Platform.
Owner Boolean true

Indicates whether the operation was called by the owner of the product.

  • true: yes
  • false: no
ProductKey String a1T27vz****

The ProductKey of the product. The ProductKey is the globally unique identifier (GUID) that is issued by IoT Platform to the product.

ProductName String Street light

The name of the product.

ProductSecret String U5tW7i44uilc****

The ProductSecret of the product.

ProductStatus String DEVELOPMENT_STATUS

The status of the product.

  • DEVELOPMENT_STATUS: The product is being implemented.
  • RELEASE_STATUS: The product was published.
ProtocolType String modbus

The type of the protocol that is used by the sub-devices to connect to a gateway.

This parameter is available if the AliyunCommodityCode parameter is set to iothub_senior and the NodeType parameter is set to 1. Valid values:

  • modbus: Modbus
  • opc-ua: OPC UA
  • customize: custom protocol
  • ble: BLE
  • zigbee: ZigBee
ValidateType Integer 1

The level of the data verification. Valid values:

  • 2: no verification IoT Platform does not verify the data. All data is forwarded.

    In the IoT Platform console, the data is not displayed on the TSL Data tab of the Device Details page.

  • 1: low-level verification IoT Platform verifies only the identifier and dataType fields of the data.
  • 0: high-level verification IoT Platform verifies all fields of the data.

    The products that were created before October 14, 2020 support only high-level verification.

The products that were created on October 14, 2020 or later support low-level verification or no verification.

After verification, you can perform the following operations:

  • Forward all data. The data that fails to pass the verification is tagged. For more information, see Data formats.
  • View data in the IoT Platform console. Go to the TSL Data tab of the Device Details page.
ErrorMessage String A system exception occurred.

The error message returned if the call fails.

RequestId String E4F94B97-1D64-4080-BFD2-67461667AA43

The ID of the request.

Success Boolean true

Indicates whether the call was successful.

  • true: The call was successful.
  • false: The call failed.

Examples

Sample requests

https://iot.cn-shanghai.aliyuncs.com/?Action=QueryProduct
&ProductKey=a1BwAGV****
&<Common request parameters>

Sample success responses

XML format

<QueryProductResponse>
  <Data>
        <Owner>true</Owner>
        <CategoryName>Street lighting</CategoryName>
        <DataFormat>1</DataFormat>
        <ProductKey>a1BwAGV****</ProductKey>
        <ProductStatus>DEVELOPMENT_STATUS</ProductStatus>
        <GmtCreate>1581595942000</GmtCreate>
        <ProductSecret>U5tW7i44uilc****</ProductSecret>
        <NodeType>0</NodeType>
        <ProductName>Street light</ProductName>
        <ValidateType>1</ValidateType>
        <DeviceCount>0</DeviceCount>
        <NetType>3</NetType>
        <AuthType>secret</AuthType>
        <CategoryKey>Lighting</CategoryKey>
        <Id2>false</Id2>
        <AliyunCommodityCode>iothub_senior</AliyunCommodityCode>
  </Data>
  <RequestId>DA5A3C45-D457-48ED-9A20-AEDEA8503401</RequestId>
  <Success>true</Success>
</QueryProductResponse>

JSON format

{
    "Data": {
        "Owner": true,
        "CategoryName": "Street lighting",
        "DataFormat": 1,
        "ProductKey": "a1BwAGV****",
        "ProductStatus": "DEVELOPMENT_STATUS",
        "GmtCreate": 1581595942000,
        "ProductSecret": "U5tW7i44uilc****",
        "NodeType": 0,
        "ProductName": "Street light",
        "ValidateType":1,
        "DeviceCount": 0,
        "NetType": 3,
        "AuthType": "secret",
        "CategoryKey": "Lighting",
        "Id2": false,
        "AliyunCommodityCode": "iothub_senior"
    },
    "RequestId": "DA5A3C45-D457-48ED-9A20-AEDEA8503401",
    "Success": true
}

Error codes

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