Summary:

  • Query alarm report

Version:

No. Editor Edit date Revision date
2.0.0 admin 2020-08-20 2020-08-20

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 QueryMessageAlarmList
FGUIDs yes string Unique identification of assets / device, multiple separated by ‘,’
FSelectType yes int 1:Query by assets;0:Query by device
FStartTime yes datetime Start time(UTC)
FEndTime yes datetime End time(UTC)
FDataTypes yes string Alarm type, multiple separated by ‘,’
FDateType yes int 1:Query by receiving time;0:Query by GPS time

Response example:

Correct response:

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

Error response:

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

Return parameter description:

Parameter Data type Explanation
FGUID String Unique identification of alarm record
FVehicleGUID String Unique identification of asset
FVehicleName String asset No.
FAssetGUID String Unique identification of device
FAssetID String Device Id
FAssetTypeID Int Device type
FSubAssetID String Slave Id
FDataType Int Alarm type
FCurrentStatus Int record state(1:in progress;2:Finished ;3:one time)
FStartTime DateTime Start time(UTC)
FStartLongitude Decimal Start longitude
FStartLatitude Decimal Start latitude
FEndLongitude Decimal End longitude
FEndLatitude Decimal End latitude
FEndTime DateTime End time(UTC)
FKeepSeconds Int Duration(s)
FStartMileage Int Start mileage (km)
FEndMileage Int End mileage (km)
FKeepDistance Int Continuous distance
FCreateTime DateTime Receive time
FStartCell String Start address cell code
FEndCell String End address cell code
FDescribeJSON String Alarm Describe

FDescribeJSON Description:
1.Attitude alarm(FDataType:197):
E.g.:{“type”:1}

ParameterName Type Descriptioin
type Int Attitude alarm type: 1: Leaning forward 2: Leaning backward 3: Leaning left 4: Leaning right

2.Temperature and humidity alarm(FDataType:63)
E.g.:{“F”:”65.0”,”ID”:”867730057935318”,”N”:”27.600000381469727”,”T”:4}

ParameterName Type Descriptioin
T int Alarm type: 1: High temperature alarm 2: Low temperature alarm 3: High humidity alarm 4: Low humidity alarm 5: High light 6: Low light 7: High air pressure 8: Low air pressure
F Double Threshold
N Double Actual value
ID String Sensor

3.Vibration(collision) alarm(FDataType:29)
E.g.:{"fAcceleration":"x:65488;y:160;z:864","fVibrate":254}

ParameterName Type Descriptioin
fAcceleration String Three-axis acceleration value
fVibrate Int vibration value

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:\"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");
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#:

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