Product management service

更新时间:
复制 MD 格式

This service provides Application Programming Interface (API) operations for managing Internet of Things (IoT) products. Cloud applications can use these operations to query product lists and individual products.

Query the product list of a project

Description

PathVersionDescriptioncloudToken required
/cloud/thing/productList/get1.1.0Queries the list of products in the current project.Yes

Request parameters

ParameterTypeRequiredDescription
pageNointYesThe page number for paged query. The value starts from 1.
pageSizeintYesThe number of entries per page.

Response parameters

ParameterTypeDescription
productKeyStringThe product key.
dataFormatStringThe data format.
netTypeStringThe network connection type.
productSecretStringProduct key
nodeTypeStringThe node type.
nameStringThe product name.
regionStringThe region.
categoryIdLongThe ID of the category to which the product belongs.
statusIntegerThe product status.
  • 0: In development
  • 1: Published
gmtCreateDateThe time when the product was created.
gmtModifiedDateThe time when the product was last modified.
productIdLongThe product ID.
rbacTenantIdStringThe tenant ID.

Examples

  • Request example
    {
        "id": 1508232047194,
        "request": {
            "cloudToken": "109049c80xxxxxxxx6f62e29a3ba",
            "apiVer": "1.1.0"
        },
        "params": {
            "pageNo" : 1,
            "pageSize" : 10 
        },
        "version": "1.0"
    }
  • Successful response example
    {
        "code": 200,
        "data": [{
            "gmtModified": 1517562992000,
            "productModel": "niki_test_prodcut_model",
            "productKey": "a1xxxxCf",
            "image": "logo",
            "productId": 95959,
            "dataFormat": "CUSTOM_FORMAT",
            "netType": "NET_CELLULAR",
            "productSecret": "Y1kxxxxCw",
            "nodeType": "DEVICE",
            "gmtCreate": 1517562992000,
            "name": "test_name",
            "region": "cn-hangzhou",
            "rbacTenantId": "2BF8238E359xxxxxxxx9C7180CF6",
            "categoryId": 61,
            "status": "DEVELOPMENT_STATUS"
        }],
        "id": "db13e9ae-c617-xxxx-xxxx-a1e4f43e36ec"
    }

Query a single product

Description

PathVersionDescriptioncloudToken required
/cloud/thing/product/get1.1.0Queries the details of a specified product.Yes

Request parameters

ParameterTypeRequiredDescription
productKeyStringYesThe product key of the IoT product.

Response parameters

ParameterTypeDescription
productKeyStringThe product key.
dataFormatStringThe data format.
netTypeStringThe network connection type.
productSecretStringThe product secret.
nodeTypeStringThe node type.
nameStringThe product name.
regionStringThe region.
categoryIdLongThe ID of the category to which the product belongs.
statusIntegerThe product status.
  • 0: In development
  • 1: Published
gmtCreateDateCreated At
gmtModifiedDateLast Modified
productIdLongThe product ID.
rbacTenantIdStringThe tenant ID.

Examples

  • Sample request
    {
        "id": 1508232047194,
        "request": {
            "cloudToken": "109049c8xxxxxxxxf6f62e29a3ba",
            "apiVer": "1.1.0"
        },
        "params": {
            "productKey": "a1dxxxxkl"
        },
        "version": "1.0"
    }
  • Sample success response
    {
        "code": 200,
        "data": {
            "gmtModified": 1517217645000,
            "productKey": "a1xxxxCW",
            "productId": 87634,
            "dataFormat": "ALINK_FORMAT",
            "netType": "NET_WIFI",
            "productSecret": "tfbxxxxKKj",
            "nodeType": "DEVICE",
            "gmtCreate": 1517208303000,
            "name": "Fan",
            "region": "cn-shanghai",
            "rbacTenantId": "755ED7C7810xxxxxxxxBC48BF0247",
            "categoryId": 285,
            "status": "RELEASE_STATUS"
        },
        "id": "6aad0b12-2192-xxxx-xxxx-08a2bc0b5c2a"
    }

Generate device certificates in a batch (cloud-generated device names)

Description

PathVersionDescriptioncloudToken required
/cloud/amount/device/generate1.1.2This operation automatically generates device certificates. The system assigns the device names. After the certificates are generated, you can call the /living/device/apply/query operation to download them.Yes

Request parameters

ParameterTypeRequiredDescription
productKeyStringYesProductKey
amountIntYesThe number of devices to produce in the batch.

Response parameters

ParameterTypeDescription
batchIdStringThe batch production number.

Examples

  • Request example
    {
        "id": "1508232047195",
        "request": {
            "cloudToken": "10904xxxxxxxxf62e29a3ba",
            "apiVer": "1.1.2"
        },
        "params": {
            "productKey": "a1xxxxikl",
            "amount":100
        },
        "version": "1.0"
    }
  • Successful response example
    {
        "code": 200,
        "data": "12345"
        "id": "1508232047195"
    }

Create a production batch by uploading device names

Description

PathVersionDescriptioncloudToken required
/cloud/device/name/upload1.1.2Uploads a list of device names to get a batch number.Yes
Note This operation uploads a list of names for the devices that you want to produce. The operation returns a batch ID (batchId). The device certificates are not generated at this stage. You must call the "Generate device certificates from a production batch (using uploaded device names)" operation to generate the certificates.

Request parameters

ParameterTypeRequiredDescription
productKeyStringYesProductKey
deviceNamesArrayYesA list of specified device names. Each batch can contain up to 1,000 names.

Response parameters

ParameterTypeDescription
dataStringThe batch production number, which is the batchId.

Examples

  • Request example
    {
        "id": "1508232047196",
        "request": {
            "cloudToken": "109049c8xxxxxxxxf6f62e29a3ba",
            "apiVer": "1.1.2"
        },
        "params": {
            "productKey": "a1xxxxikl",
        "deviceNames": ["deviceName1","deviceName2"]
        },
        "version": "1.0"
    }
  • Successful response example
    {
        "code": 200,
        "data": "12345",
    }  

Generate device certificates from a production batch (using uploaded device names)

Description

PathVersionDescriptioncloudToken required
/cloud/name/device/generate1.1.2Generates device certificates from a production batch. This is used in scenarios where you upload device names for batch production.Yes
Note This operation generates device certificates based on a batch ID (batchId). It must be used in conjunction with the "Create a production batch by uploading device names" operation.

Request parameters

ParameterTypeRequiredDescription
productKeyStringYesThe product key of the IoT product.
batchIdStringYesThe batch production number.

Response parameters

ParameterTypeDescription
batchIdStringThe batch production number.

Examples

  • Request example
    {
        "id": "1508232047195",
        "request": {
            "cloudToken": "109049c8xxxxxxxx2e29a3ba",
            "apiVer": "1.1.2"
        },
        "params": {
            "productKey": "a1dxxxxkl",
        "batchId": "1"
        },
        "version": "1.0"
    }
  • Successful response example
    {
        "code": 200,
        "data": "1",
        "id": "1508232047195"
    }                     

Query the device certificate list by batch ID

Description

PathVersionDescriptioncloudToken required
/living/device/apply/query 1.0.1Queries the list of device certificates by batch ID.Yes

Request parameters

ParameterTypeRequiredDescription
applyIdStringYesBatch ID
pageNointYesThe page number for paged query. The value starts from 1.
pageSizeintYesThe number of entries per page. The maximum value is 200.

Response parameters

ParameterTypeDescription
totalNumintThe total number of device certificates in the batch.
itemsJSON listA list of device certificates.

The following table describes the parameters in items.

ParameterTypeDescription
iotIdStringThe iotId of the device.
productKeyStringThe productKey of the device.
deviceNameStringDevice name
deviceSecretStringThe deviceSecret of the device.
deviceIdStringThe deviceId of the device.
statusintThe device status: 0 - Inactive; 1 - Active.

Examples

  • Request example
    {
    "request":{
            "apiVer":"1.0.1",
            "cloudToken":"921fb5617xxxx45c34e9d074c"
        },
        "id":"348f786a-b6b2-xxxx-xxxx-d8a55442399a",
        "params":{
            "applyId":"124639",
            "pageNo":1,
            "pageSize":2
         },
         "version":"1.0"
    }
  • Successful response example
    {
        "code":200,
        "data":{
            "totalNum":90,
            "items":[
                {
                    "iotId":"07njQmUOxxxx0101",
                    "deviceSecret":"g41b3wEtxxxxHo7Rs9",
                    "productKey":"a1rxxxxxTs",
                    "deviceName":"07nxxxxxa75U",
                    "deviceId":"07nxxxxo8kAa75U",
                    "status":0
                },
                {
                    "iotId":"0aXlIGxxxxBc2000101",
                    "deviceSecret":"bLrDcbxxxxxpk3CrKm",
                    "productKey":"axxxxTs",
                    "deviceName":"0aXxxxx1Bc2",
                    "deviceId":"0aXlxxxxc1Bc2",
                    "status":0
                }
            ]
        },
        "id":"348f786a-b6b2-xxxx-xxxx-d8a55442399a"
    }

Create a production batch (for NVR products)

Description

PathVersionDescriptioncloudToken required
/living/cloud/product/nvr/device/generate1.0.0Produces NVR devices in a batch based on a specified quantity. This also produces IPC sub-devices.Yes

Request parameters

ParameterTypeRequiredDescription
productKeyStringYesNVR Product Key
amountIntYesThe number of NVR devices to produce in the batch. The value ranges from 1 to 10,000.

Response parameters

ParameterTypeDescription
dataStringThe NVR batch number.

Examples

  • Request example
    {
        "id": "1508232047195",
        "request": {
            "cloudToken": "10904xxxxxxxxf62a3ba",
            "apiVer": "1.0.0"
        },
        "params": {
            "productKey": "a1xxxxikl",
            "amount": 1000
        },
        "version": "1.0"
    }
  • Successful response example
    {
        "code": 200,
        "data": "11",
        "id": "1508232047195"
    }

Query the device certificate list by batch ID (for NVR products)

Description

PathVersionDescriptioncloudToken required
/living/cloud/product/nvr/device/cert/query 1.0.0Queries the list of device certificates by batch ID.Yes

Request parameters

ParameterTypeRequiredDescription
batchIdStringYesThe batch ID.
productKeyStringYesThe productKey of the NVR product.
pageNointYesThe page number for paged query. The value starts from 1.
pageSizeintYesThe number of entries per page. The value ranges from 1 to 20.

Response parameters

ParameterTypeDescription
totalintThe total number of NVR device certificates in the batch.
NvrDeviceCertListJSON listA list of device certificates.
pageNointThe page number for paged query. The value starts from 1.
pageSizeintThe number of entries per page. The value ranges from 1 to 20.

The following table describes the parameters in NvrDeviceCertList.

ParameterTypeDescription
ipcNumintThe number of sub-devices under the NVR gateway.
subDeviceCertListDeviceInfo arrayA list of device certificates for the sub-devices.
nvrDeviceCertInfoDeviceInfoThe device certificate information for the NVR device.

The following table describes the parameters in DeviceInfo.

iotIdStringThe iotId of the device.
productKeyStringThe productKey of the device.
deviceNameStringThe deviceName of the device.
deviceSecretStringThe deviceSecret of the device.

Examples

  • Request example
    {
    "request":{
            "apiVer":"1.0.0",
            "cloudToken":"921fb5617xxxx49d074c"
        },
        "id":"348f786a-b6b2-xxxx-xxxx-d8a55442399a",
        "params":{
            "batchId":"124639",
            "productKey":"axxxxxSbfCe",
            "pageNo":1,
            "pageSize":2
         },
         "version":"1.0"
    }
  • Successful response example
    {
    "code":200,
    "data":{
    "NvrDeviceCertList":[
    {
    "subDeviceCertList":[
    {
    "iotId":"09cxxxx0101",
    "deviceSecret":"e2RexxxxMepCL4n",
    "productKey":"a1xxxx3Q",
    "deviceName":"09cxxxxFfgn"
    },
    {
    "iotId":"0Ay8zxxxx000101",
    "deviceSecret":"lYQaxxxxSmdMFC",
    "productKey":"a1xxxx3Q",
    "deviceName":"0AyxxxxRpp"
    },
                        {
    "iotId":"0Md9bpxxxx00101",
    "deviceSecret":"ZVflxxxxW5pW",
    "productKey":"a1xxxx3Q",
    "deviceName":"0Mdxxxxeoqd"
    }
    ],
    "nvrDeviceCertInfo":{
    "iotId":"vcR91xxxx000101",
    "deviceSecret":"RYV9xxxxXltunD",
    "productKey":"a1xxxxCe",
    "deviceName":"vcRxxxxMUf"
    },
    "ipcNum”:3
    }
    ],
    "totalNum":500,
    "pageNo":235,
    "pageSize":1
    },
    "id":"f0d2acef-xxxx-488b-xxxx-049b95f66a00"
    }