注册标准工程硬件设备

更新时间:2022-04-21 18:57:45

接口说明

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

基本信息

请求方式: POST

请求路径:

https://prod.open-api.mysre.cn/aiot/norm-device/save-device

请求参数

参数名 参数位置 参数类型 必填 默认值 示例 描述
tenant_code query string
type_code body string broadcast 设备类型,具体支持设备请参考本接口默认返回信息
third_code body string myyl 第三方code
third_device_sn body string SM0005545665 第三方设备sn或其他唯一标识
device_model body string 设备型号 设备型号
third_device_name body string 设备名称 设备名称
third_device_location body string 设备安装位置
device_enable_status body number 0 1 设备使用状态0停用1启用
third_proj_id body string 明源项目id,或者第三方项目id
device_param body string {} {"key":"value"} 额外设备参数json格式
sign body string 7c7e9ee60dd8656b5ccf1ab4dd11fea489344cb71 签名信息sha1( tenantCode thirdCode secret timestamp)
timestamp body string 1650012129 签名时间戳(10位)

请求示例

post  /aiot/norm-device/save-device?tenant_code={{tenant_code}}

form 表单
----
type_code:broadcast
third_code:huiyi
third_device_sn:sn1234
device_model:sw
third_device_name:硬件设备1
third_device_location:5644
device_enable_status:1
third_proj_id:39d68bf1-c09f-4dfc-11d7-619c9290384d
sign:2effc9c2d467b4bd2ac29647103a7830bf72928e
timestamp:1650264072209

返回成功示例

{
    "errcode": 0,
    "errmsg": "",
    "data": {
        "device_id": "3a03385b-06af-d7de-6f1b-3b8aac262683",
        "action": "update",
        "type_code": "broadcast",
        "unique": "type_code,third_code,third_device_sn"
    },
    "type_code": {
        "broadcast": "智能广播"
    }
}

返回参数说明(成功)

参数名 参数类型 描述
errcode number 异常code
errmsg string 异常信息
data object 数据信息
data.device_id string 设备device_id
data.action string 操作类型
data.type_code string 设备类型
data.unique string 当前设备的唯一条件
type_code object 设备类型列表

失败返回示例

{
    "errcode": 0,
    "errmsg": ""
}

返回参数说明(失败)

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

results matching ""

    No results matching ""