Call this API to query the details of a product.

Limits

You can call this API at a frequency of up to 50 times per second.

Request parameters

Parameter Type Required Description
Action String Yes The operation that you want to perform. Set the value to QueryProduct.
ProductKey String Yes The ProductKey of the product. ProductKey is issued by IoT Platform. It is the globally unique identifier (GUID) of a product. This value is generated by IoT Platform when the product is successfully created.
Common Request Parameters - Yes For more information about common request parameters, 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 The product information returned when the call is successful. See the following table Data.
Table 1. Data
Parameter Type Description
GmtCreate Long The time when the product was created.
DataFormat Integer

The data format of communications between devices and IoT Platform. This parameter is only for Pro Edition products. Values:

0: Passthrough mode (Do not parse/Custom) indicating that you want to use a custom serial port data format. In this mode, devices 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 IoT Platform console to convert the raw data into Alink JSON-formatted data.

1: Alink JSON. This is the standard data format that is defined by Alibaba Cloud IoT Platform for data exchange between devices and IoT Platform.

Note This parameter is only available for Pro Edition products.
Description String The product description.
DeviceCount Integer The number of devices of this product.
NodeType Integer

The node type of a Pro Edition 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.

ProductKey String The globally unique identifier of the product generated by IoT Platform when the product is created.
ProductName String The name of the product.
ProductSecret String The product secret.
CategoryName String The device type of a Pro Edition product. The value is the device type which you specified when you were creating the product.
CategoryKey String The identifier of the device type of a Pro Edition product.
AliyunCommodityCode String Values:
  • iothub: IoT Platform Basic.
  • iothub_senior: IoT Platform Pro.
ProductStatus String The status of the product.
  • DEVELOPMENT_STATUS: The product is not published.
  • RELEASE_STATUS: The product is published.
NetType Integer The method for the devices of this product to connect to the Internet.
  • 3: WiFi
  • 6: Cellular (2G/3G/4G)
  • 7: Ethernet
  • 8: Other

Examples

Request example

https://iot.cn-shanghai.aliyuncs.com/?Action=QueryProduct
&ProductKey=al*********
&Public Request Parameters

Response example

  • JSON format
    {
    	"Data": {
    		"Owner": true,
    		"DataFormat": 1,
    		"CategoryName": "",
    		"ProductStatus": "DEVELOPMENT_STATUS",
    		"ProductKey": "a1*******",
    		"GmtCreate": 1530117156000,
    		"NodeType": 0,
    		"ProductSecret": "i6YZucqlp6******",
    		"ProductName": "protest",
    		"NetType": 3,
    		"DeviceCount": 1,
    		"Id2": false,
    		"AliyunCommodityCode": "iothub_senior"
    	},
    	"RequestId": "E4F94B97-1D64-4080-BFD2-67461667AA43",
    	"Success": true
    }
  • XML format
    <?xml version="1.0" encoding="UTF-8" ?>
    <QueryProductResponse>
    	<Data>
    		<Owner>true</Owner>
    		<DataFormat>1</DataFormat>
    		<CategoryName></CategoryName>
    		<ProductStatus>DEVELOPMENT_STATUS</ProductStatus>
    		<ProductKey>a1*******</ProductKey>
    		<GmtCreate>1530117156000</GmtCreate>
    		<NodeType>0</NodeType>
    		<ProductSecret>i6YZucqlp6******</ProductSecret>
    		<ProductName>protest</ProductName>
    		<NetType>3</NetType>
    		<DeviceCount>1</DeviceCount>
    		<Id2>false</Id2>
    		<AliyunCommodityCode>iothub_senior</AliyunCommodityCode>
    	</Data>
    	<RequestId>E4F94B97-1D64-4080-BFD2-67461667AA43</RequestId>
    	<Success>true</Success>
    </QueryProductResponse>