必须保证设备在线,会实时下发各种配置信息到设备整个链路完成才算初始化完成,密码必传(如果需要下发私有密码,此密码最好保证和私有密码采用同一个,防止后续部分cgi操作不支持问题)
https://open.eye4cloud.com/{{open_id}}/open/v1/device/initDevice| 字段名 | 类型 | 是否必填 | 备注 |
|---|---|---|---|
| device_id | string | 是 | 设备id |
| timestamp | int64 | 是 | 时间戳,单位:秒 |
| nonce | string | 是 | 随机字符串,8~20个字符 |
| sign | string | 是 | 具体实现方法,请参考《生成sign的示例代码》 |
| imei | string | 否 | 设备IMEI,可传空字符串 |
| data | string | 否 | 自定义data,可传空字符串 |
| password | string | 是 | 设置开放平台模式密码 |
{
"device_id": "xxx",
"timestamp": 1755685731,
"nonce": "dask43hfad",
"sign": "xxxxxxx",
"password": ""
}
curl 'https://open.eye4cloud.com/xxxxx/open/v1/device/initDevice' \
-H 'Content-Type: application/json' \
--data-raw '{
"device_id": "xxx",
"timestamp": 1757472185,
"nonce": "",
"sign": "",
"password": ""
}'
| 字段名 | 类型 | 备注 |
|---|---|---|
| error_code | int | 状态码:0正常,其他异常 |
| error_message | string | 错误信息:正常为success |
示例:
{
"error_code": 0,
"error_message": "success",
"error_tips": ""
}