Brief description:
- Query specific information of a single route
Interface version:
Version Number | Developer | Date of Development | Date of Revision |
---|---|---|---|
1.0.0 | lenny | 2024-12-24 | 2024-12-24 |
Request URL:
- http://icloud.assetscontrols.com:8092/OpenApi/Admin
- https://icloud.assetscontrols.com:3443/OpenApi/Admin
Request Method:
Parameter Name | Required | Type | Description |
---|---|---|---|
Content-Type | Required | string | Request Type: application/json |
Request Parameters:
Parameter Name | Required | Type | Description |
---|---|---|---|
FTokenID | Yes | string | Token ID |
FAction | Yes | string | Method Name (QueryRoutePlanByFGUID ) |
FGUID | Yes | string | Route unique identifier-FRouteGUID |
Return Example:
When correct, it returns:
{
"Result": 200,
"Message": "check token success",
"FObject": {
"Result": 200,
"Message": "check token success",
"FObject": {
"Table": [
{
"FGUID": "e286fe13-2034-45eb-9da2-d929e8a2558a",
"FName": "8789746",
"FCode": "20200830145345",
"FStartFence": "5b81e7f0-1e4c-4e4e-a4ba-32a7138caf03",
"FStartFenceName": "Sea Valley Fence Test",
"FStartFormType": 1,
"FStartTypeName": "Test",
"FStartPath": "[{\"lat\":22.67071837531768,\"lng\":113.91099242249336},{\"lat\":22.66875631707885,\"lng\":113.90927486128945},{\"lat\":22.66580899152102,\"lng\":113.91246440413853},{\"lat\":22.666602014375645,\"lng\":113.91647473726114},{\"lat\":22.669011541033097,\"lng\":113.91715372235394},{\"lat\":22.671964991193125,\"lng\":113.91618420544815},{\"lat\":22.671898164421865,\"lng\":113.91389170362235}]",
"FStartRadius": 0.0,
"FStartCenterLon": 113.91365407695481,
"FStartCenterLat": 22.668931600149243,
"FEndFence": "38978700-bdc9-4857-bb0b-9826b59e83e4",
"FEndFenceName": "Testfence2",
"FEndFormType": 1,
"FEndTypeName": "Test",
"FEndPath": "[{\"lat\":24.70994521713008,\"lng\":113.57509278388251},{\"lat\":24.70994521713008,\"lng\":113.57657521611749},{\"lat\":24.711750782978523,\"lng\":113.57657521611749},{\"lat\":24.711750782978523,\"lng\":113.57509278388251}]",
"FEndRadius": 0.0,
"FEndCenterLon": 113.575834,
"FEndCenterLat": 24.710848,
"FRoadPoints": "[{\"lat\":22.66885928808014,\"lng\":113.91363220848557},{\"lat\":22.668999470705682,\"lng\":113.91294237794823},{\"lat\":22.669019771511334,\"lng\":113.91277192775806},{\"lat\":22.669609614401278,\"lng\":113.91290200213997},...,{\"lat\":24.70851446100423,\"lng\":113.57876801084377}]",
"FRemark": ""
}
],
"Table1": [
{
"FRouteGUID": "e286fe13-2034-45eb-9da2-d929e8a2558a",
"FPassFenceGUID": "added96f-c1d2-4965-b425-06e83e72acfc",
"FName": "Testfence1",
"FFormType": 1,
"FTypeName": "Test",
"FPath": "[{\"lat\":22.84764017,\"lng\":114.1301658},{\"lat\":22.84764024,\"lng\":114.13065303},{\"lat\":22.84899473,\"lng\":114.13065304},{\"lat\":22.84899466,\"lng\":114.13016582}]",
"FRadius": 0.0,
"FCenterLon": 114.13065303,
"FCenterLat": 22.84831749,
"FIndex": 1
},
{
"FRouteGUID": "e286fe13-2034-45eb-9da2-d929e8a2558a",
"FPassFenceGUID": "fe09bedb-aae1-43b6-90fb-d2b64e1f4796",
"FName": "test002",
"FFormType": 1,
"FTypeName": "Test",
"FPath": "[{\"lat\":24.316466141381518,\"lng\":113.30286794457346},{\"lat\":24.316466141381518,\"lng\":113.30311424787654},{\"lat\":24.31782038639906,\"lng\":113.30311424787654},{\"lat\":24.31782038639906,\"lng\":113.30286794457346}]",
"FRadius": 0.0,
"FCenterLon": 113.302991096225,
"FCenterLat": 24.3171432638601,
"FIndex": 2
}
]
}
}
}
}
Error returns:
// Indicates that the incoming object is empty, which should be due to incorrect data format
{
"Result": 102,
"Message": "FParam is null",
"FObject": []
}
//Indicates token expiration or error.
{
"Result": 104,
"Message": "token error or timeout",
"FObject": []
}
//Indicates that there is an exception error
{
"Result": 105,
"Message": "fail",
"FObject": null
}
Return parameter Table description:
Parameter Name | Type | Description |
---|---|---|
FAgentGUID | String | Unique company identifier |
FGUID | String | Route unique identifier- |
FName | String | Route Name |
FCode | String | Route Code |
FStartFence | String | Starting Fence Unique identifier |
FStartFenceName | String | Starting fence name |
FStartFormType | int | Starting fence type 1: Polygon 2: Circle |
FStartTypeName | String | Starting fence type name |
FStartPath | String | Starting fence point set, Json string |
FStartRadius | double | Starting Fence Radius |
FStartCenterLon | String | Starting fence center point longitude |
FStartCenterLat | String | Starting fence center point latitude |
FEndFence | String | End fence unique identifier |
FEndFenceName | String | End fence Name |
FEndFormType | int | End Fence Type 1: Polygon 2: Circle |
FEndTypeName | String | End Fence Type Name |
FEndPath | String | End fence point set, Json string |
FEndRadius | double | End Fence Radius |
FEndCenterLon | String | End fence center point longitude |
FEndCenterLat | String | End fence center point latitude |
FRoadPoints | String | A collection of all points on the route, a Json string |
FRemark | String | Route Description |
Return parameter Table1 Description: All Check Point fences. If null, it means that the route does not Check Point fence.
Parameter name | Type | Description |
---|---|---|
FRouteGUID | String | Unique identifier of the route |
FPassFenceGUID | String | Unique identifier of Check Point fence |
FName | String | Check Point fence name |
FFormType | int | Fence Type 1: Polygon 2: Circle |
FTypeName | String | Fence Type Name |
FPath | String | Fence point collection, Json string |
FRadius | double | Starting Fence Radius |
FCenterLon | String | Start fence center point longitude |
FCenterLat | String | Start fence center point Latitude |
FIndex | int | Check Point fence index |
Remarks:
- Additional error codes are as follows:
- 102: Incorrect request parameters
- 104: Token has expired
- 105: Indicates that an exception has occurred.
Request Example:
Java:
String result = "";
// Request URL
String url = "http://cloud.assetscontrols.com:8092/OpenApi/Admin";
// Request parameters in JSON format. It is recommended to use an object to pass the parameter
String body = "{"FAction":"QueryRoutePlanByFGUID","FGUID":"e286fe13-2034-45eb-9da2-d929e8a2558a", \"FTokenID\": \"ec51d691-d9a7-4f74-95a8-1856be2ae741\"}";
URL realUrl = new URL(url);
// Set the common properties of the request
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");
// Sending a POST request requires the following two lines to be set
conn.setDoOutput(true);
conn.setDoInput(true);
PrintWriter pw = new PrintWriter(conn.getOutputStream());
// Send the request parameters
pw.print(body);
// Flush output stream buffer
pw.flush();
// Define BufferedReader to read the response from the URL
BufferedReader bufReader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
// Read the response from the URL using the BufferedReader input stream
String line;
while ((line = bufReader.readLine()) != null) {
result += line;
}
// The response is in the form of a JSON string
return result;
C#:
// Request URL
string url = "http://cloud.assetscontrols.com:8092/OpenApi/Admin";
// Request parameters in JSON format. It is recommended to use an object to pass the parameter
string body = "{"FAction":"QueryRoutePlanByFGUID","FGUID":"e286fe13-2034-45eb-9da2-d929e8a2558a", \"FTokenID\": \"ec51d691-d9a7-4f74-95a8-1856be2ae741\"}";
Encoding encoding = Encoding.UTF8;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
// Request method: 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))
{
// The response is in the form of a JSON string
return reader.ReadToEnd();
}
Python:
url = 'http://cloud.assetscontrols.com:8092/OpenApi/Admin'
data = {
'FAction': 'QueryDepartureListByFAgentGUID',
'FTokenID': 'ec51d691-d9a7-4f74-95a8-1856be2ae741',
'FGUID': 'e286fe13-2034-45eb-9da2-d929e8a2558a'
}
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-12-24 14:32 作者:Jeson