简要描述:

  • 获取报警消息报表

接口版本:

版本号 制定人 制定日期 修订日期
2.0.0 lenny 2020-08-20 2020-08-20

请求URL:

请求头:

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

请求参数:

参数名 是否必须 类型 说明
FTokenID string 令牌ID
FAction string 方法名(QueryMessageAlarmList)
FGUIDs string 车辆/设备唯一标识;多个用英文半角逗号隔开
FSelectType int 1:按车辆查;0:按终端查
FStartTime datetime 开始时间 (UTC时间)
FEndTime datetime 结束时间 (UTC时间)
FDataTypes string 报警类型集合;多个用英文半角逗号隔开 (传空表示获取所有类型的报警)
FDateType int 1:按接收时间查;0:按GPS时间查

返回示例:

正确时返回:

{
    "Result": 200,
    "Message": "check token success",
    "FObject": [
        {
            "FGUID": "0d6a1334-8eee-4b9b-822e-0042f4cedfd6",
            "FVehicleGUID": "d128c716-9d21-4fd2-ac40-ef18a0724af3",
            "FVehicleName": "44444",
            "FAssetGUID": "488c91fb-9a41-4bd8-a433-b93ad58aae04",
            "FAssetID": "7560717001",
            "FAssetTypeID": 701,
            "FSubAssetID": null,
            "FDataType": 42,
            "FCurrentStatus": 3,
            "FStartTime": "2020-06-06T09:23:45",
            "FStartLongitude": 113.856122,
            "FStartLatitude": 22.585537,
            "FEndLongitude": 113.856122,
            "FEndLatitude": 22.585537,
            "FEndTime": "2020-06-06T09:23:45",
            "FStartSpeed": 0,
            "FEndSpeed": 0,
            "FKeepSeconds": 0,
            "FStartMileage": 38,
            "FEndMileage": 38,
            "FKeepDistance": 0,
            “FDescribeJSON":""
        },
        {
            "FGUID": "cd2ec92b-6046-47c8-a9f4-00ebf6bde5a8",
            "FVehicleGUID": "d128c716-9d21-4fd2-ac40-ef18a0724af3",
            "FVehicleName": "44444",
            "FAssetGUID": "488c91fb-9a41-4bd8-a433-b93ad58aae04",
            "FAssetID": "7560717001",
            "FAssetTypeID": 701,
            "FSubAssetID": null,
            "FDataType": 42,
            "FCurrentStatus": 3,
            "FStartTime": "2020-06-06T05:21:42",
            "FStartLongitude": 113.856103,
            "FStartLatitude": 22.585535,
            "FEndLongitude": 113.856103,
            "FEndLatitude": 22.585535,
            "FEndTime": "2020-06-06T05:21:42",
            "FStartSpeed": 0,
            "FEndSpeed": 0,
            "FKeepSeconds": 0,
            "FStartMileage": 23,
            "FEndMileage": 23,
            "FKeepDistance": 0,
            “FDescribeJSON":""
        },
        {
            "FGUID": "1de8e107-41d8-45a7-b67e-00fd7ac6b6d7",
            "FVehicleGUID": "d128c716-9d21-4fd2-ac40-ef18a0724af3",
            "FVehicleName": "44444",
            "FAssetGUID": "488c91fb-9a41-4bd8-a433-b93ad58aae04",
            "FAssetID": "7560717001",
            "FAssetTypeID": 701,
            "FSubAssetID": null,
            "FDataType": 42,
            "FCurrentStatus": 3,
            "FStartTime": "2020-06-05T17:20:24",
            "FStartLongitude": 113.856107,
            "FStartLatitude": 22.585558,
            "FEndLongitude": 113.856107,
            "FEndLatitude": 22.585558,
            "FEndTime": "2020-06-05T17:20:24",
            "FStartSpeed": 0,
            "FEndSpeed": 0,
            "FKeepSeconds": 0,
            "FStartMileage": 22,
            "FEndMileage": 22,
            "FKeepDistance": 0,
            “FDescribeJSON":""
        },
        {
            "FGUID": "52824179-d573-430c-b87f-0114cc62c032",
            "FVehicleGUID": "d128c716-9d21-4fd2-ac40-ef18a0724af3",
            "FVehicleName": "44444",
            "FAssetGUID": "488c91fb-9a41-4bd8-a433-b93ad58aae04",
            "FAssetID": "7560717001",
            "FAssetTypeID": 701,
            "FSubAssetID": null,
            "FDataType": 42,
            "FCurrentStatus": 3,
            "FStartTime": "2020-06-05T21:20:48",
            "FStartLongitude": 113.856132,
            "FStartLatitude": 22.585435,
            "FEndLongitude": 113.856132,
            "FEndLatitude": 22.585435,
            "FEndTime": "2020-06-05T21:20:48",
            "FStartSpeed": 0,
            "FEndSpeed": 0,
            "FKeepSeconds": 0,
            "FStartMileage": 22,
            "FEndMileage": 22,
            "FKeepDistance": 0,
            “FDescribeJSON":""
        }
    ]
}

错误时返回:

{
    "Result": 102,
    "Message": "Action is error",
    "FObject": []
}

返回参数说明:

参数名 类型 说明
FGUID String 报警数据唯一标识
FVehicleGUID String 车辆唯一标识
FVehicleName String 车牌号
FAssetGUID String 设备唯一标识
FAssetID String 设备ID
FAssetTypeID Int 设备类型
FSubAssetID String 从机ID
FDataType Int 报警类型
FCurrentStatus Int 当前状态(1:执行中;2:已完成;3:单点报警(瞬间的动作))
FStartTime DateTime 开始GPS时间
FStartLongitude Decimal 开始经度
FStartLatitude Decimal 开始纬度
FEndLongitude Decimal 结束经度
FEndLatitude Decimal 结束纬度
FEndTime DateTime 结束GPS时间
FStartSpeed Int 开始速度(不显示)
FEndSpeed Int 结束速度(不显示)
FKeepSeconds Int 持续时长(单位s)
FStartMileage Int 开始里程
FEndMileage Int 结束里程
FKeepDistance Int 持续距离
FCreateTime DateTime 数据存储时间
FStartCell String 开始小区码
FDescribeJSON String 报警描述(Json字符串)

FDescribeJSON描述:
1.姿态报警(FDataTypoe:197):
例:{“type”:1}

参数名 类型 说明
type Int 姿态报警类型: 1:前倾 2:后倾 3:左倾 4:右倾

2.温湿度报警(FDataTypoe:63)
例:{“F”:”65.0”,”ID”:”867730057935318”,”N”:”27.600000381469727”,”T”:4}

参数名 类型 说明
T int 报警类型: 1:高温报警 2:低温报警 3:高湿报警 4:低湿报警 5:高光照 6:低光照 7:高气压 8:低气压
F Double 门限值
N Double 实际值
ID String 传感器

3.碰撞预警(FDataTypoe:29)
例:{"fAcceleration":"x:65488;y:160;z:864","fVibrate":254}

参数名 类型 说明
fAcceleration String 三轴值
fVibrate Int 震动值

4.电压异常(FDataTypoe: 341)
例:{“fCurrentValue”:”23.5”}

参数名 类型 说明
fCurrentValue String 电压值

4.电流异常(FDataTypoe: 342)
例:{“fCurrentValue”:”23.5”}

参数名 类型 说明
fCurrentValue String 电流值

4.门锁异常开启(FDataTypoe: 330)
例:{“fDoorExceptionNum”:”1”}

参数名 类型 说明
fDoorExceptionNum String 门锁1 或 门锁2

备注:

  • 更多返回错误代码如下:
  • 104:token错误或过期
  • 105:异常错误
  • 102:请求参数错误

请求示例:

Java:

String result = "";
//请求路径
String url = "http://cloud.assetscontrols.com:8092/OpenApi/Report";  
//请求参数 ,json格式参数,建议用对象传入
String body = "{FAction:\"QueryMessageAlarmList\",FTokenID:\"3acef045-d302-4032-b40a-d9ee6c1519cd\",FGUIDs:\"D128C716-9D21-4FD2-AC40-EF18A0724AF3,D118407E-6AB2-4B59-AA89-3334CA1C34C4\",FSelectType:\"1\",FStartTime:\"2020-06-05 16:00:00\",FEndTime:\"2020-06-11 15:59:59\",FDataTypes:\"42,46\",FDateType:\"0\"}";
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 = "http://cloud.assetscontrols.com:8092/OpenApi/Report";  
//请求参数 ,json格式参数,建议用对象传入
string body = "{FAction:\"QueryMessageAlarmList\",FTokenID:\"3acef045-d302-4032-b40a-d9ee6c1519cd\",FGUIDs:\"D128C716-9D21-4FD2-AC40-EF18A0724AF3,D118407E-6AB2-4B59-AA89-3334CA1C34C4\",FSelectType:\"1\",FStartTime:\"2020-06-05 16:00:00\",FEndTime:\"2020-06-11 15:59:59\",FDataTypes:\"42,46\",FDateType:\"0\"}"; 
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 = 'http://cloud.assetscontrols.com:8092/OpenApi/Report'
      data = {
      'FAction': 'QueryMessageAlarmList',
      'FTokenID': '3acef045-d302-4032-b40a-d9ee6c1519cd',
      'FGUIDs':'D128C716-9D21-4FD2-AC40-EF18A0724AF3,D118407E-6AB2-4B59-AA89-3334CA1C34C4',
      'FSelectType':1,
      'FStartTime':'2020-08-05 16:00:00',
      'FEndTime':'2020-08-11 15:59:59',
      'FDataTypes':'42,46',
      'FDateType':0
       }
      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;

Node.js:

文档更新时间: 2024-10-16 17:05   作者:刘家帅