简要描述:
- 获取从机记录
接口版本:
版本号 | 制定人 | 制定日期 | 修订日期 |
---|---|---|---|
2.0.0 | lenny | 2020-08-20 | 2020-08-20 |
2.0.0 | lenny | 2021-11-15 |
请求URL:
国内客户:http://cloud.assetscontrols.com:8092/OpenApi/Report
请求方式:
POST
请求头:
参数名 | 是否必须 | 类型 | 说明 |
---|---|---|---|
Content-Type | 是 | string | 请求类型: application/json |
请求参数:
参数名 | 是否必须 | 类型 | 说明 |
---|---|---|---|
FTokenID | 是 | string | 令牌ID |
FAction | 是 | string | 方法名 (QueryReportSubAssetTrack) |
FGUID | 是 | string | 车辆/设备唯一标识 |
FSelectType | 是 | int | 1:按车辆查;0:按终端查 |
FStartTime | 是 | datetime | 开始时间 (UTC时间) |
FEndTime | 是 | datetime | 结束时间 (UTC时间) |
#### 返回示例: |
正确时返回:
{
"Result": 200,
"Message": "check token success",
"FObject": [
{
"FAssetGUID": "8e762610-ed26-4974-ac04-87710890e8ab",
"FAssetID": "7500313618",
"FGPSTime": "2020-08-24T05:11:27",
"FRecvTime": "2020-08-24T05:12:36",
"FLongitude": 113.916800,
"FLatitude": 22.580777,
"FSpeed": 0,
"FSubInfo": "{\"E0171A0107\":{\"FAssetID\":\"E0171A0107\",\"FDateTime\":\"2020-08-24T04:01:01Z\",\"FDateTimestamp\":1598241661000,\"FEvent\":6,\"FFlowId\":0,\"FHumidity\":0,\"FLockRope\":0,\"FLockStatus\":0,\"FLockTimes\":1038,\"FPower\":68,\"FRSSI\":117,\"FSensorType\":4,\"FTemperature\":-1000.0,\"FVoltage\":\"3.93\"}}"
},
{
"FAssetGUID": "8e762610-ed26-4974-ac04-87710890e8ab",
"FAssetID": "7500313618",
"FGPSTime": "2020-08-24T05:11:27",
"FRecvTime": "2020-08-24T05:14:39",
"FLongitude": 113.916800,
"FLatitude": 22.580777,
"FSpeed": 0,
"FSubInfo": "{\"E0171A0107\":{\"FAssetID\":\"E0171A0107\",\"FDateTime\":\"2020-08-24T04:01:01Z\",\"FDateTimestamp\":1598241661000,\"FEvent\":6,\"FFlowId\":0,\"FHumidity\":0,\"FLockRope\":0,\"FLockStatus\":0,\"FLockTimes\":1038,\"FPower\":68,\"FRSSI\":117,\"FSensorType\":4,\"FTemperature\":-1000.0,\"FVoltage\":\"3.93\"}}"
},
{
"FAssetGUID": "8e762610-ed26-4974-ac04-87710890e8ab",
"FAssetID": "7500313618",
"FGPSTime": "2020-08-24T05:11:27",
"FRecvTime": "2020-08-24T05:17:43",
"FLongitude": 113.916800,
"FLatitude": 22.580777,
"FSpeed": 0,
"FSubInfo": "{\"E0171A0107\":{\"FAssetID\":\"E0171A0107\",\"FDateTime\":\"2020-08-24T04:01:01Z\",\"FDateTimestamp\":1598241661000,\"FEvent\":6,\"FFlowId\":0,\"FHumidity\":0,\"FLockRope\":0,\"FLockStatus\":0,\"FLockTimes\":1038,\"FPower\":68,\"FRSSI\":117,\"FSensorType\":4,\"FTemperature\":-1000.0,\"FVoltage\":\"3.93\"}}"
},
{
"FAssetGUID": "8e762610-ed26-4974-ac04-87710890e8ab",
"FAssetID": "7500313618",
"FGPSTime": "2020-08-24T05:11:27",
"FRecvTime": "2020-08-24T05:19:45",
"FLongitude": 113.916800,
"FLatitude": 22.580777,
"FSpeed": 0,
"FSubInfo": "{\"E0171A0107\":{\"FAssetID\":\"E0171A0107\",\"FDateTime\":\"2020-08-24T04:01:01Z\",\"FDateTimestamp\":1598241661000,\"FEvent\":6,\"FFlowId\":0,\"FHumidity\":0,\"FLockRope\":0,\"FLockStatus\":0,\"FLockTimes\":1038,\"FPower\":68,\"FRSSI\":117,\"FSensorType\":4,\"FTemperature\":-1000.0,\"FVoltage\":\"3.93\"}}"
},
{
"FAssetGUID": "8e762610-ed26-4974-ac04-87710890e8ab",
"FAssetID": "7500313618",
"FGPSTime": "2020-08-24T05:41:37",
"FRecvTime": "2020-08-24T05:41:58",
"FLongitude": 113.917333,
"FLatitude": 22.581298,
"FSpeed": 0,
"FSubInfo": "{\"E0171A0107\":{\"FAssetID\":\"E0171A0107\",\"FDateTime\":\"2020-08-24T04:31:21Z\",\"FDateTimestamp\":1598243481000,\"FEvent\":6,\"FFlowId\":1,\"FHumidity\":0,\"FLockRope\":0,\"FLockStatus\":0,\"FLockTimes\":1038,\"FPower\":68,\"FRSSI\":118,\"FSensorType\":4,\"FTemperature\":-1000.0,\"FVoltage\":\"3.93\"}}"
},
{
"FAssetGUID": "8e762610-ed26-4974-ac04-87710890e8ab",
"FAssetID": "7500313618",
"FGPSTime": "2020-08-24T05:41:37",
"FRecvTime": "2020-08-24T05:46:04",
"FLongitude": 113.917333,
"FLatitude": 22.581298,
"FSpeed": 0,
"FSubInfo": "{\"E0171A0107\":{\"FAssetID\":\"E0171A0107\",\"FDateTime\":\"2020-08-24T04:31:21Z\",\"FDateTimestamp\":1598243481000,\"FEvent\":6,\"FFlowId\":1,\"FHumidity\":0,\"FLockRope\":0,\"FLockStatus\":0,\"FLockTimes\":1038,\"FPower\":68,\"FRSSI\":118,\"FSensorType\":4,\"FTemperature\":-1000.0,\"FVoltage\":\"3.93\"}}"
},
{
"FAssetGUID": "8e762610-ed26-4974-ac04-87710890e8ab",
"FAssetID": "7500313618",
"FGPSTime": "2020-08-24T05:41:37",
"FRecvTime": "2020-08-24T05:49:08",
"FLongitude": 113.917333,
"FLatitude": 22.581298,
"FSpeed": 0,
"FSubInfo": "{\"E0171A0107\":{\"FAssetID\":\"E0171A0107\",\"FDateTime\":\"2020-08-24T04:31:21Z\",\"FDateTimestamp\":1598243481000,\"FEvent\":6,\"FFlowId\":1,\"FHumidity\":0,\"FLockRope\":0,\"FLockStatus\":0,\"FLockTimes\":1038,\"FPower\":68,\"FRSSI\":118,\"FSensorType\":4,\"FTemperature\":-1000.0,\"FVoltage\":\"3.93\"}}"
},
{
"FAssetGUID": "8e762610-ed26-4974-ac04-87710890e8ab",
"FAssetID": "7500313618",
"FGPSTime": "2020-08-24T05:11:27",
"FRecvTime": "2020-08-24T05:11:35",
"FLongitude": 113.916800,
"FLatitude": 22.580777,
"FSpeed": 0,
"FSubInfo": "{\"E0171A0107\":{\"FAssetID\":\"E0171A0107\",\"FDateTime\":\"2020-08-24T04:01:01Z\",\"FDateTimestamp\":1598241661000,\"FEvent\":6,\"FFlowId\":0,\"FHumidity\":0,\"FLockRope\":0,\"FLockStatus\":0,\"FLockTimes\":1038,\"FPower\":68,\"FRSSI\":117,\"FSensorType\":4,\"FTemperature\":-1000.0,\"FVoltage\":\"3.93\"}}"
},
{
"FAssetGUID": "8e762610-ed26-4974-ac04-87710890e8ab",
"FAssetID": "7500313618",
"FGPSTime": "2020-08-24T06:25:12",
"FRecvTime": "2020-08-24T06:25:40",
"FLongitude": 113.917333,
"FLatitude": 22.580717,
"FSpeed": 0,
"FSubInfo": "{\"1018330094\":{\"FAssetID\":\"1018330094\",\"FDateTime\":\"2020-08-23T16:22:29Z\",\"FDateTimestamp\":1598199749000,\"FEvent\":-1,\"FFlowId\":236,\"FHumidity\":75,\"FLockRope\":1,\"FLockStatus\":1,\"FLockTimes\":-1,\"FPower\":96,\"FRSSI\":97,\"FSensorType\":1,\"FTemperature\":28.3,\"FVoltage\":\"3.00\"}}"
},
{
"FAssetGUID": "8e762610-ed26-4974-ac04-87710890e8ab",
"FAssetID": "7500313618",
"FGPSTime": "2020-08-24T06:25:12",
"FRecvTime": "2020-08-24T06:26:40",
"FLongitude": 113.917333,
"FLatitude": 22.580717,
"FSpeed": 0,
"FSubInfo": "{\"1018330094\":{\"FAssetID\":\"1018330094\",\"FDateTime\":\"2020-08-23T16:22:29Z\",\"FDateTimestamp\":1598199749000,\"FEvent\":-1,\"FFlowId\":236,\"FHumidity\":75,\"FLockRope\":1,\"FLockStatus\":1,\"FLockTimes\":-1,\"FPower\":96,\"FRSSI\":97,\"FSensorType\":1,\"FTemperature\":28.3,\"FVoltage\":\"3.00\"}}"
},
{
"FAssetGUID": "8e762610-ed26-4974-ac04-87710890e8ab",
"FAssetID": "7500313618",
"FGPSTime": "2020-08-24T06:25:12",
"FRecvTime": "2020-08-24T06:27:42",
"FLongitude": 113.917333,
"FLatitude": 22.580717,
"FSpeed": 0,
"FSubInfo": "{\"1018330094\":{\"FAssetID\":\"1018330094\",\"FDateTime\":\"2020-08-23T16:22:29Z\",\"FDateTimestamp\":1598199749000,\"FEvent\":-1,\"FFlowId\":236,\"FHumidity\":75,\"FLockRope\":1,\"FLockStatus\":1,\"FLockTimes\":-1,\"FPower\":96,\"FRSSI\":97,\"FSensorType\":1,\"FTemperature\":28.3,\"FVoltage\":\"3.00\"}}"
},
{
"FAssetGUID": "8e762610-ed26-4974-ac04-87710890e8ab",
"FAssetID": "7500313618",
"FGPSTime": "2020-08-24T06:25:12",
"FRecvTime": "2020-08-24T06:29:46",
"FLongitude": 113.917333,
"FLatitude": 22.580717,
"FSpeed": 0,
"FSubInfo": "{\"1018330094\":{\"FAssetID\":\"1018330094\",\"FDateTime\":\"2020-08-23T16:22:29Z\",\"FDateTimestamp\":1598199749000,\"FEvent\":-1,\"FFlowId\":236,\"FHumidity\":75,\"FLockRope\":1,\"FLockStatus\":1,\"FLockTimes\":-1,\"FPower\":96,\"FRSSI\":97,\"FSensorType\":1,\"FTemperature\":28.3,\"FVoltage\":\"3.00\"}}"
},
{
"FAssetGUID": "8e762610-ed26-4974-ac04-87710890e8ab",
"FAssetID": "7500313618",
"FGPSTime": "2020-08-24T06:25:12",
"FRecvTime": "2020-08-24T06:30:47",
"FLongitude": 113.917333,
"FLatitude": 22.580717,
"FSpeed": 0,
"FSubInfo": "{\"1018330094\":{\"FAssetID\":\"1018330094\",\"FDateTime\":\"2020-08-23T16:22:29Z\",\"FDateTimestamp\":1598199749000,\"FEvent\":-1,\"FFlowId\":236,\"FHumidity\":75,\"FLockRope\":1,\"FLockStatus\":1,\"FLockTimes\":-1,\"FPower\":96,\"FRSSI\":97,\"FSensorType\":1,\"FTemperature\":28.3,\"FVoltage\":\"3.00\"}}"
}
]
}
错误时返回:
{
"Result": 102,
"Message": "Action is error",
"FObject": []
}
返回参数说明:
参数名 | 类型 | 说明 |
---|---|---|
FAssetGUID | String | 设备唯一标识 |
FAssetID | String | 设备ID |
FGPSTime | DateTime | GPS时间 |
FRecvTime | DateTime | 接收时间 |
FLongitude | Decimal | 经度 |
FLatitude | Decimal | 纬度 |
FSpeed | Int | 速度 |
FSubInfo | String | 从机信息 |
FSubAssetID | String | 从机ID |
FSensorType | Int | 从机类型(1:JT126;4:JT709;5:JT801;6:JT802) |
FDateTime | DateTime | 从机GPS时间 |
FEvent | Int | 事件类型 |
FTemperature | String | 温度 |
FHumidity | String | 湿度 |
FLockRope | Int | 锁绳状态 |
FLockStatus | Int | 锁状态 |
FLockTimes | Int | 开锁次数 |
FPower | Int | 电量值 |
FVoltage | float | 电压值 |
FRSSI | Int | 信号强度 |
备注:
- 更多返回错误代码如下:
- 104:token错误或过期
- 105:异常错误
- 102:请求参数错误
请求示例:
Java:
String result = "";
//请求路径
String url = "http://cloud.assetscontrols.com:8092/OpenApi/Report";
//请求参数 ,json格式参数,建议用对象传入
String body = "{FAction:\"QueryReportSubAssetTrack\",FTokenID:\"3acef045-d302-4032-b40a-d9ee6c1519cd\",FGUID:\"EABD84FC-0228-4836-A0A2-3404EC074A13\",FSelectType:\"1\",FStartTime:\"2020-08-18 16:00:00\",FEndTime:\"2020-08-25 15:59:59\"}";
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:\"QueryReportSubAssetTrack\",FTokenID:\"3acef045-d302-4032-b40a-d9ee6c1519cd\",FGUID:\"EABD84FC-0228-4836-A0A2-3404EC074A13\",FSelectType:\"1\",FStartTime:\"2020-08-18 16:00:00\",FEndTime:\"2020-08-25 15:59:59\"}";
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': 'QueryReportSubAssetTrack',
'FTokenID': '3acef045-d302-4032-b40a-d9ee6c1519cd',
'FGUID':'EABD84FC-0228-4836-A0A2-3404EC074A13',
'FSelectType':1,
'FStartTime':'2020-08-18 16:00:00',
'FEndTime':'2020-08-24 15:59:59',
}
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:
文档更新时间: 2023-08-07 16:04 作者:刘家帅