简要描述:
- 子锁列表
接口版本:
| 版本号 | 制定人 | 制定日期 | 修订日期 |
|---|---|---|---|
| 1.0.0 | lenny | 2023-09-07 |
请求URL:
国际客户:https://icloud.assetscontrols.com:3443/OpenApi/Instruction
国内客户:https://cloud.assetscontrols.com:3443/OpenApi/Instruction
请求方式:
POST
请求头:
| 参数名 | 是否必须 | 类型 | 说明 |
|---|---|---|---|
| Content-Type | 是 | string | 请求类型: application/json |
请求参数:
| 参数名 | 是否必须 | 类型 | 说明 |
|---|---|---|---|
| FTokenID | 是 | string | 令牌ID |
| FAction | 是 | string | 方法名 (QuerySubAssetInfoByFAssetGUID) |
| FAssetGUID | 是 | string | 设备唯一标识 |
| FLanguage | 是 | Int | 0:英文;1:中文 |
返回示例:
正确时返回:
{
"Result": 200,
"Message": "check token success",
"FObject": [
{
"FGUID": "8846d981-a61f-455d-94fc-33c64416ff7a",
"FAssetGUID": "2d3d4041-dc5f-4a50-8c6a-8aac15835bf0",
"FAssetID": "8052400008",
"FAssetTypeID": 3701,
"FSubAssetName": "JT709",
"FSubAssetID": "E0171E0366",
"FIndex": 9,
"FDateTime": "2023-09-07T07:03:05Z",
"FLockStatus": 0,
"FLockRope": 0,
"FOpenIns": 0,
"FPower": 93,
"FBle": 1,
"FSensorType": 4,
"FStatusJson": "{\"lockRope\":0,\"gateway\":0}",
"FEvent": 6
}
]
}错误时返回:
{
"Result": 102,
"Message": "Action is error",
"FObject": []
}返回参数说明:
| 参数名 | 类型 | 说明 |
|---|---|---|
| FGUID | string | 子锁唯一 标识 |
| FAssetGUID | String | 主机唯一标识 |
| FAssetID | String | 主机ID |
| FAssetTypeID | Int | 主机类型标识 |
| FSubAssetName | String | 子锁名称 |
| FSubAssetID | String | 子锁设备ID |
| FIndex | Int | 配置的从机序号 |
| FDateTime | String | 最后更新时间 |
| FLockStatus | Int | 开锁状态(0:关 1:开) |
| FLockRope | Int | 锁绳(0:关 1:开) |
| FOpenIns | Int | 开锁指令执行状态(0:关 1:开) |
| FPower | Int | 电量 |
| FBle | Int | 是否支持蓝牙 (1:支持 0:不支持) |
| FSensorType | Int | 从机类型(1:JT126;4:JT709;5:JT801;6:JT802) |
| FStatusJson | String | 拓展信息 |
| FEvent | Int | 事件类型 |
FStatusJson
| 参数名 | 类型 | 说明 |
|---|---|---|
| lockMotor | Int | 电机状态(0:电机关,1:电机开) |
| lockKnob | Int | 旋钮状态(0:关闭,1:打开) |
| lockValve | Int | 阀门状态(0:关闭,1打开) |
| structuralDisassembly | Int | 结构防拆卸状态(0:无拆卸,1拆卸) |
| bottomDisassembly | Int | 底板防拆卸状态(0:无拆卸,1拆卸) |
| emergencyKey | Int | 应急钥匙状态( 0:封存,1:启用) |
FEvent
| 状态数值 | 描述 |
|---|---|
| 0 | 关锁事件 |
| 1 | 蓝牙开锁事件 |
| 2 | 拆后盖事件 |
| 3 | 远程开锁事件 |
| 4 | 锁剪断报警 |
| 5 | 按键唤醒事件 |
| 6 | 心跳包事件 |
| 7 | 充电唤醒事件 |
| 8, 20 | 拔出锁绳事件 |
| 9 | RFID开锁事件 |
| 10 | 刷非法卡报警 |
| 14 | 从机信号丢失事件 |
| 15 | 阀门关闭事件 |
| 16 | 阀门打开事件 |
| 17 | 低电量报警 |
| 18 | 防拆卸报警 |
| 19 | 电子仓拆卸事件 |
| 21 | 锁绳插入事件 |
| 22 | 蓝牙连接唤醒事件 |
| 23 | 应急仓开报警 |
| 24 | 应急仓关报警 |
| 25 | 异常阀门打开报警 |
| 26 | 锁销关闭事件 |
| 27 | 锁销开启事件 |
| 30 | NFC触发 |
| -1 | 未知事件 |
备注:
- 更多返回错误代码如下:
- 104:token错误或过期
- 105:异常错误
- 102:请求参数错误
请求示例:
Java:
String result = "";
//请求路径
String url = "https://cloud.assetscontrols.com:3443/OpenApi/Instruction";
//请求参数 ,json格式参数,建议用对象传入
String body = "{\n\t\"FAction\": \"QuerySubAssetInfoByFAssetGUID\",\n\t\"FAssetGUID\": \"2d3d4041-dc5f-4a50-8c6a-8aac15835bf0\",\n\t\"FTokenID\": \"3acef045-d302-4032-b40a-d9ee6c1519cd\",\n\t\"FTimeDifferent\": 28800,\n\t\"FLanguage\": \"1\"\n}";
URL realUrl = new URL(url);
// 设置通用请求的属性
URLConnection conn = realUrl.openConnection();
conn.setRequestProperty("accept", "*/*");
conn.setRequestProperty("connection", "keep-Alive");
conn.setRequestProperty("Content-Type", "application/json");
conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
conn.setRequestProperty("method", "post");
// 发送POST请求必须设置如下两行
conn.setDoOutput(true);
conn.setDoInput(true);
PrintWriter pw = new PrintWriter(conn.getOutputStream());
// 发送请求参数
pw.print(body);
// flush输出流的缓冲
pw.flush();
// 定义BufferedReader输入流来读取URL的响应
BufferedReader bufReader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
// 定义BufferedReader输入流来读取URL的响应
String line;
while ((line = bufReader.readLine()) != null) {
result += line;
}
//返回的是json字符串
return result;C#:
//请求路径
string url = "https://cloud.assetscontrols.com:3443/OpenApi/Instruction";
//请求参数 ,json格式参数,建议用对象传入
String body = "{\n\t\"FAction\": \"QuerySubAssetInfoByFAssetGUID\",\n\t\"FAssetGUID\": \"2d3d4041-dc5f-4a50-8c6a-8aac15835bf0\",\n\t\"FTokenID\": \"3acef045-d302-4032-b40a-d9ee6c1519cd\",\n\t\"FTimeDifferent\": 28800,\n\t\"FLanguage\": \"1\"\n}";
Encoding encoding = Encoding.UTF8;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
//请求方式 post / get
request.Method = "post";
request.Accept = "*/*";
request.ContentType = "application/json";
request.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)";
byte[] buffer = encoding.GetBytes(body);
request.ContentLength = buffer.Length;
request.GetRequestStream().Write(buffer, 0, buffer.Length);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
using (StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.UTF8))
{
//返回的是json字符串
return reader.ReadToEnd();
}Python:
url = 'https://cloud.assetscontrols.com:3443/OpenApi/Instruction'
data = '{ "FAction": "QuerySubAssetInfoByFAssetGUID", "FAssetGUID": "2d3d4041-dc5f-4a50-8c6a-8aac15835bf0", "FTokenID": "3acef045-d302-4032-b40a-d9ee6c1519cd", "FTimeDifferent": 28800, "FLanguage": "1" }'
data = parse.urlencode(data).encode('utf-8')
headers = {
'User-Agent': r'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) '
r'Chrome/45.0.2454.85 Safari/537.36 115Browser/6.0.3',
'Connection': 'keep-alive'
}
req = request.Request(url, headers=headers, data=data)
page = request.urlopen(req).read()
page = page.decode('utf-8')
# json_array = json.loads(page)
return page;文档更新时间: 2025-07-17 09:54 作者:刘家帅