接口列表
本节包含A1系列等告警主机设备关联的探测器的操作相关接口等。
接口列表如下:
序号 | 接口功能 | 描述 |
---|---|---|
1 | 获取探测器列表 | 查询指定设备关联的探测器列表 |
2 | 设置探测器状态 | 设置探测器的布撤防状态 |
3 | 删除探测器 | 删除设备关联的探测器 |
4 | 获取可关联的IPC列表 | 获取设备可关联的IPC设备列表 |
5 | 获取已关联的IPC列表 | 获取设备已关联的IPC设备列表 |
6 | 设置探测器与IPC的关联关系 | 设置设备关联的探测器与IPC设备的关联关系 |
7 | 修改探测器名称 | 修改探测器的名称 |
8 | 设备一键消警 | 设备远程消除警报功能 |
获取探测器列表
接口功能
该接口用于获取设备下关联的探测器列表(需要设备支持关联探测器)
请求地址
https://open.ys7.com/api/lapp/detector/list
请求方式
POST
子账户token请求所需最小权限
"Permission":"Get"
"Resource":"dev:序列号"
请求参数
参数名 | 类型 | 描述 | 是否必选 |
---|---|---|---|
accessToken | String | 授权过程获取的access_token | Y |
deviceSerial | String | 网关设备序列号,存在英文字母的设备序列号,字母需为大写 | Y |
- HTTP请求报文
POST /api/lapp/detector/list HTTP/1.1
Host: open.ys7.com
Content-Type: application/x-www-form-urlencoded
accessToken=at.9mqitppidgce4y8n54ranvyqc9fjtsrl&deviceSerial=596510888
- 返回数据
{
"result": {
"data": [
{
"detectorSerial": "594012222",
"detectorType": "callhelp",
"detectorState": 1,
"detectorTypeName": "紧急按钮",
"location": "紧急按钮",
"zfStatus": 0,
"uvStatus": 0,
"iwcStatus": 0,
"olStatus": 0,
"atHomeEnable": 1,
"outerEnable": 1,
"sleepEnable": 1
},
{
"detectorSerial": "303333333",
"detectorType": "waterlogging",
"detectorState": 1,
"detectorTypeName": "水浸",
"location": "卫生间",
"zfStatus": 0,
"uvStatus": 0,
"iwcStatus": 0,
"olStatus": 1,
"atHomeEnable": 1,
"outerEnable": 1,
"sleepEnable": 1
}
],
"code": "200",
"msg": "操作成功!"
}
}
- 返回字段
字段名 | 类型 | 描述 |
---|---|---|
detectorSerial | String | 探测器序列号 |
detectorType | String | 探测器类型 |
detectorState | int | 探测器与设备是否连通:0-非联通,1-联通 |
detectorTypeName | String | 探测器类型名称 |
location | String | 探测器位置(自定义),对应修改后的名称 |
zfStatus | int | 防区故障:0-恢复,1-产生 |
uvStatus | int | 电池欠压:0-恢复,1-产生 |
iwcStatus | int | 无线干扰:0-恢复,1-产生 |
olStatus | int | 离线:0-恢复,1-产生 |
atHomeEnable | int | 在家是否使能:0-关闭,1-开启 |
outerEnable | int | 外出是否使能:0-关闭,1-开启 |
sleepEnable | int | 状睡眠模式是否使能:0-关闭,1-开启 |
防区故障、电池欠压、无线干扰、离线几种属于故障类型。“产生”表示产生故障,“恢复”表示故障恢复。
探测器类型名称:
探测器类型 | 探测器类型名称 |
---|---|
V | 视频设备 |
I | 告警输入设备 |
O | 告警输出设备 |
PIR | 红外探测器 |
FIRE | 烟感探测器 |
MAGNETOMETER | 门磁传感器 |
GAS | 可燃气体 |
WATERLOGGING | 水浸 |
CALLHELP | 紧急按钮 |
TELECONTROL | 遥控器 |
ALERTOR | 告警器 |
KEYBOARD | 键盘 |
CURTAIN | 幕帘 |
MOVE_MAGNETOMETER | 单体门磁 |
- 返回码
返回码 | 返回消息 | 描述 |
---|---|---|
200 | 操作成功 | 请求成功 |
10001 | 参数错误 | 参数为空或格式不正确 |
10002 | accessToken异常或过期 | 重新获取accessToken |
10005 | appKey异常 | appKey被冻结 |
20002 | 设备不存在 | |
20014 | deviceSerial不合法 | |
20018 | 该用户不拥有该设备 | 检查设备是否属于当前账户 |
49999 | 数据异常 | 接口调用异常 |
60020 | 不支持该命令 | 该设备不支持关联探测器 |
设置探测器状态
接口功能
该接口用于设置设备下关联的探测器在家、外出、睡眠时的布撤防状态(需要设备和探测器支持)
请求地址
https://open.ys7.com/api/lapp/detector/status/set
请求方式
POST
子账户token请求所需最小权限
"Permission":"Config"
"Resource":"dev:序列号"
请求参数
参数名 | 类型 | 描述 | 是否必选 |
---|---|---|---|
accessToken | String | 授权过程获取的access_token | Y |
deviceSerial | String | 网关设备序列号,存在英文字母的设备序列号,字母需为大写 | Y |
detectorSerial | String | 探测器序列号 | Y |
safeMode | int | 安全模式:0-在家,1-外出,2-睡眠 |
Y |
enable | int | 状态:0-关闭,1-开启 |
Y |
- HTTP请求报文
POST /api/lapp/detector/status/set HTTP/1.1
Host: open.ys7.com
Content-Type: application/x-www-form-urlencoded
accessToken=at.9mqitppidgce4y8n54ranvyqc9fjtsrl&deviceSerial=569262222&detectorSerial=604216666&enable=1&safeMode=2
- 返回数据
{
"code": "200",
"msg": "操作成功!"
}
- 返回码
返回码 | 返回消息 | 描述 |
---|---|---|
200 | 操作成功 | 请求成功 |
10001 | 参数错误 | 参数为空或格式不正确 |
10002 | accessToken异常或过期 | 重新获取accessToken |
10005 | appKey异常 | appKey被冻结 |
20002 | 设备不存在 | |
20006 | 网络异常 | 检查设备网络状况,稍后再试 |
20007 | 设备不在线 | 检查设备是否在线 |
20008 | 设备响应超时 | 操作过于频繁,稍后再试 |
20014 | deviceSerial不合法 | |
20018 | 该用户不拥有该设备 | 检查设备是否属于当前账户 |
49999 | 数据异常 | 接口调用异常 |
60020 | 不支持该命令 | 设备不支持关联探测器(无网关功能)或探测器不支持设置状态,探测器状态和网关状态同步 |
删除探测器
接口功能
该接口用于删除设备下关联的探测器(需要设备支持远程删除探测器)
请求地址
https://open.ys7.com/api/lapp/detector/delete
请求方式
POST
子账户token请求所需最小权限
"Permission":"Config"
"Resource":"dev:序列号"
请求参数
参数名 | 类型 | 描述 | 是否必选 |
---|---|---|---|
accessToken | String | 授权过程获取的access_token | Y |
deviceSerial | String | 网关设备序列号,存在英文字母的设备序列号,字母需为大写 | Y |
detectorSerial | String | 探测器序列号 | Y |
- HTTP请求报文
POST /api/lapp/detector/delete HTTP/1.1
Host: open.ys7.com
Content-Type: application/x-www-form-urlencoded
accessToken=at.9mqitppidgce4y8n54ranvyqc9fjtsrl&deviceSerial=569262222&detectorSerial=604216666
- 返回数据
{
"code": "200",
"msg": "操作成功!"
}
- 返回码
返回码 | 返回消息 | 描述 |
---|---|---|
200 | 操作成功 | 请求成功 |
10001 | 参数错误 | 参数为空或格式不正确 |
10002 | accessToken异常或过期 | 重新获取accessToken |
10005 | appKey异常 | appKey被冻结 |
20002 | 设备不存在 | |
20006 | 网络异常 | 检查设备网络状况,稍后再试 |
20007 | 设备不在线 | 检查设备是否在线 |
20008 | 设备响应超时 | 操作过于频繁,稍后再试 |
20014 | deviceSerial不合法 | |
20018 | 该用户不拥有该设备 | 检查设备是否属于当前账户 |
49999 | 数据异常 | 接口调用异常 |
60020 | 不支持该命令 | 设备不支持远程删除探测器 |
获取可关联的IPC列表
接口功能
该接口用于获取设备可关联的IPC设备列表(需要设备支持)
请求地址
https://open.ys7.com/api/lapp/detector/ipc/list/bindable
请求方式
POST
子账户token请求所需最小权限
"Permission":"Get"
"Resource":"dev:序列号"
请求参数
参数名 | 类型 | 描述 | 是否必选 |
---|---|---|---|
accessToken | String | 授权过程获取的access_token | Y |
deviceSerial | String | 网关设备序列号,存在英文字母的设备序列号,字母需为大写 | Y |
- HTTP请求报文
POST /api/lapp/detector/ipc/list/bindable HTTP/1.1
Host: open.ys7.com
Content-Type: application/x-www-form-urlencoded
accessToken=at.9mqitppidgce4y8n54ranvyqc9fjtsrl&deviceSerial=569262222
- 返回数据
{
"data": [
{
"deviceSerial": "428888888",
"channelNo": 1,
"cameraName": "室外"
},
{
"deviceSerial": "426666666",
"channelNo": 1,
"cameraName": "室内"
}
],
"code": "200",
"msg": "操作成功!"
}
- 返回字段
字段名 | 类型 | 描述 |
---|---|---|
deviceSerial | String | IPC的设备序列号 |
channelNo | int | 通道号 |
cameraName | int | IPC的名称 |
- 返回码
返回码 | 返回消息 | 描述 |
---|---|---|
200 | 操作成功 | 请求成功 |
10001 | 参数错误 | 参数为空或格式不正确 |
10002 | accessToken异常或过期 | 重新获取accessToken |
10005 | appKey异常 | appKey被冻结 |
20002 | 设备不存在 | |
20014 | deviceSerial不合法 | |
20018 | 该用户不拥有该设备 | 检查设备是否属于当前账户 |
49999 | 数据异常 | 接口调用异常 |
60020 | 不支持该命令 | 设备不支持关联IPC |
获取已关联的IPC列表
接口功能
该接口用于获取设备已关联的IPC设备列表(需要设备支持告警联动功能)
请求地址
https://open.ys7.com/api/lapp/detector/ipc/list/bind
请求方式
POST
子账户token请求所需最小权限
"Permission":"Get"
"Resource":"dev:序列号"
请求参数
参数名 | 类型 | 描述 | 是否必选 |
---|---|---|---|
accessToken | String | 授权过程获取的access_token | Y |
deviceSerial | String | 网关设备序列号,存在英文字母的设备序列号,字母需为大写 | Y |
detectorSerial | String | 探测器序列号 | Y |
- HTTP请求报文
POST /api/lapp/detector/ipc/list/bind HTTP/1.1
Host: open.ys7.com
Content-Type: application/x-www-form-urlencoded
accessToken=at.8gxgysai9hh0uzr4bnl8jgt23nepm05a&deviceSerial=465538888&detectorSerial=470289999
- 返回数据
{
"data": [
{
"detectorSerial": "470289999",
"ipcSerial": "558815555"
}
],
"code": "200",
"msg": "操作成功!"
}
- 返回字段
字段名 | 类型 | 描述 |
---|---|---|
detectorSerial | String | 探测器序列号 |
ipcSerial | String | 关联的IPC设备序列号 |
- 返回码
返回码 | 返回消息 | 描述 |
---|---|---|
200 | 操作成功 | 请求成功 |
10001 | 参数错误 | 参数为空或格式不正确 |
10002 | accessToken异常或过期 | 重新获取accessToken |
10005 | appKey异常 | appKey被冻结 |
20002 | 设备不存在 | |
20014 | deviceSerial不合法 | |
20018 | 该用户不拥有该设备 | 检查设备是否属于当前账户 |
49999 | 数据异常 | 接口调用异常 |
60020 | 不支持该命令 | 设备不支持关联IPC |
设置探测器与IPC的关联关系
接口功能
该接口用于设置设备关联的探测器与IPC设备的关联关系(需要设备支持告警联动功能)
请求地址
https://open.ys7.com/api/lapp/detector/ipc/relation/set
请求方式
POST
子账户token请求所需最小权限
无
请求参数
参数名 | 类型 | 描述 | 是否必选 |
---|---|---|---|
accessToken | String | 授权过程获取的access_token | Y |
deviceSerial | String | 网关设备序列号,存在英文字母的设备序列号,字母需为大写 | Y |
detectorSerial | String | 探测器序列号 | Y |
ipcSerial | String | IPC设备序列号 | Y |
operation | int | 操作:0-删除,1-绑定 | Y |
- HTTP请求报文
POST /api/lapp/detector/ipc/relation/set HTTP/1.1
Host: open.ys7.com
Content-Type: application/x-www-form-urlencoded
accessToken=at.8gxgysai9hh0uzr4bnl8jgt23nepm05a&deviceSerial=465538888&detectorSerial=470289999&ipcSerial=558815555&operation=0
- 返回数据
{
"code": "200",
"msg": "操作成功!"
}
- 返回码
返回码 | 返回消息 | 描述 |
---|---|---|
200 | 操作成功 | 请求成功 |
10001 | 参数错误 | 参数为空或格式不正确或者操作失败 |
10002 | accessToken异常或过期 | 重新获取accessToken |
10005 | appKey异常 | appKey被冻结 |
20002 | 设备不存在 | |
20006 | 网络异常 | 检查设备网络状况,稍后再试 |
20007 | 设备不在线 | 检查设备是否在线 |
20008 | 设备响应超时 | 操作过于频繁,稍后再试 |
20014 | deviceSerial不合法 | |
20018 | 该用户不拥有该设备 | 检查设备是否属于当前账户 |
49999 | 数据异常 | 接口调用异常 |
60020 | 不支持该命令 | 设备不支持关联IPC功能 |
修改探测器名称
接口功能
该接口用于修改探测器名称(需要设备支持修改探测器名称)
请求地址
https://open.ys7.com/api/lapp/detector/name/change
请求方式
POST
子账户token请求所需最小权限
无
请求参数
参数名 | 类型 | 描述 | 是否必选 |
---|---|---|---|
accessToken | String | 授权过程获取的access_token | Y |
deviceSerial | String | 网关设备序列号,存在英文字母的设备序列号,字母需为大写 | Y |
detectorSerial | String | 探测器序列号 | Y |
newName | String | 新名称,长度不大于50且不包含特殊字符 | Y |
- HTTP请求报文
POST /api/lapp/detector/name/change HTTP/1.1
Host: open.ys7.com
Content-Type: application/x-www-form-urlencoded
accessToken=at.8gxgysai9hh0uzr4bnl8jgt23nepm05a&deviceSerial=465538888&detectorSerial=470289999&newName=mydetector
- 返回数据
{
"code": "200",
"msg": "操作成功!"
}
- 返回码
返回码 | 返回消息 | 描述 |
---|---|---|
200 | 操作成功 | 请求成功 |
10001 | 参数错误 | 参数为空或格式不正确或者操作失败 |
10002 | accessToken异常或过期 | 重新获取accessToken |
10005 | appKey异常 | appKey被冻结 |
20002 | 设备不存在 | |
20006 | 网络异常 | 检查设备网络状况,稍后再试 |
20007 | 设备不在线 | 检查设备是否在线 |
20008 | 设备响应超时 | 操作过于频繁,稍后再试 |
20014 | deviceSerial不合法 | |
20018 | 该用户不拥有该设备 | 检查设备是否属于当前账户 |
49999 | 数据异常 | 接口调用异常 |
60020 | 不支持该命令 | 设备不支持修改探测器名称 |
设备一键消警
接口功能
该接口用于实现设备远程消除警报功能(需要设备支持远程一键消警功能)
请求地址
https://open.ys7.com/api/lapp/detector/cancelAlarm
请求方式
POST
子账户token请求所需最小权限
无
请求参数
参数名 | 类型 | 描述 | 是否必选 |
---|---|---|---|
accessToken | String | 授权过程获取的access_token | Y |
deviceSerial | String | 网关设备序列号,存在英文字母的设备序列号,字母需为大写 | Y |
- HTTP请求报文
POST /api/lapp/detector/cancelAlarm HTTP/1.1
Host: open.ys7.com
Content-Type: application/x-www-form-urlencoded
accessToken=at.8gxgysai9hh0uzr4bnl8jgt23nepm05a&deviceSerial=465538888
- 返回数据
{
"code": "200",
"msg": "操作成功!"
}
- 返回码
返回码 | 返回消息 | 描述 |
---|---|---|
200 | 操作成功 | 请求成功 |
10001 | 参数错误 | 参数为空或格式不正确或者操作失败 |
10002 | accessToken异常或过期 | 重新获取accessToken |
10005 | appKey异常 | appKey被冻结 |
20002 | 设备不存在 | |
20006 | 网络异常 | 检查设备网络状况,稍后再试 |
20007 | 设备不在线 | 检查设备是否在线 |
20008 | 设备响应超时 | 操作过于频繁,稍后再试 |
20014 | deviceSerial不合法 | |
20018 | 该用户不拥有该设备 | 检查设备是否属于当前账户 |
49999 | 数据异常 | 接口调用异常 |
60020 | 不支持该命令 | 设备不支持远程消警功能 |