简要描述:

  • 获取温湿度曲线报表(新)

接口版本:

版本号 制定人 制定日期 修订日期
2.0.0 lenny 2022-02-18

请求URL:

请求头:

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

请求参数:

参数名 是否必须 类型 说明
FTokenID string 令牌ID
FAction string 方法名 (QueryReportTemperatureTrackNew)
FGUID string 车辆/设备唯一标识
FSelectType int 1:按车辆查;0:按终端查
FStartTime datetime 开始时间 (UTC时间)
FEndTime datetime 结束时间 (UTC时间)
#### 返回示例:

正确时返回:

{
    "Result": 200,
    "Message": "check token success",
    "FObject": [
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-17T08:48:40",
            "FDateTime": "2022-02-17T08:48:40",
            "FTemperature": "31",
            "FHumidity": 0,
            "FIndex": 1
        },
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-17T08:51:56",
            "FDateTime": "2022-02-17T08:51:56",
            "FTemperature": "32",
            "FHumidity": 0,
            "FIndex": 1
        },
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-17T09:21:58",
            "FDateTime": "2022-02-17T09:21:58",
            "FTemperature": "31",
            "FHumidity": 0,
            "FIndex": 1
        },
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-17T09:52:00",
            "FDateTime": "2022-02-17T09:52:00",
            "FTemperature": "31",
            "FHumidity": 0,
            "FIndex": 1
        },
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-17T10:21:46",
            "FDateTime": "2022-02-17T10:21:46",
            "FTemperature": "29",
            "FHumidity": 0,
            "FIndex": 1
        },
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-17T10:49:46",
            "FDateTime": "2022-02-17T10:49:46",
            "FTemperature": "23",
            "FHumidity": 0,
            "FIndex": 1
        },
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-17T11:20:05",
            "FDateTime": "2022-02-17T11:20:05",
            "FTemperature": "23",
            "FHumidity": 0,
            "FIndex": 1
        },
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-17T11:50:10",
            "FDateTime": "2022-02-17T11:50:10",
            "FTemperature": "24",
            "FHumidity": 0,
            "FIndex": 1
        },
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-17T12:20:26",
            "FDateTime": "2022-02-17T12:20:26",
            "FTemperature": "22",
            "FHumidity": 0,
            "FIndex": 1
        },
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-17T12:50:12",
            "FDateTime": "2022-02-17T12:50:12",
            "FTemperature": "23",
            "FHumidity": 0,
            "FIndex": 1
        },
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-17T13:20:07",
            "FDateTime": "2022-02-17T13:20:07",
            "FTemperature": "22",
            "FHumidity": 0,
            "FIndex": 1
        },
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-17T13:50:09",
            "FDateTime": "2022-02-17T13:50:09",
            "FTemperature": "22",
            "FHumidity": 0,
            "FIndex": 1
        },
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-17T14:20:07",
            "FDateTime": "2022-02-17T14:20:07",
            "FTemperature": "22",
            "FHumidity": 0,
            "FIndex": 1
        },
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-17T14:50:11",
            "FDateTime": "2022-02-17T14:50:11",
            "FTemperature": "22",
            "FHumidity": 0,
            "FIndex": 1
        },
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-17T15:20:01",
            "FDateTime": "2022-02-17T15:20:01",
            "FTemperature": "22",
            "FHumidity": 0,
            "FIndex": 1
        },
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-17T15:50:10",
            "FDateTime": "2022-02-17T15:50:10",
            "FTemperature": "22",
            "FHumidity": 0,
            "FIndex": 1
        },
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-17T16:20:22",
            "FDateTime": "2022-02-17T16:20:22",
            "FTemperature": "22",
            "FHumidity": 0,
            "FIndex": 1
        },
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-17T16:50:08",
            "FDateTime": "2022-02-17T16:50:08",
            "FTemperature": "22",
            "FHumidity": 0,
            "FIndex": 1
        },
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-17T17:20:11",
            "FDateTime": "2022-02-17T17:20:11",
            "FTemperature": "22",
            "FHumidity": 0,
            "FIndex": 1
        },
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-17T17:50:37",
            "FDateTime": "2022-02-17T17:50:37",
            "FTemperature": "23",
            "FHumidity": 0,
            "FIndex": 1
        },
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-17T18:20:40",
            "FDateTime": "2022-02-17T18:20:40",
            "FTemperature": "23",
            "FHumidity": 0,
            "FIndex": 1
        },
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-17T18:50:33",
            "FDateTime": "2022-02-17T18:50:33",
            "FTemperature": "23",
            "FHumidity": 0,
            "FIndex": 1
        },
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-17T19:20:33",
            "FDateTime": "2022-02-17T19:20:33",
            "FTemperature": "22",
            "FHumidity": 0,
            "FIndex": 1
        },
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-17T19:50:36",
            "FDateTime": "2022-02-17T19:50:36",
            "FTemperature": "22",
            "FHumidity": 0,
            "FIndex": 1
        },
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-17T20:20:36",
            "FDateTime": "2022-02-17T20:20:36",
            "FTemperature": "22",
            "FHumidity": 0,
            "FIndex": 1
        },
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-17T20:50:44",
            "FDateTime": "2022-02-17T20:50:44",
            "FTemperature": "23",
            "FHumidity": 0,
            "FIndex": 1
        },
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-17T21:20:38",
            "FDateTime": "2022-02-17T21:20:38",
            "FTemperature": "22",
            "FHumidity": 0,
            "FIndex": 1
        },
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-17T21:50:30",
            "FDateTime": "2022-02-17T21:50:30",
            "FTemperature": "22",
            "FHumidity": 0,
            "FIndex": 1
        },
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-17T22:20:40",
            "FDateTime": "2022-02-17T22:20:40",
            "FTemperature": "22",
            "FHumidity": 0,
            "FIndex": 1
        },
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-17T22:50:32",
            "FDateTime": "2022-02-17T22:50:32",
            "FTemperature": "22",
            "FHumidity": 0,
            "FIndex": 1
        },
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-17T23:20:35",
            "FDateTime": "2022-02-17T23:20:35",
            "FTemperature": "22",
            "FHumidity": 0,
            "FIndex": 1
        },
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-17T23:50:38",
            "FDateTime": "2022-02-17T23:50:38",
            "FTemperature": "22",
            "FHumidity": 0,
            "FIndex": 1
        },
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-18T00:20:43",
            "FDateTime": "2022-02-18T00:20:43",
            "FTemperature": "23",
            "FHumidity": 0,
            "FIndex": 1
        },
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-18T00:50:58",
            "FDateTime": "2022-02-18T00:50:58",
            "FTemperature": "23",
            "FHumidity": 0,
            "FIndex": 1
        },
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-18T01:20:48",
            "FDateTime": "2022-02-18T01:20:48",
            "FTemperature": "23",
            "FHumidity": 0,
            "FIndex": 1
        },
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-18T01:50:53",
            "FDateTime": "2022-02-18T01:50:53",
            "FTemperature": "26",
            "FHumidity": 0,
            "FIndex": 1
        },
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-18T02:21:05",
            "FDateTime": "2022-02-18T02:21:05",
            "FTemperature": "30",
            "FHumidity": 0,
            "FIndex": 1
        },
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-18T02:51:01",
            "FDateTime": "2022-02-18T02:51:01",
            "FTemperature": "36",
            "FHumidity": 0,
            "FIndex": 1
        },
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-18T03:21:38",
            "FDateTime": "2022-02-18T03:21:38",
            "FTemperature": "29",
            "FHumidity": 0,
            "FIndex": 1
        },
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-18T03:51:47",
            "FDateTime": "2022-02-18T03:51:47",
            "FTemperature": "27",
            "FHumidity": 0,
            "FIndex": 1
        },
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-18T04:21:07",
            "FDateTime": "2022-02-18T04:21:07",
            "FTemperature": "26",
            "FHumidity": 0,
            "FIndex": 1
        },
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-18T04:51:15",
            "FDateTime": "2022-02-18T04:51:15",
            "FTemperature": "26",
            "FHumidity": 0,
            "FIndex": 1
        },
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-18T05:21:08",
            "FDateTime": "2022-02-18T05:21:08",
            "FTemperature": "25",
            "FHumidity": 0,
            "FIndex": 1
        },
        {
            "FSubAssetID": "Temperature",
            "FGPSTime": "2022-02-18T05:51:20",
            "FDateTime": "2022-02-18T05:51:20",
            "FTemperature": "25",
            "FHumidity": 0,
            "FIndex": 1
        }
    ]
}

错误时返回:

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

返回参数说明:

参数名 类型 说明
FSubAssetID String 设备号 (作为外设子锁时显示设备号,作为一体机,则显示OutSide、InSide、Temperature)
FGPSTime DateTime GPS时间
FDateTime DateTime 接收数据时间(作为外设子锁时显示接收数据时间,作为一体机,则为FGPSTime
FTemperature string 温度值
FHumidity Int 湿度值
FIndex Int 传感器序号

备注:

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

请求示例:

Java:

String result = "";
//请求路径
String url = "http://cloud.assetscontrols.com:8092/OpenApi/Report";  
//请求参数 ,json格式参数,建议用对象传入
String body = "{FAction:\"QueryReportTemperatureTrackNew\",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:\"QueryReportTemperatureTrackNew\",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': 'QueryReportTemperatureTrackNew',
      '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   作者:刘家帅