Summary:
- Query Device Unlock&lock Report
Version:
No. | Editor | Edit date | Revision date |
---|---|---|---|
2.0.0 | admin | 2020-08-20 | 2024-08-21 |
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 | yes | string | token |
FAction | yes | string | QueryReportOpenLockList |
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) |
FDateType | yes | int | 1:Query by receiving time;0:Query by GPS time |
Response example:
Correct response:
{
"Result": 200,
"Message": "check token success",
"FObject": [
{
"FVehicleGUID": "3bf410f9-c2fb-4768-a086-39c7c378a473",
"FVehicleName": "8042400950",
"FAssetGUID": "0f2b5344-46e6-46d6-bea0-63f574c08df3",
"FAssetID": "8042400950",
"FAssetTypeID": 3701,
"FDateTime": "2024-08-21T03:23:02",
"FLongitude": 26.172225,
"FLatitude": -29.269373,
"FMileage": 45000,
"FType": 0,
"FCardNo": "",
"FOpenType": -1,
"FCreateTime": "2024-08-21T03:23:03.49",
"FCell": null,
"FUserName": null
},
{
"FVehicleGUID": "3bf410f9-c2fb-4768-a086-39c7c378a473",
"FVehicleName": "8042400950",
"FAssetGUID": "0f2b5344-46e6-46d6-bea0-63f574c08df3",
"FAssetID": "8042400950",
"FAssetTypeID": 3701,
"FDateTime": "2024-08-21T03:22:37",
"FLongitude": 26.172225,
"FLatitude": -29.269373,
"FMileage": 45000,
"FType": 1,
"FCardNo": "",
"FOpenType": 2,
"FCreateTime": "2024-08-21T03:22:38.797",
"FCell": null,
"FUserName": "szctestys"
},
{
"FVehicleGUID": "3bf410f9-c2fb-4768-a086-39c7c378a473",
"FVehicleName": "8042400950",
"FAssetGUID": "0f2b5344-46e6-46d6-bea0-63f574c08df3",
"FAssetID": "8042400950",
"FAssetTypeID": 3701,
"FDateTime": "2024-08-21T03:07:44",
"FLongitude": 26.172225,
"FLatitude": -29.269373,
"FMileage": 45000,
"FType": 0,
"FCardNo": "",
"FOpenType": -1,
"FCreateTime": "2024-08-21T03:07:45.31",
"FCell": null,
"FUserName": null
},
{
"FVehicleGUID": "3bf410f9-c2fb-4768-a086-39c7c378a473",
"FVehicleName": "8042400950",
"FAssetGUID": "0f2b5344-46e6-46d6-bea0-63f574c08df3",
"FAssetID": "8042400950",
"FAssetTypeID": 3701,
"FDateTime": "2024-08-21T03:07:35",
"FLongitude": 26.172225,
"FLatitude": -29.269373,
"FMileage": 45000,
"FType": 1,
"FCardNo": "0000127898",
"FOpenType": 1,
"FCreateTime": "2024-08-21T03:07:36.07",
"FCell": null,
"FUserName": "[0000127898]"
}
]
}
Error response:
{
"Result": 102,
"Message": "Action is error",
"FObject": []
}
Return parameter description:
Parameter | Data type | Explanation |
---|---|---|
FVehicleGUID | String | Unique identification of assets |
FVehicleName | String | assets No. |
FAssetGUID | String | Unique identification of device |
FAssetID | String | Device Id |
FAssetTypeID | Int | Device type |
FDateTime | DateTime | date time |
FLongitude | Decimal | Longitude |
FLatitude | Decimal | Latitude |
FMileage | Int | Mileage (km) |
FType | Int | Lock state (1:Open;0:Close) |
FCardNo | String | RFID Card No. |
FOpenType | Int | Open type (-1:locked ; 1:Swipe RFID card;2:Remote unlock command;3:BLE unlock;4:lock rope cut unlock;5:SMS unlock;6:Press button unlock;7:NFC unlock) |
FCreateTime | DateTime | Receive date time |
FCell | String | MCC:MNC:LAC:CID(P45 customized firmware) |
FUserName | String | Unlock Person(LoginUsername) or Personnel bound to RFID card or RFID card no. |
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 = "{FAction:\"QueryReportOpenLockList\",FTokenID:\"3acef045-d302-4032-b40a-d9ee6c1519cd\",FGUIDs:\"BE2A1E27-B36E-4301-B2C8-465A62AD215F,FE0BDE75-4A30-4B9C-AD2E-66D8A4F44F5E\",FSelectType:\"1\",FStartTime:\"2020-08-18 16:00:00\",FEndTime:\"2020-08-25 15:59:59\",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#(.NET):
string url = "http://cloud.assetscontrols.com:8092/OpenApi/Report";
string body = "{FAction:\"QueryReportOpenLockList\",FTokenID:\"3acef045-d302-4032-b40a-d9ee6c1519cd\",FGUIDs:\"BE2A1E27-B36E-4301-B2C8-465A62AD215F,FE0BDE75-4A30-4B9C-AD2E-66D8A4F44F5E\",FSelectType:\"1\",FStartTime:\"2020-08-18 16:00:00\",FEndTime:\"2020-08-25 15:59:59\",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': 'QueryReportOpenLockList',
'FTokenID': '3acef045-d302-4032-b40a-d9ee6c1519cd',
'FGUIDs':'BE2A1E27-B36E-4301-B2C8-465A62AD215F,FE0BDE75-4A30-4B9C-AD2E-66D8A4F44F5E',
'FSelectType':1,
'FStartTime':'2020-08-05 16:00:00',
'FEndTime':'2020-08-12 15:59:59',
'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;
文档更新时间: 2024-08-21 11:46 作者:Jeson