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 GUID that is issued by IoT Platform to a product. You can use the IoT Platform console or call the QueryProductList operation to view the information about all products within the current account.

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

The ID of the instance. You can view the instance ID on the Overview page in the IoT Platform console.

Notice
  • If your instance has an ID, you must configure this parameter. If you do not set this parameter, the call fails.
  • If your instance has no Overview page or ID, you do not need to set this parameter.

For more information, see Overview.

In addition to the preceding operation-specific request parameters, you must specify 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.

AliyunCommodityCode String iothub_senior

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

Valid values:

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

The authentication method that was 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 Lamp

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 was 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. A custom serial data format was used. In this case, the device can submit 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 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. When you create a product, a 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 developed.
  • RELEASE_STATUS: The product was published.
ProtocolType String modbus

The type of the protocol that was used by the sub-devices to connect with 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. All data is forwarded.
  • 0: high-level verification. IoT Platform verifies all fields of the data. Only the data that passes the verification is forwarded.

    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 view the data that passes or fails the verification.

  • In the IoT Platform console, the data is displayed on the TSL Data tab of the Device Details page. The data that fails the verification is not displayed.
  • You can view the data that fails the verification in the checkFailedData parameter of the forwarded data. For more information, see Data formats.
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.