• 本api适用于序列号开头为W762的设备,app_id和app_secret请到wdev.wmj.com.cn 填写手机号或邮箱登录获取。

点击下面的序号展开
1.注册绑定设备
  • 将设备和app_id、app_secret绑定

请求URL
  • https://wdev.wmj.com.cn/deviceApi/register

请求方式
  • POST

请求格式
  • json

参数
{
	"app_id": "",
	"app_secret": "",
	"device_sn": ""
}
参数名必选类型说明
app_idstring用户app_id
app_secretstring用户app_secret
device_snstring设备序列号
返回示例
{
	"code": 0,
	"msg": "注册成功"
}
{
	"code": 1005,
	"msg": "设备已注册"
}
返回参数说明
参数名类型说明
codeint错误码 0成功其他异常
msgint描述
备注
  • 更多返回错误代码请看首页的错误代码描述

2.开门
  • 开门

请求URL
  • https://wdev.wmj.com.cn/deviceApi/send

请求方式
  • POST

请求格式
  • json

参数

 

{
	"app_id":"",
	"app_secret":"",
	"device_sn": "设备序列号",
	"data": {
		"cmd_type": "open",
		"info": {
			"sn":"W7622345678"
		}
	}
}
参数名必选类型说明
app_idstring用户app_id
app_secretstring用户app_secret
device_snstring设备序列号
data.cmd_typestring开锁标识cmd_type
data.info.snstring一旦传入sn,设备将校验传入sn是否与设备本身sn一致,校验成功才能开门
data.info.###any可更加实际情况传入,会原值返回
返回示例
//成功
{
	"code": 0,
	"data": {
		"cmd_type": "open",
		"info": {
			"code": 0,
			"msg": ""
		}
	}
}
//失败
{
	"code": 1001,
	"msg": "网络超时"
}
返回参数说明
参数名类型说明
codeint调用接口错误码 0成功其他异常
data.info.codeint业务错误码,0成功其他异常
data.info.msgstring业务错误信息

 

3.参数设置
  • 设置设备参数

请求URL
  • https://wdev.wmj.com.cn/deviceApi/send

请求方式
  • POST

请求格式
  • json

参数

 

{
	"app_id":"",
	"app_secret":"",
	"device_sn": "设备序列号",
	"data": {
        "cmd_type": "dev_setting",
        "info":{
            "device_pwd":"12345678",
            "admin_pwd":"Admin"
		}
	}
}
参数名必选类型说明
app_idstring用户app_id
app_secretstring用户app_secret
device_snstring设备序列号
data.cmd_typestring设置命令dev_setting
data.info.device_pwdstring设备web端开门密码
data.info.admin_pwdstring设备web端管理密码
返回示例
//成功
{
	"code": 0,
	"data": {
		"cmd_type": "open",
		"info": {
			"code": 0,
			"msg": "",
			"sn": "W7622345678",
		}
	}
}
//失败
{
	"code": 1001,
	"msg": "网络超时"
}
返回参数说明
参数名类型说明
codeint调用接口错误码 0成功其他异常
data.info.codeint业务错误码,0成功其他异常
data.info.msgstring业务错误信息
4.查询在线状态
查询设备是否联网在线

接口URL

  • https://wdev.wmj.com.cn/deviceApi/getOnLine

请求方式

POST

Content-Type

json

请求Body参数

{
    "app_id": "{{wmjv2appid}}",
    "app_secret": "{{wmjv2appsecret}}",
    "device_sn": "WXXXXXXXXXX"
}
参数名示例值参数类型是否必填参数描述
app_idxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx5String硬件云app_id
app_secretxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx5String硬件云app_secret
device_snWXXXXXXXXXXString序列号

响应示例

{
    "code": 0,
    "data": {
        "on_line": 1 //0为离线、1为在线
    },
    "msg": "查询成功"
}
e.删除解绑(和appid解绑)
简要描述
  • 删除解绑,将设备从当前app_id解绑

请求URL
  • https://wdev.wmj.com.cn/deviceApi/logout

请求方式
  • POST

请求格式
  • json

参数

 

{
	"app_id":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
	"app_secret":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
	"device_sn": "WXXXXXXXXX"
}
参数名必选类型说明
app_idstring用户app_id
app_secretstring用户app_secret
device_snstring设备序列号

 

返回示例
//成功
{
    "code": 0,
    "msg": "解绑成功"
}

作者:极客师傅  创建时间:2025-03-18 23:31
最后编辑:极客师傅  更新时间:2025-09-22 15:04