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 for a project
- Query a single product
- Generate device certificates in a batch (cloud-generated device names)
- Create a production batch by uploading device names
- Generate device certificates from a production batch (using uploaded device names)
- Query the device certificate list by batch ID
- Create a production batch (for NVR products)
- Query the device certificate list by batch ID (for NVR products)
Query the product list of a project
Description
| Path | Version | Description | cloudToken required |
| /cloud/thing/productList/get | 1.1.0 | Queries the list of products in the current project. | Yes |
Request parameters
| Parameter | Type | Required | Description |
| pageNo | int | Yes | The page number for paged query. The value starts from 1. |
| pageSize | int | Yes | The number of entries per page. |
Response parameters
| Parameter | Type | Description |
| productKey | String | The product key. |
| dataFormat | String | The data format. |
| netType | String | The network connection type. |
| productSecret | String | Product key |
| nodeType | String | The node type. |
| name | String | The product name. |
| region | String | The region. |
| categoryId | Long | The ID of the category to which the product belongs. |
| status | Integer | The product status.
|
| gmtCreate | Date | The time when the product was created. |
| gmtModified | Date | The time when the product was last modified. |
| productId | Long | The product ID. |
| rbacTenantId | String | The 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
| Path | Version | Description | cloudToken required |
| /cloud/thing/product/get | 1.1.0 | Queries the details of a specified product. | Yes |
Request parameters
| Parameter | Type | Required | Description |
| productKey | String | Yes | The product key of the IoT product. |
Response parameters
| Parameter | Type | Description |
| productKey | String | The product key. |
| dataFormat | String | The data format. |
| netType | String | The network connection type. |
| productSecret | String | The product secret. |
| nodeType | String | The node type. |
| name | String | The product name. |
| region | String | The region. |
| categoryId | Long | The ID of the category to which the product belongs. |
| status | Integer | The product status.
|
| gmtCreate | Date | Created At |
| gmtModified | Date | Last Modified |
| productId | Long | The product ID. |
| rbacTenantId | String | The 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
| Path | Version | Description | cloudToken required |
| /cloud/amount/device/generate | 1.1.2 | This 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
| Parameter | Type | Required | Description |
| productKey | String | Yes | ProductKey |
| amount | Int | Yes | The number of devices to produce in the batch. |
Response parameters
| Parameter | Type | Description |
| batchId | String | The 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
| Path | Version | Description | cloudToken required |
| /cloud/device/name/upload | 1.1.2 | Uploads a list of device names to get a batch number. | Yes |
Request parameters
| Parameter | Type | Required | Description |
| productKey | String | Yes | ProductKey |
| deviceNames | Array | Yes | A list of specified device names. Each batch can contain up to 1,000 names. |
Response parameters
| Parameter | Type | Description |
| data | String | The 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
| Path | Version | Description | cloudToken required |
| /cloud/name/device/generate | 1.1.2 | Generates device certificates from a production batch. This is used in scenarios where you upload device names for batch production. | Yes |
Request parameters
| Parameter | Type | Required | Description |
| productKey | String | Yes | The product key of the IoT product. |
| batchId | String | Yes | The batch production number. |
Response parameters
| Parameter | Type | Description |
| batchId | String | The 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
| Path | Version | Description | cloudToken required |
| /living/device/apply/query | 1.0.1 | Queries the list of device certificates by batch ID. | Yes |
Request parameters
| Parameter | Type | Required | Description |
| applyId | String | Yes | Batch ID |
| pageNo | int | Yes | The page number for paged query. The value starts from 1. |
| pageSize | int | Yes | The number of entries per page. The maximum value is 200. |
Response parameters
| Parameter | Type | Description |
| totalNum | int | The total number of device certificates in the batch. |
| items | JSON list | A list of device certificates. |
The following table describes the parameters in items.
| Parameter | Type | Description |
| iotId | String | The iotId of the device. |
| productKey | String | The productKey of the device. |
| deviceName | String | Device name |
| deviceSecret | String | The deviceSecret of the device. |
| deviceId | String | The deviceId of the device. |
| status | int | The 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
| Path | Version | Description | cloudToken required |
| /living/cloud/product/nvr/device/generate | 1.0.0 | Produces NVR devices in a batch based on a specified quantity. This also produces IPC sub-devices. | Yes |
Request parameters
| Parameter | Type | Required | Description |
| productKey | String | Yes | NVR Product Key |
| amount | Int | Yes | The number of NVR devices to produce in the batch. The value ranges from 1 to 10,000. |
Response parameters
| Parameter | Type | Description |
| data | String | The 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
| Path | Version | Description | cloudToken required |
| /living/cloud/product/nvr/device/cert/query | 1.0.0 | Queries the list of device certificates by batch ID. | Yes |
Request parameters
| Parameter | Type | Required | Description |
| batchId | String | Yes | The batch ID. |
| productKey | String | Yes | The productKey of the NVR product. |
| pageNo | int | Yes | The page number for paged query. The value starts from 1. |
| pageSize | int | Yes | The number of entries per page. The value ranges from 1 to 20. |
Response parameters
| Parameter | Type | Description |
| total | int | The total number of NVR device certificates in the batch. |
| NvrDeviceCertList | JSON list | A list of device certificates. |
| pageNo | int | The page number for paged query. The value starts from 1. |
| pageSize | int | The number of entries per page. The value ranges from 1 to 20. |
The following table describes the parameters in NvrDeviceCertList.
| Parameter | Type | Description |
| ipcNum | int | The number of sub-devices under the NVR gateway. |
| subDeviceCertList | DeviceInfo array | A list of device certificates for the sub-devices. |
| nvrDeviceCertInfo | DeviceInfo | The device certificate information for the NVR device. |
The following table describes the parameters in DeviceInfo.
| iotId | String | The iotId of the device. |
| productKey | String | The productKey of the device. |
| deviceName | String | The deviceName of the device. |
| deviceSecret | String | The 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" }