物联网设备
物联网设备
新建设备
| POST | /admin-api/iot/device-info/create |
|---|
请求数据类型 :application/json;charset=UTF-8
请求参数
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
|---|---|---|---|---|
| productId | 产品Id | json | false | string |
| deviceName | 设备唯一标识;建议使用设备设备的序列号、IMEI | json | true | string |
| deviceAlias | 设备别名 | json | false | string |
| deviceShipModel | 设备芯片型号 | json | false | string |
| startupState | 启动状态 | json | false | int |
| localLogMode | 是否开启设备本地日志;1:开启;0:关闭 | json | false | int |
| remark | 备注信息 | json | false | string |
| Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
响应状态
| 状态码 | 说明 |
|---|---|
| 200 | OK |
响应参数
| 参数名称 | 参数说明 | 数据类型 |
|---|---|---|
| status | 状态码,值为0正常,其他值为异常 | int |
| code | 结果同status一样,冗余字段 | int |
| data | 创建成功返回设备Id | long |
| msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": 1419193028933640,
"msg": ""
}获取设备列表
| GET | /admin-api/iot/device-info/list |
|---|
请求数据类型 :application/json;charset=UTF-8
请求参数
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
|---|---|---|---|---|
| productId | 查询指定产品ID的设备,productId和productKey只需要传一个就可以 | json | - | long |
| productKey | 查询指定产品productKey的设备,productId和productKey只需要传一个就可以 | json | - | string |
| deviceName | 模糊查询指定设备的deviceName | query | false | string |
| deviceAlias | 模糊查询指定设备别名 | query | false | string |
| deviceState | 设备状态;-1:未激活;0:离线;1:在线 | query | false | int32 |
| startupState | 启动状态,可选值1或0 | query | false | int32 |
| createTime | 创建时间时间范围,示例值(2024-11-12 00:00:00 - 2024-11-29 23:59:59) | query | false | array[datatime] |
| Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
响应状态
| 状态码 | 说明 |
|---|---|
| 200 | OK |
响应参数
| 参数名称 | 参数说明 | 数据类型 |
|---|---|---|
| status | 状态码,值为0正常,其他值为异常 | int |
| code | 结果同status一样,冗余字段 | int |
| data | 数据体 | array |
| ---id | 设备id | long |
| ---deviceName | 设备唯一名称 | string |
| ---deviceAlias | 设备别名 | string |
| ---deviceSecret | 设备秘钥,已脱敏,获取设备秘钥请查看:获取设备秘钥 | string |
| ---productId | 产品ID | long |
| ---productName | 产品名称 | string |
| ---productKey | productKey | string |
| ---productSecret | productSecret,数据已脱敏 | string |
| ---RSSI | 设备RSSI信号 | int |
| ---deviceShipModel | 设备芯片型号 | string |
| ---deviceSoftVersion | 设备软件版本 | string |
| ---deviceLongitude | 设备最新上传的经度 | string |
| ---deviceLatitude | 设备最新上传的纬度 | string |
| ---localLogMode | 设备是否开启本地日志上传;1:开启;0:关闭 | int |
| ---deviceState | 设备状态;-1:未激活;0:离线;1:在线 | int |
| ---startupState | 启动状态,1:启用;0:禁用 | int |
| ---lastTimeOnline | 设备上一次上线时间,时间戳13位 | long |
| ---nodeType | 节点类型,继承产品的nodeType | int |
| ---networkType | 联网类型,继承产品的networkType | int |
| ---remark | 备注信息 | string |
| ---deviceJson | 设备附加信息,格式为JSON字符串 | string |
| ---moduleName | 模块名称 | string |
| ---createTime | 创建时间,时间戳,时间戳13位 | long |
| msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": [
{
"productId": 1366004616577024,
"deviceName": "test1234",
"deviceSecret": "********************************",
"rssi": null,
"deviceShipModel": null,
"deviceSoftVersion": null,
"deviceLongitude": null,
"deviceLatitude": null,
"deviceAlias": null,
"deviceState": -1,
"localLogMode": 0,
"deviceJson": null,
"lastTimeOnline": null,
"startupState": 1,
"remark": null,
"createTime": 1730518222000,
"id": 1417640527249408,
"productKey": "kza2ib",
"productName": "remoteCard",
"nodeType": 1,
"networkType": 1,
"moduleName": null,
"deleted": false
},
{
"productId": 1390387061211136,
"deviceName": "test",
"deviceSecret": "********************************",
"rssi": null,
"deviceShipModel": null,
"deviceSoftVersion": null,
"deviceLongitude": null,
"deviceLatitude": null,
"deviceAlias": null,
"deviceState": -1,
"localLogMode": 0,
"deviceJson": null,
"lastTimeOnline": null,
"startupState": 1,
"remark": null,
"createTime": 1726989113000,
"id": 1414749481172992,
"productKey": "3c5fgd",
"productName": "wifi控制一路继电器",
"nodeType": 1,
"networkType": 1,
"moduleName": null,
"deleted": false
}
],
"msg": ""
}获取设备分页
| GET | /admin-api/iot/device-info/page |
|---|
请求数据类型 :application/json;charset=UTF-8
请求参数
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
|---|---|---|---|---|
| pageNo | 页码,从 1 开始,示例值(1) | query | true | int32 |
| pageSize | 每页条数,最大值为 1000,示例值(10) | query | true | int32 |
| productId | 查询指定产品ID的设备,productId和productKey只需要传一个就可以 | json | - | long |
| productKey | 查询指定产品productKey的设备,productId和productKey只需要传一个就可以 | json | - | string |
| deviceName | 模糊查询指定设备的deviceName | query | false | string |
| deviceAlias | 模糊查询指定设备别名 | query | false | string |
| deviceState | 设备状态;-1:未激活;0:离线;1:在线 | query | false | int32 |
| startupState | 启动状态,可选值1或0 | query | false | int32 |
| createTime | 创建时间时间范围,示例值(2024-11-12 00:00:00 - 2024-11-29 23:59:59) | query | false | array[datatime] |
| Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
响应状态
| 状态码 | 说明 |
|---|---|
| 200 | OK |
响应参数
| 参数名称 | 参数说明 | 数据类型 |
|---|---|---|
| status | 状态码,值为0正常,其他值为异常 | int |
| code | 结果同status一样,冗余字段 | int |
| data | 创建成功返回产品Id | object |
| ---total | 返回结果条数 | int |
| ---list | 返回数据列表 | array |
| ------id | 产品id | long |
| ------productName | 产品名称 | string |
| ------productKey | productKey | string |
| ------productSecret | productSecret,数据已脱敏 | string |
| ------productCateId | 产品品类Id | long |
| ------productCateName | 产品品类名称 | string |
| ------deviceCounts | 该产品下拥有多少台设备 | long |
| ------nodeType | 节点类型 | int |
| ------networkType | 联网类型 | int |
| ------dynReg | 是否开启动态注册 | int |
| ------productImg | 产品图片 | string |
| ------productDesc | 产品描述 | string |
| ------createTime | 创建时间,时间戳 | long |
| msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": {
"list": [
{
"productId": 1366004616577024,
"deviceName": "test1234",
"deviceSecret": "********************************",
"rssi": null,
"deviceShipModel": null,
"deviceSoftVersion": null,
"deviceLongitude": null,
"deviceLatitude": null,
"deviceAlias": null,
"deviceState": -1,
"localLogMode": 0,
"deviceJson": null,
"lastTimeOnline": null,
"startupState": 1,
"remark": null,
"createTime": 1730518222000,
"id": 1417640527249408,
"productKey": "kza2ib",
"productName": "remoteCard",
"nodeType": 1,
"networkType": 1,
"moduleName": null,
"deleted": false
},
{
"productId": 1390387061211136,
"deviceName": "test",
"deviceSecret": "********************************",
"rssi": null,
"deviceShipModel": null,
"deviceSoftVersion": null,
"deviceLongitude": null,
"deviceLatitude": null,
"deviceAlias": null,
"deviceState": -1,
"localLogMode": 0,
"deviceJson": null,
"lastTimeOnline": null,
"startupState": 1,
"remark": null,
"createTime": 1726989113000,
"id": 1414749481172992,
"productKey": "3c5fgd",
"productName": "wifi控制一路继电器",
"nodeType": 1,
"networkType": 1,
"moduleName": null,
"deleted": false
}
],
"total": 2
},
"msg": ""
}获取设备信息
| GET | /admin-api/iot/device-info/get |
|---|
请求数据类型 :application/json;charset=UTF-8
请求参数
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
|---|---|---|---|---|
| id | 设备id | query | true | long |
| Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
响应状态
| 状态码 | 说明 |
|---|---|
| 200 | OK |
响应参数
| 参数名称 | 参数说明 | 数据类型 |
|---|---|---|
| status | 状态码,值为0正常,其他值为异常 | int |
| code | 结果同status一样,冗余字段 | int |
| data | 数据体 | object |
| ---id | 设备id | long |
| ---deviceName | 设备唯一名称 | string |
| ---deviceAlias | 设备别名 | string |
| ---deviceSecret | 设备秘钥,已脱敏,获取设备秘钥请查看:获取设备秘钥 | string |
| ---productId | 产品ID | long |
| ---productName | 产品名称 | string |
| ---productKey | productKey | string |
| ---productSecret | productSecret,数据已脱敏 | string |
| ---RSSI | 设备RSSI信号 | int |
| ---deviceShipModel | 设备芯片型号 | string |
| ---deviceSoftVersion | 设备软件版本 | string |
| ---deviceLongitude | 设备最新上传的经度 | string |
| ---deviceLatitude | 设备最新上传的纬度 | string |
| ---localLogMode | 设备是否开启本地日志上传;1:开启;0:关闭 | int |
| ---deviceState | 设备状态;-1:未激活;0:离线;1:在线 | int |
| ---startupState | 启动状态,1:启用;0:禁用 | int |
| ---lastTimeOnline | 设备上一次上线时间,时间戳13位 | long |
| ---nodeType | 节点类型,继承产品的nodeType | int |
| ---networkType | 联网类型,继承产品的networkType | int |
| ---remark | 备注信息 | string |
| ---deviceJson | 设备附加信息,格式为JSON字符串 | string |
| ---moduleName | 模块名称 | string |
| ---createTime | 创建时间,时间戳,时间戳13位 | long |
| msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": {
"productId": 1390387061211136,
"deviceName": "test",
"deviceSecret": "********************************",
"rssi": null,
"deviceShipModel": null,
"deviceSoftVersion": null,
"deviceLongitude": null,
"deviceLatitude": null,
"deviceAlias": null,
"deviceState": -1,
"localLogMode": 0,
"deviceJson": null,
"lastTimeOnline": null,
"startupState": 1,
"remark": null,
"createTime": 1726989113000,
"id": 1414749481172992,
"productKey": "3c5fgd",
"productName": "wifi控制一路继电器",
"nodeType": 1,
"networkType": 1,
"moduleName": null,
"deleted": false
},
"msg": ""
}更新设备信息
| PUT | /admin-api/iot/device-info/update |
|---|
请求数据类型 :application/json;charset=UTF-8
请求参数
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
|---|---|---|---|---|
| id | 要更新的设备id | json | true | long |
| deviceAlias | 设备别名 | json | false | string |
| deviceShipModel | 设备芯片型号 | json | false | string |
| startupState | 启动状态 | json | false | int |
| localLogMode | 是否开启设备本地日志;1:开启;0:关闭 | json | false | int |
| remark | 备注信息 | json | false | string |
| Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
响应状态
| 状态码 | 说明 |
|---|---|
| 200 | OK |
响应参数
| 参数名称 | 参数说明 | 数据类型 |
|---|---|---|
| status | 状态码,值为0正常,其他值为异常 | int |
| code | 结果同status一样,冗余字段 | int |
| data | 更新成功返回true | boolean |
| msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": true,
"msg": ""
}删除设备
| DELETE | /admin-api/iot/device-info/delete |
|---|
请求数据类型 :application/json;charset=UTF-8
请求参数
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
|---|---|---|---|---|
| id | 要删除的设备id | json | true | long |
| Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
响应状态
| 状态码 | 说明 |
|---|---|
| 200 | OK |
响应参数
| 参数名称 | 参数说明 | 数据类型 |
|---|---|---|
| status | 状态码,值为0正常,其他值为异常 | int |
| code | 结果同status一样,冗余字段 | int |
| data | 删除成功返回true | boolean |
| msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": true,
"msg": ""
}切换设备上传本地日志开关
| PUT | /admin-api/iot/device-info/updateLocalMode |
|---|
请求数据类型 :application/json;charset=UTF-8
请求参数
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
|---|---|---|---|---|
| id | 要更新的设备id | json | true | long |
| localLogMode | 是否开启设备本地日志;1:开启;0:关闭 | json | false | int |
| Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
响应状态
| 状态码 | 说明 |
|---|---|
| 200 | OK |
响应参数
| 参数名称 | 参数说明 | 数据类型 |
|---|---|---|
| status | 状态码,值为0正常,其他值为异常 | int |
| code | 结果同status一样,冗余字段 | int |
| data | 更新成功返回状态信息 | string |
| msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": "打开上传设备本地日志成功",
"msg": ""
}获取设备mqtt连接信息
| GET | /admin-api/iot/device-info/mqttLink/ |
|---|
请求数据类型 :application/json;charset=UTF-8
请求参数
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
|---|---|---|---|---|
| deviceId | 设备id,如deviceId: 1414749481172992,则请求路径为:/admin-api/iot/device-info/mqttLink/1414749481172992 | path | true | long |
| Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
响应状态
| 状态码 | 说明 |
|---|---|
| 200 | OK |
响应参数
| 参数名称 | 参数说明 | 数据类型 |
|---|---|---|
| status | 状态码,值为0正常,其他值为异常 | int |
| code | 结果同status一样,冗余字段 | int |
| data | 数据体 | object |
| ---clientId | 连接客户端id | string |
| ---host | 连接主机名 | string |
| ---keepalive | 连接保活时长,单位:秒 | int |
| ---username | 连接用户名 | string |
| ---password | 连接密码 | string |
| ---port | 连接端口 | int |
| msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": {
"username": "testt&WSaSUV",
"password": "7C09680B50158019F1D05210xxxxE4B91D248DC481xxxx9E335B9A570C536F9",
"clientId": "WSaSUV.testt|timestamp=1733585804380,signmethod=hmacsha256|",
"host": "127.0.0.1",
"port": 8084,
"keepalive": 120
},
"msg": ""
}获取设备mqtts连接信息
| GET | /admin-api/iot/device-info/mqttsLink/ |
|---|
请求数据类型 :application/json;charset=UTF-8
请求参数
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
|---|---|---|---|---|
| deviceId | 设备id,如deviceId: 1414749481172992,则请求路径为:/admin-api/iot/device-info/mqttsLink/1414749481172992 | path | true | long |
| Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
响应状态
| 状态码 | 说明 |
|---|---|
| 200 | OK |
响应参数
| 参数名称 | 参数说明 | 数据类型 |
|---|---|---|
| status | 状态码,值为0正常,其他值为异常 | int |
| code | 结果同status一样,冗余字段 | int |
| data | 数据体 | object |
| ---clientId | 连接客户端id | string |
| ---host | 连接主机名 | string |
| ---keepalive | 连接保活时长,单位:秒 | int |
| ---username | 连接用户名 | string |
| ---password | 连接密码 | string |
| ---port | 连接端口 | int |
| msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": {
"username": "testt&WSaSUV",
"password": "78D86D3FFBF472E1AEB98C94459E67E09xxxxC4FDA20322BxxxxAF4615661DD3",
"clientId": "WSaSUV.testt|timestamp=1733586261742,signmethod=hmacsha256|",
"host": "127.0.0.1",
"port": 8084,
"keepalive": 120
},
"msg": ""
}获取设备mqtt连接信息2
| GET | /admin-api/iot/device-info/mqttinfo |
|---|
请求数据类型 :application/json;charset=UTF-8
请求参数
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
|---|---|---|---|---|
| productKey | productKey | query | true | string |
| deviceName | deviceName | query | true | string |
| Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
响应状态
| 状态码 | 说明 |
|---|---|
| 200 | OK |
响应参数
| 参数名称 | 参数说明 | 数据类型 |
|---|---|---|
| status | 状态码,值为0正常,其他值为异常 | int |
| code | 结果同status一样,冗余字段 | int |
| data | mqtt连接信息,格式为JSON格式字符串 | string |
| msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": "{\"clientId\":\"WSaSUV.testt|timestamp=1733625248583,signmethod=hmacsha256|\",\"host\":\"127.0.0.1\",\"keepalive\":120,\"password\":\"E1BCA2691A1679351898860CD6FF8AB32C2DA71B33A6AFCF288FE255B0842E48\",\"port\":8084,\"username\":\"testt&WSaSUV\"}",
"msg": ""
}获取设备mqtts连接信息2
| GET | /admin-api/iot/device-info/mqttsinfo |
|---|
请求数据类型 :application/json;charset=UTF-8
请求参数
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
|---|---|---|---|---|
| productKey | productKey | query | true | string |
| deviceName | deviceName | query | true | string |
| Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
响应状态
| 状态码 | 说明 |
|---|---|
| 200 | OK |
响应参数
| 参数名称 | 参数说明 | 数据类型 |
|---|---|---|
| status | 状态码,值为0正常,其他值为异常 | int |
| code | 结果同status一样,冗余字段 | int |
| data | mqtt连接信息,格式为JSON格式字符串 | string |
| msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": "{\"clientId\":\"WSaSUV.testt|timestamp=1733625248583,signmethod=hmacsha256|\",\"host\":\"127.0.0.1\",\"keepalive\":120,\"password\":\"E1BCA2691A1679351898860CD6FF8AB32C2DA71B33A6AFCF288FE255B0842E48\",\"port\":8084,\"username\":\"testt&WSaSUV\"}",
"msg": ""
}获取设备最新的属性值
| GET | /admin-api/iot/device-info/tslProperties |
|---|
请求数据类型 :application/json;charset=UTF-8
请求参数
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
|---|---|---|---|---|
| deviceId | 设备ID | query | true | string |
| Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
响应状态
| 状态码 | 说明 |
|---|---|
| 200 | OK |
响应参数
| 参数名称 | 参数说明 | 数据类型 |
|---|---|---|
| status | 状态码,值为0正常,其他值为异常 | int |
| code | 结果同status一样,冗余字段 | int |
| data | 数据列表 | array |
| ---name | 属性名称,同物模型属性一致 | string |
| ---identifier | 属性唯一标识,同物模型属性唯一标识一致 | string |
| ---deviceId | 设备id | long |
| ---deviceName | 设备名称 | string |
| ---productKey | 产品productKey | string |
| ---value | 设备最新上传的属性值 | 数据类型取决于dataType |
| ---dataType | 数据类型 | int |
| ---ts | 最新上传的时间戳,时间戳13位 | long |
| ---accessMode | 属性读写权限;1:只读;2:读写 | int |
| ---icon | 属性图标 | string |
| ---tags | 属性描述符,JSON格式字符串 | string |
| msg | 状态消息 | string |
//数据类型 dataType
INT32(1, "int32(整数型)"),
FLOAT(2, "float(单精度浮点型)"),
DOUBLE(3, "double(双精度浮点型)"),
ENUM(4, "enum(枚举型)"),
BOOL(5, "bool(布尔型)"),
TEXT(6, "text(字符串)"),
DATE(7, "date(时间型)"),
STRUCT(8, "struct(结构体)"),
ARRAY(9, "array(数组)"),
GEOPOINT(10, "geo(地理坐标)");响应示例
{
"status": 0,
"code": 0,
"data": [
{
"name": "开机状态",
"tags": "[{\"value\":0,\"desc\":\"已关机\"},{\"value\":1,\"desc\":\"已开机\"}]",
"icon": null,
"productKey": "kza2ib",
"deviceId": 1417640527249408,
"deviceName": "test1234",
"identifier": "power_on_status",
"value": false,
"dataType": 5,
"ts": "2024-12-08 18:22:23.516",
"accessMode": 1
}
],
"msg": ""
}获取设备属性历史数据分页
| GET | /admin-api/iot/device-info/propLogPage/ |
|---|
请求数据类型 :application/json;charset=UTF-8
请求参数
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
|---|---|---|---|---|
| pageNo | 页码,从 1 开始,示例值(1) | query | true | int32 |
| pageSize | 每页条数,最大值为 1000,示例值(10) | query | true | int32 |
| deviceId | 设备id,如deviceId: 1414749481172992,则请求路径为:/admin-api/iot/device-info/propLogPage/1414749481172992 | path | true | long |
| identifier | 属性唯一标识符 | query | true | string |
| startTime | 查询记录数据起始时间,格式为时间戳13位 | query | true | long |
| endTime | 查询记录数据结束时间,格式为时间戳13位 | query | true | long |
| block | 模块名称 | query | false | string |
| Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
响应状态
| 状态码 | 说明 |
|---|---|
| 200 | OK |
响应参数
| 参数名称 | 参数说明 | 数据类型 |
|---|---|---|
| status | 状态码,值为0正常,其他值为异常 | int |
| code | 结果同status一样,冗余字段 | int |
| data | 数据列表 | array |
| ---ts | 最新上传的时间戳,时间戳13位 | long |
| ---identifier | 属性唯一标识,同物模型属性唯一标识一致 | string |
| ---deviceName | 设备名称 | string |
| ---productKey | 产品productKey | string |
| ---value | 属性值,数据类型取决于dataType | object |
| ---block | 模块名称 | string |
| msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": {
"list": [
{
"ts": 1733653343516,
"value": false,
"block": "default",
"identifier": "power_on_status",
"productKey": "kza2ib",
"deviceName": "test1234"
},
{
"ts": 1733653343354,
"value": false,
"block": "default",
"identifier": "power_on_status",
"productKey": "kza2ib",
"deviceName": "test1234"
},
{
"ts": 1733653343139,
"value": false,
"block": "default",
"identifier": "power_on_status",
"productKey": "kza2ib",
"deviceName": "test1234"
},
{
"ts": 1733653343019,
"value": false,
"block": "default",
"identifier": "power_on_status",
"productKey": "kza2ib",
"deviceName": "test1234"
},
{
"ts": 1733653342960,
"value": false,
"block": "default",
"identifier": "power_on_status",
"productKey": "kza2ib",
"deviceName": "test1234"
},
{
"ts": 1733653342767,
"value": false,
"block": "default",
"identifier": "power_on_status",
"productKey": "kza2ib",
"deviceName": "test1234"
}
],
"total": 6
},
"msg": ""
}配置设备属性
| POST | /admin-api/iot/device-info/propertiesConfig/ |
|---|
请求数据类型 :application/json;charset=UTF-8
请求参数
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
|---|---|---|---|---|
| deviceId | 设备id,如deviceId: 1414749481172992,则请求路径为:/admin-api/iot/device-info/propertiesConfig/1414749481172992 | path | true | long |
| Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
请求参数格式为:键值对方式,如配置属性identifier为test123的属性值为33
{"test123":33}响应状态
| 状态码 | 说明 |
|---|---|
| 200 | OK |
响应参数
| 参数名称 | 参数说明 | 数据类型 |
|---|---|---|
| status | 状态码,值为0正常,其他值为异常 | int |
| code | 结果同status一样,冗余字段 | int |
| data | 创建成功返回设备Id | long |
| msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": true,
"msg": ""
}查询设备服务列表
| GET | /admin-api/iot/device-info/services |
|---|
请求数据类型 :application/json;charset=UTF-8
请求参数
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
|---|---|---|---|---|
| deviceId | 设备ID | query | true | string |
| Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
响应状态
| 状态码 | 说明 |
|---|---|
| 200 | OK |
响应参数
| 参数名称 | 参数说明 | 数据类型 |
|---|---|---|
| status | 状态码,值为0正常,其他值为异常 | int |
| code | 结果同status一样,冗余字段 | int |
| data | 数据列表 | array |
| ---id | 服务 id | long |
| ---name | 服务名称,同物模型服务一致 | string |
| ---identifier | 服务唯一标识,同物模型服务唯一标识一致 | string |
| ---productId | 产品id | long |
| ---productKey | productKey | string |
| ---callType | 调用类型;1:同步;2:异步 | string |
| ---inputParams | 调用入参;格式JSON字符串 | string |
| ---outputParams | 调用出参;格式JSON字符串 | string |
| ---description | 描述 | string |
| ---block | 模块名称 | string |
| ---icon | 属性图标 | string |
| ---createTime | 创建时间 | string |
| msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": [
{
"productId": 1414626985410560,
"productKey": "WSaSUV",
"name": "开机",
"identifier": "power_on_service",
"callType": 2,
"inputParams": "[]",
"outputParams": "[]",
"description": null,
"icon": null,
"block": "default",
"id": 1417218623733760,
"createTime": 1730003203000
},
{
"productId": 1414626985410560,
"productKey": "WSaSUV",
"name": "关机",
"identifier": "power_off_service",
"callType": 2,
"inputParams": "[]",
"outputParams": "[]",
"description": null,
"icon": null,
"block": "default",
"id": 1417218623758336,
"createTime": 1730003203000
},
{
"productId": 1414626985410560,
"productKey": "WSaSUV",
"name": "强制关机",
"identifier": "force_power_off_service",
"callType": 2,
"inputParams": "[]",
"outputParams": "[]",
"description": null,
"icon": null,
"block": "default",
"id": 1417218623766528,
"createTime": 1730003203000
},
{
"productId": 1414626985410560,
"productKey": "WSaSUV",
"name": "重启",
"identifier": "restart_service",
"callType": 2,
"inputParams": "[]",
"outputParams": "[]",
"description": null,
"icon": null,
"block": "default",
"id": 1417218623774720,
"createTime": 1730003203000
},
{
"productId": 1414626985410560,
"productKey": "WSaSUV",
"name": "关闭灯光",
"identifier": "close_led_service",
"callType": 2,
"inputParams": "[]",
"outputParams": "[]",
"description": null,
"icon": null,
"block": "default",
"id": 1417218623782912,
"createTime": 1730003203000
},
{
"productId": 1414626985410560,
"productKey": "WSaSUV",
"name": "打开灯光",
"identifier": "open_led_service123",
"callType": 2,
"inputParams": "[]",
"outputParams": "[]",
"description": null,
"icon": null,
"block": "default",
"id": 1417218623791104,
"createTime": 1730003203000
}
],
"msg": ""
}查询设备服务历史调用记录
| GET | /admin-api/iot/device-info/serviceLogPage/ |
|---|
请求数据类型 :application/json;charset=UTF-8
请求参数
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
|---|---|---|---|---|
| pageNo | 页码,从 1 开始,示例值(1) | query | true | int32 |
| pageSize | 每页条数,最大值为 1000,示例值(10) | query | true | int32 |
| deviceId | 设备id,如deviceId: 1414749481172992,则请求路径为:/admin-api/iot/device-info/serviceLogPage/1414749481172992 | path | true | long |
| identifier | 属性唯一标识符 | query | false | string |
| startTime | 查询记录数据起始时间,格式为时间戳13位 | query | false | long |
| endTime | 查询记录数据结束时间,格式为时间戳13位 | query | false | long |
| block | 模块名称 | query | false | string |
| Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
响应状态
| 状态码 | 说明 |
|---|---|
| 200 | OK |
响应参数
| 参数名称 | 参数说明 | 数据类型 |
|---|---|---|
| status | 状态码,值为0正常,其他值为异常 | int |
| code | 结果同status一样,冗余字段 | int |
| data | mqtt连接信息,格式为JSON格式字符串 | array |
| ---ts | 最新上传的时间戳,时间戳13位 | long |
| ---identifier | 属性唯一标识,同物模型属性唯一标识一致 | string |
| ---deviceName | 设备名称 | string |
| ---productKey | 产品productKey | string |
| ---value | 属性值,数据类型取决于dataType | object |
| ---block | 模块名称 | string |
| msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": {
"list": [
{
"ts": 1733653343516,
"value": false,
"block": "default",
"identifier": "power_on_status",
"productKey": "kza2ib",
"deviceName": "test1234"
},
{
"ts": 1733653343354,
"value": false,
"block": "default",
"identifier": "power_on_status",
"productKey": "kza2ib",
"deviceName": "test1234"
},
{
"ts": 1733653343139,
"value": false,
"block": "default",
"identifier": "power_on_status",
"productKey": "kza2ib",
"deviceName": "test1234"
},
{
"ts": 1733653343019,
"value": false,
"block": "default",
"identifier": "power_on_status",
"productKey": "kza2ib",
"deviceName": "test1234"
},
{
"ts": 1733653342960,
"value": false,
"block": "default",
"identifier": "power_on_status",
"productKey": "kza2ib",
"deviceName": "test1234"
},
{
"ts": 1733653342767,
"value": false,
"block": "default",
"identifier": "power_on_status",
"productKey": "kza2ib",
"deviceName": "test1234"
}
],
"total": 6
},
"msg": ""
}查询设备历史事件分页
| GET | /admin-api/iot/device-info/eventPage/ |
|---|
请求数据类型 :application/json;charset=UTF-8
请求参数
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
|---|---|---|---|---|
| pageNo | 页码,从 1 开始,示例值(1) | query | true | int32 |
| pageSize | 每页条数,最大值为 1000,示例值(10) | query | true | int32 |
| deviceId | 设备id,如deviceId: 1414749481172992,则请求路径为:/admin-api/iot/device-info/eventPage/1414749481172992 | path | true | long |
| identifier | 属性唯一标识符 | query | false | string |
| startTime | 查询记录数据起始时间,格式为时间戳13位 | query | false | long |
| endTime | 查询记录数据结束时间,格式为时间戳13位 | query | false | long |
| eventType | 事件类型,1:info;2:warn;3:error | query | false | int32 |
| block | 模块名称 | query | false | string |
| Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
响应状态
| 状态码 | 说明 |
|---|---|
| 200 | OK |
响应参数
| 参数名称 | 参数说明 | 数据类型 |
|---|---|---|
| status | 状态码,值为0正常,其他值为异常 | int |
| code | 结果同status一样,冗余字段 | int |
| data | 分页数据 | array |
| ---total | 总条数 | int |
| ---list | 分页列表 | object |
| ------ts | 最新上传的时间戳,时间戳13位 | long |
| ------name | 事件名称 | string |
| ------identifier | 属性唯一标识,同物模型属性唯一标识一致 | string |
| ------deviceName | 设备名称 | string |
| ------productKey | 产品productKey | string |
| ------eventType | 事件类型,1:info;2:warn;3:error | int |
| ------outputParams | 输出参数 | string |
| ------block | 模块名称 | string |
| msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": {
"list": [
{
"ts": "",
"outputParams": "",
"eventType": 0,
"identifier": "",
"name": "",
"block": "",
"productKey": "",
"deviceName": ""
}
],
"total": 0
},
"msg": ""
}查询设备订阅列表
| GET | /admin-api/iot/device-info/subscriptions |
|---|
请求数据类型 :application/json;charset=UTF-8
请求参数1
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
|---|---|---|---|---|
| deviceId | 设备id,如deviceId: 1414749481172992,则请求路径为:/admin-api/iot/device-info/eventPage/1414749481172992 | query | true | long |
| Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
请求参数2
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
|---|---|---|---|---|
| productKey | productKey | query | true | string |
| deviceName | deviceName | query | true | string |
| Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
响应状态
| 状态码 | 说明 |
|---|---|
| 200 | OK |
响应参数
| 参数名称 | 参数说明 | 数据类型 |
|---|---|---|
| status | 状态码,值为0正常,其他值为异常 | int |
| code | 结果同status一样,冗余字段 | int |
| data | 数据列表 | array |
| ---node | 节点名称 | string |
| ---topic | topic | string |
| ---clientid | clientid | string |
| ---qos | qos | int |
| ---nl | nl | int |
| ---rap | rap | int |
| ---rh | rh | int |
| msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": [
{
"node": "emqx@127.0.0.1",
"topic": "/sys/kza2ib/cc50e34bf075/thing/ota/firmware/get_reply",
"clientid": "kza2ib.cc50e34bf075|timestamp=2524608000000,_ss=1,_v=sdk-c-4.1.0,securemode=3,signmethod=hmacsha256,ext=3,_conn=tcp_32|",
"qos": 1,
"nl": 0,
"rap": 0,
"rh": 0
},
{
"node": "emqx@127.0.0.1",
"topic": "/sys/kza2ib/cc50e34bf075/thing/event/property/post_reply",
"clientid": "kza2ib.cc50e34bf075|timestamp=2524608000000,_ss=1,_v=sdk-c-4.1.0,securemode=3,signmethod=hmacsha256,ext=3,_conn=tcp_32|",
"qos": 1,
"nl": 0,
"rap": 0,
"rh": 0
},
{
"node": "emqx@127.0.0.1",
"topic": "/sys/kza2ib/cc50e34bf075/thing/service/+",
"clientid": "kza2ib.cc50e34bf075|timestamp=2524608000000,_ss=1,_v=sdk-c-4.1.0,securemode=3,signmethod=hmacsha256,ext=3,_conn=tcp_32|",
"qos": 1,
"nl": 0,
"rap": 0,
"rh": 0
},
{
"node": "emqx@127.0.0.1",
"topic": "/sys/kza2ib/cc50e34bf075/rrpc/request/+",
"clientid": "kza2ib.cc50e34bf075|timestamp=2524608000000,_ss=1,_v=sdk-c-4.1.0,securemode=3,signmethod=hmacsha256,ext=3,_conn=tcp_32|",
"qos": 1,
"nl": 0,
"rap": 0,
"rh": 0
},
{
"node": "emqx@127.0.0.1",
"topic": "/sys/kza2ib/cc50e34bf075/thing/event/+/post_reply",
"clientid": "kza2ib.cc50e34bf075|timestamp=2524608000000,_ss=1,_v=sdk-c-4.1.0,securemode=3,signmethod=hmacsha256,ext=3,_conn=tcp_32|",
"qos": 1,
"nl": 0,
"rap": 0,
"rh": 0
},
{
"node": "emqx@127.0.0.1",
"topic": "/shadow/get/kza2ib/cc50e34bf075",
"clientid": "kza2ib.cc50e34bf075|timestamp=2524608000000,_ss=1,_v=sdk-c-4.1.0,securemode=3,signmethod=hmacsha256,ext=3,_conn=tcp_32|",
"qos": 1,
"nl": 0,
"rap": 0,
"rh": 0
},
{
"node": "emqx@127.0.0.1",
"topic": "/ota/device/upgrade/kza2ib/cc50e34bf075",
"clientid": "kza2ib.cc50e34bf075|timestamp=2524608000000,_ss=1,_v=sdk-c-4.1.0,securemode=3,signmethod=hmacsha256,ext=3,_conn=tcp_32|",
"qos": 1,
"nl": 0,
"rap": 0,
"rh": 0
},
{
"node": "emqx@127.0.0.1",
"topic": "/sys/kza2ib/cc50e34bf075/thing/service/property/set",
"clientid": "kza2ib.cc50e34bf075|timestamp=2524608000000,_ss=1,_v=sdk-c-4.1.0,securemode=3,signmethod=hmacsha256,ext=3,_conn=tcp_32|",
"qos": 1,
"nl": 0,
"rap": 0,
"rh": 0
},
{
"node": "emqx@127.0.0.1",
"topic": "/ext/rrpc/+/sys/kza2ib/cc50e34bf075/thing/service/+",
"clientid": "kza2ib.cc50e34bf075|timestamp=2524608000000,_ss=1,_v=sdk-c-4.1.0,securemode=3,signmethod=hmacsha256,ext=3,_conn=tcp_32|",
"qos": 1,
"nl": 0,
"rap": 0,
"rh": 0
},
{
"node": "emqx@127.0.0.1",
"topic": "/sys/kza2ib/cc50e34bf075/thing/config/log/get_reply",
"clientid": "kza2ib.cc50e34bf075|timestamp=2524608000000,_ss=1,_v=sdk-c-4.1.0,securemode=3,signmethod=hmacsha256,ext=3,_conn=tcp_32|",
"qos": 1,
"nl": 0,
"rap": 0,
"rh": 0
},
{
"node": "emqx@127.0.0.1",
"topic": "/sys/kza2ib/cc50e34bf075/thing/log/post_reply",
"clientid": "kza2ib.cc50e34bf075|timestamp=2524608000000,_ss=1,_v=sdk-c-4.1.0,securemode=3,signmethod=hmacsha256,ext=3,_conn=tcp_32|",
"qos": 1,
"nl": 0,
"rap": 0,
"rh": 0
},
{
"node": "emqx@127.0.0.1",
"topic": "/sys/kza2ib/cc50e34bf075/_thing/diag/post_reply",
"clientid": "kza2ib.cc50e34bf075|timestamp=2524608000000,_ss=1,_v=sdk-c-4.1.0,securemode=3,signmethod=hmacsha256,ext=3,_conn=tcp_32|",
"qos": 1,
"nl": 0,
"rap": 0,
"rh": 0
}
],
"msg": ""
}设备动态注册获取秘钥信息
| POST | /admin-api/iot/device-info/auth/register/device |
|---|
请求数据类型 :application/json;charset=UTF-8
请求参数
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
|---|---|---|---|---|
| productKey | productKey | json | true | string |
| deviceName | 设备唯一标识 | json | true | string |
| sign | 签名 | json | true | string |
| signMethod | 签名方式;例如:HmacMD5 | json | true | string |
| random | 随机数 | json | false | string |
响应状态
| 状态码 | 说明 |
|---|---|
| 200 | OK |
响应参数
| 参数名称 | 参数说明 | 数据类型 |
|---|---|---|
| status | 状态码,值为0正常,其他值为异常 | int |
| code | 结果同status一样,冗余字段 | int |
| data | 返回动态注册信息 | object |
| msg | 状态消息 | string |
响应示例
{
"code": 200,
"data": {
"productKey": "a123w******",
"deviceName": "deviceName2234",
"deviceSecret": "adsfa******"
},
"message": "success"
}添加设备与分组关联
| POST | /admin-api/iot/device-group-relation/create |
|---|
请求数据类型 :application/json;charset=UTF-8
请求参数
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
|---|---|---|---|---|
| deviceGroupId | 设备分组Id | json | true | long |
| deviceId | 设备Id | json | true | long |
| Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
响应状态
| 状态码 | 说明 |
|---|---|
| 200 | OK |
响应参数
| 参数名称 | 参数说明 | 数据类型 |
|---|---|---|
| status | 状态码,值为0正常,其他值为异常 | int |
| code | 结果同status一样,冗余字段 | int |
| data | 创建成功关联id | long |
| msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": 2345465765876867,
"msg": ""
}删除设备关联分组
| DELETE | /admin-api/iot/device-group-relation/delete |
|---|
请求数据类型 :application/json;charset=UTF-8
请求参数
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
|---|---|---|---|---|
| id | 要删除的关联id | json | true | long |
| Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
响应状态
| 状态码 | 说明 |
|---|---|
| 200 | OK |
响应参数
| 参数名称 | 参数说明 | 数据类型 |
|---|---|---|
| status | 状态码,值为0正常,其他值为异常 | int |
| code | 结果同status一样,冗余字段 | int |
| data | 删除成功返回true | boolean |
| msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": true,
"msg": ""
}获取分组设备列表
| GET | /admin-api/iot/device-group-relation/list |
|---|
请求数据类型 :application/json;charset=UTF-8
请求参数
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
|---|---|---|---|---|
| deviceGroupId | 设备分组id | query | true | long |
| Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
响应状态
| 状态码 | 说明 |
|---|---|
| 200 | OK |
响应参数
| 参数名称 | 参数说明 | 数据类型 |
|---|---|---|
| status | 状态码,值为0正常,其他值为异常 | int |
| code | 结果同status一样,冗余字段 | int |
| data | 数据体 | object |
| ---id | 设备分组id | long |
| ---name | 设备分组名称 | string |
| ---identifier | 设备分组标识 | string |
| ---description | 描述 | string |
| ---parentId | 父id | long |
| ---createTime | 创建时间,时间戳 | long |
| ---devices | 设备列表 | array |
| ------id | 设备id | long |
| ------deviceName | 设备唯一名称 | string |
| ------deviceAlias | 设备别名 | string |
| ------deviceSecret | 设备秘钥,已脱敏,获取设备秘钥请查看:获取设备秘钥 | string |
| ------productId | 产品ID | long |
| ------productName | 产品名称 | string |
| ------productKey | productKey | string |
| ------productSecret | productSecret,数据已脱敏 | string |
| ------RSSI | 设备RSSI信号 | int |
| ------deviceShipModel | 设备芯片型号 | string |
| ------deviceSoftVersion | 设备软件版本 | string |
| ------deviceLongitude | 设备最新上传的经度 | string |
| ------deviceLatitude | 设备最新上传的纬度 | string |
| ------localLogMode | 设备是否开启本地日志上传;1:开启;0:关闭 | int |
| ------deviceState | 设备状态;-1:未激活;0:离线;1:在线 | int |
| ------startupState | 启动状态,1:启用;0:禁用 | int |
| ------lastTimeOnline | 设备上一次上线时间,时间戳13位 | long |
| ------nodeType | 节点类型,继承产品的nodeType | int |
| ------networkType | 联网类型,继承产品的networkType | int |
| ------remark | 备注信息 | string |
| ------deviceJson | 设备附加信息,格式为JSON字符串 | string |
| ------moduleName | 模块名称 | string |
| ------createTime | 创建时间,时间戳,时间戳13位 | long |
| msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": {
"name": "我家主卧设备",
"identifier": "dewd",
"description": "我家主卧的全部设备分组",
"parentId": 0,
"id": 1412004054228992,
"createTime": 1723637762000,
"devices":[
{
"productId": 1366004616577024,
"deviceName": "test1234",
"deviceSecret": "********************************",
"rssi": null,
"deviceShipModel": null,
"deviceSoftVersion": null,
"deviceLongitude": null,
"deviceLatitude": null,
"deviceAlias": null,
"deviceState": -1,
"localLogMode": 0,
"deviceJson": null,
"lastTimeOnline": null,
"startupState": 1,
"remark": null,
"createTime": 1730518222000,
"id": 1417640527249408,
"productKey": "kza2ib",
"productName": "remoteCard",
"nodeType": 1,
"networkType": 1,
"moduleName": null,
"deleted": false
},
{
"productId": 1390387061211136,
"deviceName": "test",
"deviceSecret": "********************************",
"rssi": null,
"deviceShipModel": null,
"deviceSoftVersion": null,
"deviceLongitude": null,
"deviceLatitude": null,
"deviceAlias": null,
"deviceState": -1,
"localLogMode": 0,
"deviceJson": null,
"lastTimeOnline": null,
"startupState": 1,
"remark": null,
"createTime": 1726989113000,
"id": 1414749481172992,
"productKey": "3c5fgd",
"productName": "wifi控制一路继电器",
"nodeType": 1,
"networkType": 1,
"moduleName": null,
"deleted": false
}
]
},
"msg": ""
}查询设备本地日志
| GET | /admin-api/iot/local-log/page |
|---|
请求数据类型 :application/json;charset=UTF-8
请求参数
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
|---|---|---|---|---|
| pageNo | 页码,从 1 开始,示例值(1) | query | true | int32 |
| pageSize | 每页条数,最大值为 1000,示例值(10) | query | true | int32 |
| productKey | 查询指定产品productKey的设备 | json | true | string |
| deviceName | 模糊查询指定设备的deviceName | query | true | string |
| module | 模块名称 | query | false | string |
| logLevel | 日志级别,可选(FATAL|ERROR|WARN|INFO|DEBUG|OTHER) | query | false | string |
| Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
响应状态
| 状态码 | 说明 |
|---|---|
| 200 | OK |
响应参数
| 参数名称 | 参数说明 | 数据类型 |
|---|---|---|
| status | 状态码,值为0正常,其他值为异常 | int |
| code | 结果同status一样,冗余字段 | int |
| data | 创建成功返回产品Id | object |
| ---total | 返回结果条数 | int |
| ---list | 返回数据列表 | array |
| ------ts | 创建时间,时间戳 | long |
| ------productName | 产品名称 | string |
| ------productKey | productKey | string |
| ------module | 模块名称 | string |
| ------traceContext | 追踪内容 | string |
| ------code | 状态码 | string |
| ------logLevel | 日志级别 | string |
| ------logContent | 日志内容 | string |
| msg | 状态消息 | string |
响应示例
{
"status": 0,
"code": 0,
"data": {
"list": [
{
"ts": 1734183699957,
"module": "net_rt",
"traceContext": "0",
"code": "200",
"logLevel": "INFO",
"logContent": "time=79209430^rtt=11",
"productKey": "kza2ib",
"deviceName": "cc50e34bf075"
},
{
"ts": 1734181899272,
"module": "net_rt",
"traceContext": "0",
"code": "200",
"logLevel": "INFO",
"logContent": "time=77409300^rtt=10",
"productKey": "kza2ib",
"deviceName": "cc50e34bf075"
},
{
"ts": 1734180098581,
"module": "net_rt",
"traceContext": "0",
"code": "200",
"logLevel": "INFO",
"logContent": "time=75609170^rtt=15",
"productKey": "kza2ib",
"deviceName": "cc50e34bf075"
},
{
"ts": 1734178297885,
"module": "net_rt",
"traceContext": "0",
"code": "200",
"logLevel": "INFO",
"logContent": "time=73809030^rtt=10",
"productKey": "kza2ib",
"deviceName": "cc50e34bf075"
},
{
"ts": 1734176497199,
"module": "net_rt",
"traceContext": "0",
"code": "200",
"logLevel": "INFO",
"logContent": "time=72008900^rtt=10",
"productKey": "kza2ib",
"deviceName": "cc50e34bf075"
},
{
"ts": 1734174696515,
"module": "net_rt",
"traceContext": "0",
"code": "200",
"logLevel": "INFO",
"logContent": "time=70208770^rtt=10",
"productKey": "kza2ib",
"deviceName": "cc50e34bf075"
},
{
"ts": 1734173614050,
"module": "net_conn",
"traceContext": "0",
"code": "200",
"logLevel": "INFO",
"logContent": "time=69125170^conn_type=TCP^conn_cost=340^conn_ret=0",
"productKey": "kza2ib",
"deviceName": "cc50e34bf075"
},
{
"ts": 1734172895081,
"module": "net_rt",
"traceContext": "0",
"code": "200",
"logLevel": "INFO",
"logContent": "time=68407890^rtt=10",
"productKey": "kza2ib",
"deviceName": "cc50e34bf075"
},
{
"ts": 1734171094394,
"module": "net_rt",
"traceContext": "0",
"code": "200",
"logLevel": "INFO",
"logContent": "time=66607760^rtt=12",
"productKey": "kza2ib",
"deviceName": "cc50e34bf075"
},
{
"ts": 1734169293713,
"module": "net_rt",
"traceContext": "0",
"code": "200",
"logLevel": "INFO",
"logContent": "time=64807630^rtt=11",
"productKey": "kza2ib",
"deviceName": "cc50e34bf075"
}
],
"total": 1722
},
"msg": ""
}获取设备秘钥
| GET | /admin-api/iot/device-info/get-secret |
|---|
请求数据类型 :application/json;charset=UTF-8
请求参数
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
|---|---|---|---|---|
| id | 设备id | query | true | long |
| code | 验证码,获取验证码请见下文:获取设备秘钥验证码 | query | true | string |
| Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
响应状态
| 状态码 | 说明 |
|---|---|
| 200 | OK |
响应参数
| 参数名称 | 参数说明 | 数据类型 |
|---|---|---|
| status | 状态码,值为0正常,其他值为异常 | int |
| code | 结果同status一样,冗余字段 | int |
| data | 产品秘钥 | string |
| msg | 状态消息 | string |
响应示例{
"status": 0,
"code": 0,
"data": "4bb996152d0b450cbxxca538012e4b1f",
"msg": ""
}获取设备秘钥验证码
| POST | /admin-api/iot/device-info/send-sms-code-get-secret |
|---|
请求数据类型 :application/json;charset=UTF-8
请求参数
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 |
|---|---|---|---|---|
| scene | 固定值为101,标识获取产品秘钥的场景验证码 | json | true | int |
| Authorization | 认证 Token,示例值(Bearer be080642804d4af285ccccaefcb66eda) 获取access_token请参考获取访问令牌 | header | true | string |
响应状态
| 状态码 | 说明 |
|---|---|
| 200 | OK |
响应参数
| 参数名称 | 参数说明 | 数据类型 |
|---|---|---|
| status | 状态码,值为0正常,其他值为异常 | int |
| code | 结果同status一样,冗余字段 | int |
| data | true代表获取验证码成功 | boolean |
| msg | 状态消息 | string |
响应示例{
"status": 0,
"code": 0,
"data": true,
"msg": ""
}