Brief description:
-Modify Route Plan
Interface version:
| Version Number | Developer | Date of Development | Date of Revision |
|---|---|---|---|
| 1.0.0 | lenny | 2022-09-22 | 2020-09-22 |
Request URL:
- https://icloud.assetscontrols.com:3443/OpenApi/Admin
- https://cloud.assetscontrols.com:3443/OpenApi/Admin
Request Method:
- POST
Request Header:
| 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 | Action (UpdateRoutePlan ) |
| FT_RoutePlan | YES | object | Route Information |
Object Description:
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| FGUID | YES | string | RouteGUID |
| FName | YES | string | Route Name |
| FCode | YES | string | Route Code |
| FStartFence | YES | string | Start Fence GUID |
| FEndFence | YES | string | End Fence GUID |
| FRemark | YES | string | Remark |
| FRouteType | YES | int | Route Type 0:has route points 1:no route points |
| FRoadPoints | YES | string | Collection of all points on the route, in Json format”[{"lat":22.67009126,"lng":113.92249915},{"lat":22.67014155,"lng":113.9224293},{"lat":22.67027207,"lng":113.92198938},{"lat":22.67034136,"lng":113.92202024},{"lat":22.6708117,"lng":113.92216942}]. Note: When FRouteType = 0, this field is mandatory. When FRouteType = 1, it can be left blank. |
| FDistance | YES | int | Total transportation mileage |
| FDuration | YES | int | Total transportation duration, in hours |
| FPassFenceGUIDs | YES | string | Unique identifier of the path barrier, multiple separated by commas in English |
Return Example:
When correct, it returns:
{
"Result": 200,
"Message":"success",
"FObject": []
}
Error returns:
// Indicates that the input object is empty. This should be due to an incorrect data format.
{
"Result": 102,
"Message": "FRoutePlanList is null",
"FObject": []
}
// Indicates that there is an exception error
{
"Result": 105,
"Message": "fail",
"FObject": []
}
//102 indicates that the input parameters do not conform to the rules. Please refer to the Message for details.
{
"Result": 102,
"Message": {model.FName}:FStartFence or FEndFence is null,
"FObject": []
}
Remarks:
- More error codes returned are as follows:
- 102: Request parameter error.
- 104: Token expired or error.
- 105: General error.
Request Example:
Java:
String result = "";
//Request URL
String url = "https://cloud.assetscontrols.com:3443/OpenApi/Admin";
//Request parameters, in JSON format, it is suggested to pass in an object
String body = "{
\"FAction\": \"UpdateRoutePlan\",
\"FT_RoutePlan\":
{
\"FGUID\": \"09cf2885-b998-4917-bb29-fc9dbbb054c8\",
\"FName\": \"000154336\",
\"FCode\": \"000154336\",
\"FStartFence\":\"5ae45d8e-18bd-4eaa-ae4b-017ab7c3f36d\",
\"FEndFence\":\"5ae45d8e-18bd-4eaa-ae4b-017ab7c3f36d\",
\"FPassFenceGUIDs\":\"5ae45d8e-18bd-4eaa-ae4b-017ab7c3f36d\",
\"FRoadPoints\":\"[{\"lat\":22.67009126,\"lng\":113.92249915},{\"lat\":22.67014155,\"lng\":113.9224293},{\"lat\":22.67027207,\"lng\":113.92198938},{\"lat\":22.67034136,\"lng\":113.92202024},{\"lat\":22.6708117,\"lng\":113.92216942},{\"lat\":22.67093116,\"lng\":113.92221918}]\",
\"FRouteType\":0,
} ,
\"FTokenID\": \"ec51d691-d9a7-4f74-95a8-1856be2ae742\",
\"FTimeDifferent\": 28800,
\"FLanguage\": \"1\"
}";
URL realUrl = new URL(url);
// Set general request properties
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");
// Must set the following two lines to send a POST request
conn.setDoOutput(true);
conn.setDoInput(true);
PrintWriter pw = new PrintWriter(conn.getOutputStream());
// Send Request Parameters
pw.print(body);
// flush output stream buffer
pw.flush();
// Define BufferedReader input stream to read URL response
BufferedReader bufReader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
// Define BufferedReader input stream to read URL response
String line;
while ((line = bufReader.readLine()) != null) {
result += line;
}
// The returned value is 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 pass in an object
string body = "{
\"FAction\": \"UpdateRoutePlan\",
\"FT_RoutePlan\":
{
\"FGUID\": \"09cf2885-b998-4917-bb29-fc9dbbb054c8\",
\"FName\": \"000154336\",
\"FCode\": \"000154336\",
\"FStartFence\":\"5ae45d8e-18bd-4eaa-ae4b-017ab7c3f36d\",
\"FEndFence\":\"5ae45d8e-18bd-4eaa-ae4b-017ab7c3f36d\",
\"FPassFenceGUIDs\":\"5ae45d8e-18bd-4eaa-ae4b-017ab7c3f36d\",
\"FRoadPoints\":\"[{\"lat\":22.67009126,\"lng\":113.92249915},{\"lat\":22.67014155,\"lng\":113.9224293},{\"lat\":22.67027207,\"lng\":113.92198938},{\"lat\":22.67034136,\"lng\":113.92202024},{\"lat\":22.6708117,\"lng\":113.92216942},{\"lat\":22.67093116,\"lng\":113.92221918}]\",
\"FRouteType\":0,
} ,
\"FTokenID\": \"ec51d691-d9a7-4f74-95a8-1856be2ae742\",
\"FTimeDifferent\": 28800,
\"FLanguage\": \"1\"
}";
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 returned value is a JSON string
return reader.ReadToEnd();
}Python:
url = 'https://cloud.assetscontrols.com:3443/OpenApi/Admin'
data = {
'FAction': 'UpdateRoutePlan',
'FT_RoutePlan':
{
'FGUID': '09cf2885-b998-4917-bb29-fc9dbbb054c8',
'FName': '000154336',
'FCode': '000154336',
'FStartFence':'5ae45d8e-18bd-4eaa-ae4b-017ab7c3f36d',
'FEndFence':'5ae45d8e-18bd-4eaa-ae4b-017ab7c3f36d',
'FPassFenceGUIDs':'5ae45d8e-18bd-4eaa-ae4b-017ab7c3f36d',
'FRoadPoints':'[{\"lat\":22.67009126,\"lng\":113.92249915},{\"lat\":22.67014155,\"lng\":113.9224293},{\"lat\":22.67027207,\"lng\":113.92198938},{\"lat\":22.67034136,\"lng\":113.92202024},{\"lat\":22.6708117,\"lng\":113.92216942},{\"lat\":22.67093116,\"lng\":113.92221918}]',
'FRouteType':0,
} ,
'FTokenID': 'ec51d691-d9a7-4f74-95a8-1856be2ae745',
'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;文档更新时间: 2026-01-23 12:00 作者:刘家帅