Summary:

  • Query temperature & humidity curve

Version:

No. Editor Edit date Revision date
2.0.0 admin 2022-02-18

Request URL:

Request mode:

  • POST

Request header:

Parameter Required field Data type Explanation
Content-Type yes string application/json

Request parameter:

Parameter Required field Data type Explanation
FTokenID yes string token
FAction yes string QueryReportTemperatureTrackNew
FGUID yes string Unique identification of assets / device
FSelectType yes int 1:Query by assets;0:Query by device
FStartTime yes datetime Start time(UTC)
FEndTime yes datetime End time(UTC)

Response example:

Correct response:

{
    "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
        }
    ]
}

Error response:

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

Return parameter description:

Parameter Data type Explanation
FSubAssetID String Slave ID
FGPSTime DateTime GPS time(UTC)
FDateTime DateTime Receive time(UTC)
FTemperature string Temperature
FHumidity Int Humidity
FIndex Int Index

Response example:

  • 105:System exception
  • 104:Token error or expire
  • 102:Parameter error

Examples:

Java:

String result = "";
String url = "http://cloud.assetscontrols.com:8092/OpenApi/Report";
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");
conn.setDoOutput(true);
conn.setDoInput(true);
PrintWriter pw = new PrintWriter(conn.getOutputStream());
pw.print(body);
pw.flush();
BufferedReader bufReader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String line;
while ((line = bufReader.readLine()) != null) {
     result += line;
 }
return result;

C#(.NET):

string url = "http://cloud.assetscontrols.com:8092/OpenApi/Report";
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);
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))
{
    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;
文档更新时间: 2023-12-01 10:13   作者:admin