Summary:
- Curve of state
Version:
No. | Editor | Edit date | Revision date |
---|---|---|---|
1.0.0 | lenny | 2023-08-07 | 2023-08-07 |
Request URL:
- http://icloud.assetscontrols.com:8092/OpenApi/Report
- https://icloud.assetscontrols.com:3443/OpenApi/Report
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 | Required | string | Token ID |
FAction | Required | string | Method name (QueryReportStatusTrack) |
FGUID | Required | string | Vehicle/Equipment unique identifier |
FStartTime | Required | string | Start time, e.g., “2023-07-08 16:00:00” |
FEndTime | Required | string | End time, e.g., “2023-08-07 15:59:59” |
FSelectType | Required | int | Query type (0: Vehicle, 1: Equipment) |
Response example:
Correct response:
{
"Result": 200,
"Message": "check token success",
"FObject": [
{
"FVehicleName": "837303000449",
"FAssetID": "837303000449",
"FGPSTime": "2023-07-10T09:40:32",
"Bat": 76,
"TH": "25.1℃(60%)",
"Lx": 0,
"Vib": 4519,
"Press": 0,
"Acce": "x:-2880;y:1376;z:-3200",
"Pos": "x:-2880;y:1376;z:-3200",
"FD": -1,
"FLongitude": 113.918228424976,
"FLatitude": 22.6726779622259,
"FDir": 0,
"FTemp1": 25.1000003814697,
"FTemp2": -1000,
"FHum1": 60,
"FHum2": 0
}
]
}
Error response:
{
"Result": 102,
"Message": "Action is error",
"FObject": []
}
Return parameter description:
Parameter | Data type | Explanation |
---|---|---|
FVehicleName | String | Vehicle ID |
FAssetID | Int | Equipment ID |
FGPSTime | String | GPS time |
Bat | Int | Battery level |
TH | String | Temperature and humidity value |
Lx | Int | Light intensity |
Vib | Int | Vibration amplitude |
Press | Int | Pressure |
Acce | String | Acceleration |
Pos | String | Position |
FD | Int | Door status |
FLongitude | Double | Current longitude |
FLatitude | Double | Current latitude |
FDir | Int | Description |
FTemp1 | Double | Temperature 1 |
FTemp2 | Double | Temperature 2 |
FHum1 | Double | Humidity 1 |
FHum2 | Double | Humidity 2 |
Other result status description:
- 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 = "{\r\n \"FAction\": \"QueryReportStatusTrack\",\r\n \"FGUID\": \"f6538348-bccf-4da2-86f0-6659cfcaa33d\",\r\n \"FStartTime\": \"2023-07-08 16:00:00\",\r\n \"FEndTime\": \"2023-08-07 15:59:59\",\r\n \"FSelectType\": 0,\r\n \"FTokenID\": \"3acef045-d302-4032-b40a-d9ee6c1519cd\",\r\n \"FTimeDifferent\": 28800,\r\n \"FLanguage\": \"1\"\r\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");
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": "QueryReportStatusTrack",
"FGUID": "f6538348-bccf-4da2-86f0-6659cfcaa33d",
"FStartTime": "2023-07-08 16:00:00",
"FEndTime": "2023-08-07 15:59:59",
"FSelectType": 0,
"FTokenID": "3acef045-d302-4032-b40a-d9ee6c1519cd",
"FTimeDifferent": 28800,
"FLanguage": "1"
}";
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": "QueryReportStatusTrack", "FGUID": "f6538348-bccf-4da2-86f0-6659cfcaa33d", "FStartTime": "2023-07-08 16:00:00", "FEndTime": "2023-08-07 15:59:59", "FSelectType": 0, "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;
文档更新时间: 2023-12-01 10:12 作者:刘家帅