Brief description:
- Modify the information of a waybill trip.
API Version:
Version number | Developer | Date of Development | Date of Revision |
---|---|---|---|
1.0.0 | lenny | 2022-09-22 | 2020-09-22 |
Request URL:
- http://icloud.assetscontrols.com:8092/OpenApi/Admin
- https://icloud.assetscontrols.com:3443/OpenApi/Admin
Request method:
- POST
Request header:
Parameter name | Required | Type | Description |
---|---|---|---|
Content-Type | Yes | string | Request type: application/json |
Request parameters:
Parameter name | Required | Type | Description |
---|---|---|---|
FTokenID | Yes | string | Token ID |
FAction | Yes | string | Method name (UpdateRouteDepartureByFGUID) |
FT_RouteDeparture | Yes | FT_RouteDeparture | Waybill content |
FT_RouteDeparture Object description:
Parameter name | Required | Type | Description |
---|---|---|---|
FGUID | Yes | string | Unique identification of waybill |
FVehicleName | Yes | string | License plate number |
FAssetGUID | Yes | string | Unique identification of equipment |
FAssetID | Yes | string | Device number |
FRouteGUID | Yes | string | Unique identification of route |
FAgentGUID | Yes | string | Unique identification of company |
FPlanStartTime | Yes | DateTime | Planned start time (UTC time) |
FPlanEndTime | Yes | DateTime | Planned end time (UTC time) |
FRouteName | No | string | Route name |
FWaybill | No | string | Order number |
FGoods | No | string | Name of goods |
FCarrier | No | string | Carrier |
FDriverName | No | string | Driver name |
FContainerNo | No | string | Cargo container |
FCargoDescribe | No | string | Description of goods |
FWaybill | No | string | Order number |
FConsignee | No | string | Consignee |
FFinishType | No | int | Completion rule 0: completion at destination, 1: arrival at destination, 2: opening lock within destination |
FDepartureType | No | int | Waybill type 0: ordinary, 1: planned |
FPlannedDuration | No | int | Planned lead time (minutes) |
Response Example:
Return 200 when success:
{
"Result": 200,
"Message": "Succeed",
"FObject": []
}
Return error messages when there are errors:
// indicate that the input object is empty, which might be caused by incorrect data format
{
"Result": 102,
"Message": "Parameters are error",
"FObject": null
}
// indicate there is an exception error
{
"Result": 105,
"Message": "fail",
"FObject": null
}
// indicate there is an error with the plan start time of the waybill
{
"Result": 126,
"Message": "plan start time error" ,
"FObject": null
}
Remarks:
- More error codes are listed below:
- 106: account is expired
- 103: username or password is incorrect
- 102: request parameters are incorrect
- 105: indicate there is an exception error
- 126: indicates an error with the input waybill start time.
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 in the parameters
String body = "{
\"FAction\": \"UpdateRouteDepartureByFGUID\",
\"FT_RouteDeparture\": {
\"FGUID\": \"58a297aa-0703-41f4-95c2-d41440d4631d\",
\"FVehicleName\": \"791011001167\",
\"FAssetGUID\": \"c4b7730e-f74b-4dee-833b-0128bf5dd7f4\",
\"FAssetID\": \"791011001167\",
\"FRouteGUID\": \"c5ed320f-5eb8-4e89-91ab-f480060bd427\",
\"FAgentGUID\": \"661E7209-C77E-4A54-AFB8-6D956F962BDF\",
\"FPlanStartTime\": \"2023-03-16T23:00:00\",
\"FPlanEndTime\": \"2023-03-17T00:00:00\"
},
\"FTokenID\": \"ec51d691-d9a7-4f74-95a8-1856be2ae745\",
\"FTimeDifferent\": 28800,
\"FLanguage\": \"1\"
}";
URL realUrl = new URL(url);
// Set the common 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");
// Send POST request and set the output stream to true
conn.setDoOutput(true);
conn.setDoInput(true);
PrintWriter pw = new PrintWriter(conn.getOutputStream());
// Send the request parameter
pw.print(body);
// flush the output stream's buffer
pw.flush();
// Define a BufferedReader input stream to read the response from the URL
BufferedReader bufReader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
// Define a BufferedReader input stream to read the response from the URL
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 use an object to pass in the parameters
string body = "{
\"FAction\": \"UpdateRouteDepartureByFGUID\",
\"FT_RouteDeparture\": {
\"FGUID\": \"58a297aa-0703-41f4-95c2-d41440d4631d\",
\"FVehicleName\": \"791011001167\",
\"FAssetGUID\": \"c4b7730e-f74b-4dee-833b-0128bf5dd7f4\",
\"FAssetID\": \"791011001167\",
\"FRouteGUID\": \"c5ed320f-5eb8-4e89-91ab-f480060bd427\",
\"FAgentGUID\": \"661E7209-C77E-4A54-AFB8-6D956F962BDF\",
\"FPlanStartTime\": \"2023-03-16T23:00:00\",
\"FPlanEndTime\": \"2023-03-17T00:00:00\"
},
\"FTokenID\": \"ec51d691-d9a7-4f74-95a8-1856be2ae745\",
\"FTimeDifferent\": 28800,
\"FLanguage\": \"1\"
}";
Encoding encoding = Encoding.UTF8;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
// Set the request method to 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;
// Write the request parameters to the output stream
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 = 'http://cloud.assetscontrols.com:8092/OpenApi/Admin'
data = {
'FAction': 'UpdateRouteDepartureByFGUID',
'FT_RouteDeparture': {
'FGUID': '58a297aa-0703-41f4-95c2-d41440d4631d',
'FVehicleName': '791011001167',
'FAssetGUID': 'c4b7730e-f74b-4dee-833b-0128bf5dd7f4',
'FAssetID': '791011001167',
'FRouteGUID': 'c5ed320f-5eb8-4e89-91ab-f480060bd427',
'FAgentGUID': '661E7209-C77E-4A54-AFB8-6D956F962BDF',
'FPlanStartTime': '2023-03-16T23:00:00',
'FPlanEndTime': '2023-03-17T00:00:00'
},
'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;
文档更新时间: 2024-12-24 14:06 作者:Jeson