简要描述:

  • 通过该接口进行上报物模型的事件触发

接口版本:

版本号 制定人 制定日期 修订日期
1.0.0 张浩 2023-10-11

请求URL:

  • /iot-platform/device-thing-model-server/v1/event/reported

请求方式:

  • POST

请求头:

参数名 是否必须 类型 说明
Content-Type string 请求类型: application/json
Authorization string 请求内容签名

请求示例:

{
    "productId":"AAcmXyLkS1",
    "deviceId":"339a0519f96b432092d6c3451b2dd53e",
    "eventIdentifier":"switch",
    "module":"default",
    "output":{
        "type":"fingerprint"
    },
    "time":1686540549041
}

请求参数:

参数名 是否必须 类型 说明
productId string 产品ID,最长10
deviceId string 设备ID,最长32
messageId String 消息ID,最长为64位字符,标识该消息的唯一ID,如不传则由服务端随机生成
eventIdentifier String 事件标识符
module String 模块标识符,默认为default模块
output Object 表示事件的输出信息
output.key String 表示事件的输出信息的属性Key
output.value Object 表示事件的输出信息的属性值
time Long 事件上报的时间戳,类型为UTC毫秒级时间。如不传则使用服务器接收上报时间戳

返回示例:

正确时返回:

{
  "code": 0,
  "msg": "ok",
  "err_code": 10000,
  "result":  {}
}

错误时返回:

{
  "code": -1,
  "msg": "${errorMessage}",
  "err_code": ${errorCode},
  "result": null
}

返回参数说明:

字段名称 字段类型 是否必须 描述
1 code int 状态码,为0时表示接口调用成功,不为0时表示接口调用失败
2 err_code int 错误码,当code为0时,返回10000,否则返回对应错误码
3 msg String 错误的具体消息
4 result Object 返回的结果,当调用失败时为空

备注:

  • 更多返回错误代码请看首页的错误代码描述
 创建时间:2023-10-11 11:02
最后编辑:admin  更新时间:2024-10-18 10:58