设置标准硬件设备【联网】状态

更新时间:2022-04-21 18:59:21

接口说明

使用接口前请联系相关人员获取third_code与secret信息 sign生成规则

基本信息

请求方式: POST

请求路径:

https://prod.open-api.mysre.cn/aiot/norm-device/set-device-online-status

请求参数

参数名 参数位置 参数类型 必填 默认值 示例 描述
tenant_code query string myyl 租户code
timestamp body string 1650012129 签名时间戳(10位)
third_code body string myyl 第三方code
occurrence_time body number 1649930630958 状态发生时间(13位时间戳)
type_code body string broadcast 设备类型
device_id body string 3a03385b-06af-d7de-6f1b-3b8aac262683 需要设置的设备id(注册接口返回的device_id)
status_code body string 10054 运行状态code,在设置运行状态是使用
sign body string 7c7e9ee60dd8656b5ccf1ab4dd11fea489344cb71 签名信息sha1( tenantCode thirdCode secret timestamp
online_status body string 1 联网状态0离线1在线

请求示例

post /aiot/norm-device/set-device-online-status?tenant_code={{tenant_code}}

form 表单

type_code:broadcast
device_id:3a0357c5-fd64-e63c-1f95-652611589cf3
occurrence_time:1649930630958
third_code:huiyi
timestamp:1650440403
sign:5a5d466da8dbbd4d0c765493da33b57bb8dd56bc
online_status:0

返回成功示例

{
    "errcode": 0,
    "data": {
        "status_log": "3a033d5b-0966-4228-4d0c-8663f264b590"
    },
    "type_code": {
        "broadcast": "智能广播"
    },
    "status_type": {
        "online_status": {
            "title": "设备连网状态信息",
            "value": {
                "离线": 0,
                "在线": 1
            }
        },
        "run_status": {
            "title": "设备运行状态",
            "value": {
                "正常": 0,
                "异常": 1
            },
            "adjunct": {
                "status_code": {
                    "title": "设备运行状态code",
                    "value": "自定义code"
                },
                "status_msg": {
                    "title": "设备运行状态信息",
                    "value": "中文状态信息"
                }
            }
        }
    },
    "errmsg": ""
}

返回参数说明(成功)

参数名 参数类型 描述
errcode number 异常code
data object 数据结果
data.status_log string 状态变更日志id
type_code object 设备类型参考信息
status_type object 状态类型参考信息
errmsg string 异常信息

失败返回示例

{
    "errcode": -1,
    "errmsg": "类型异常"
}

返回参数说明(失败)

参数名 参数类型 描述
errcode number 异常code
errmsg string 异常信息

results matching ""

    No results matching ""