Brief description:

  • Route Dispatch is used for waybill tasks to vehicles.

Interface version:

Version Number Developer Date of Development Date of Revision
1.0.0 lenny 2022-09-22 2020-09-22

Request URL:

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 Required string Token ID
FAction Required string Method Name (AddPublicRouteDeparture )
FName Optional string Company Name, if this field is empty, it defaults to the current user’s company.
FListRouteDeparture Required List Waybill content, can be dispatched.
MT_RouteDeparture Object Description:
Parameter Name Required Type Description
FVehicleName Required string License Plate Number
FAssetID Required string Device number
FRouteName Required string Route Name
FPlanStartTime Required DateTime Planned Start Time (UTC)
FPlanEndTime Required DateTime Planned End Time (UTC)
FWaybill Optional string Order Number
FGoods Optional string Name of Goods
FCarrier Optional string Carrier
FDriverName Optional string Driver’s name
FContainerNo Optional string Cargo box
FCargoDescribe Optional string Cargo Description
FWaybill Optional string Order number
FConsignee Optional string Consignee
FFinishType Required int Completion Rule 0: Completed Outside Destination, 1: Arrived at Destination, 2: Unlocked within Destination
FDepartureType Required int Waybill Type 0: Normal 1: Plan
FPlannedDuration Required int Plan Duration (minutes)

Return Example:

When correct, it returns:

{
    "Result": 200,
    "Message":"success",
    "FObject":  [
        {
            "RowNo": 0,  //Corresponding to the serial number of the incoming object (FListRouteDeparture)
            "FWaybillGUID": "d0ddcad6-c5d6-4876-8174-f97e3956f72e" //The unique identifier of the waybill
        }
    ]
}

Error returns:

// Indicates that the incoming object is empty, which should be due to incorrect data format
{
    "Result": 102,
    "Message": "FListRouteDeparture is null",
    "FObject": null
}
// Indicates that there is an exception error
{
    "Result": 105,
    "Message": "fail",
    "FObject": null
}
// Indicates that the license plate number or device number in the incoming data is empty
{
    "Result": 106,
    "Message": "FVehicleName or FAssetID has empty data",
    "FObject": null
}

// Indicates duplicate license plate numbers in the incoming data
{
    "Result": 107,
    "Message": "FVehicleName has duplicate data:" + duplicated license plate numbers separated by commas,
    "FObject": null
}
// Indicates duplicate device numbers in the incoming data
{
    "Result": 108,
    "Message": "FVehicleName has duplicate data:" + duplicated device numbers separated by commas,
    "FObject": null
}

// Indicates that the company cannot be found under the current user, please log in to the platform to check
{
    "Result": 109,
    "Message": "FAgentName has no exists data:"  + company name,
    "FObject": null
}
// Indicates that these device numbers do not exist or are not under the company, it is recommended to confirm on the platform
{
    "Result": 110,
    "Message": "FAssetID has no exists data:" + non-existent device numbers separated by commas,
    "FObject": null
}
// Indicates that there are some device numbers in execution, it is recommended to end the task on the platform before dispatching
{
    "Result": 111,
    "Message": "FAssetID has running data:" + device numbers in execution separated by commas,
    "FObject": null
}
// Indicates that there are some license plate numbers in execution, it is recommended to end the task on the platform before dispatching
{
    "Result": 112,
    "Message": "FVehicleName has running data:" + license plate numbers in execution separated by commas,
    "FObject": null
}
// Indicates that these route names do not exist or are not under the company, it is recommended to confirm on the platform
{
    "Result": 113,
    "Message": "FRouteName has no exists data:" + non-existent route names separated by commas,
    "FObject": null
}

Remarks:

  • More error codes returned are as follows:
  • 103: Username or password is incorrect
  • 102: Request parameter error
  • 105: Indicates an exception error
  • 106: Indicates that the license plate number or device number in the incoming data is empty
  • 107: Indicates duplicate license plate numbers in the incoming data
  • 108: Indicates duplicate device numbers in the incoming data
  • 109: Indicates that the company cannot be found under the current user, please log in to the platform to check
  • 110: Indicates that these device numbers do not exist or are not under the company, it is recommended to confirm on the platform
  • 111: Indicates that there are some device numbers in execution, it is recommended to end the task on the platform before dispatching
  • 112: Indicates that there are some license plate numbers in execution, it is recommended to end the task on the platform before dispatching
  • 113: Indicates that these route names do not exist or are not under the company, it is recommended to confirm on the platform

Request Example:

Java:

String result = "";
//Request URL
String url = "http://cloud.assetscontrols.com:8092/OpenApi/Admin";  
//Request parameters, in JSON format, it is suggested to pass in an object
String body = "{FAction:\"AddPublicRouteDeparture\",FTokenID:\"3acef045-d302-4032-b40a-d9ee6c1519cd\","FListRouteDeparture":"[{\"FVehicleName\":\"13301781203\",\"FWaybill\":\"6757787\",\"FGoods\":\"223434\",\"FAssetID\":\"13301781203\",\"FRouteGUID\":\"42bfae96-cbed-4d2e-8e9f-c1cd4ad0d5df\",\"FRouteName\":\"43534\",\"FCarrier\":\"656546\",\"FDriverGUID\":\"\",\"FDriverName\":\"435435\",\"FDriverPhone\":\"6546\",\"FPlanStartTime\":\"2022-09-22 16:00:00\",\"FPlanEndTime\":\"2022-09-22 16:00:00\",\"FAgentGUID\":\"d6de6745-9b7b-42cd-b624-b4659f5f5ce5\",\"FRouteCode\":\"20220622103851\",\"FVehicleTypeID\":\"\",\"FVehicleImgType\":\"0\",\"FContainerNo\":\"6422f\",\"FCargoDescribe\":\"gfdgd\",\"FConsignee\":\"retgfd\",\"FFinishType\":1},{\"FVehicleName\":\"13301781203\",\"FWaybill\":\"6757787\",\"FGoods\":\"223434\",\"FAssetID\":\"13301781203\",\"FRouteGUID\":\"42bfae96-cbed-4d2e-8e9f-c1cd4ad0d5df\",\"FRouteName\":\"43534\",\"FCarrier\":\"656546\",\"FDriverGUID\":\"\",\"FDriverName\":\"435435\",\"FDriverPhone\":\"6546\",\"FPlanStartTime\":\"2022-09-22 16:00:00\",\"FPlanEndTime\":\"2022-09-22 16:00:00\",\"FAgentGUID\":\"d6de6745-9b7b-42cd-b624-b4659f5f5ce5\",\"FRouteCode\":\"20220622103851\",\"FVehicleTypeID\":\"\",\"FVehicleImgType\":\"0\",\"FContainerNo\":\"6422f\",\"FCargoDescribe\":\"gfdgd\",\"FConsignee\":\"retgfd\",\"FFinishType\":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:\"AddPublicRouteDeparture\",FTokenID:\"3acef045-d302-4032-b40a-d9ee6c1519cd\","FListRouteDeparture":"[{\"FVehicleName\":\"13301781203\",\"FWaybill\":\"6757787\",\"FGoods\":\"223434\",\"FAssetID\":\"13301781203\",\"FRouteGUID\":\"42bfae96-cbed-4d2e-8e9f-c1cd4ad0d5df\",\"FRouteName\":\"43534\",\"FCarrier\":\"656546\",\"FDriverGUID\":\"\",\"FDriverName\":\"435435\",\"FDriverPhone\":\"6546\",\"FPlanStartTime\":\"2022-09-22 16:00:00\",\"FPlanEndTime\":\"2022-09-22 16:00:00\",\"FAgentGUID\":\"d6de6745-9b7b-42cd-b624-b4659f5f5ce5\",\"FRouteCode\":\"20220622103851\",\"FVehicleTypeID\":\"\",\"FVehicleImgType\":\"0\",\"FContainerNo\":\"6422f\",\"FCargoDescribe\":\"gfdgd\",\"FConsignee\":\"retgfd\",\"FFinishType\":1},{\"FVehicleName\":\"13301781203\",\"FWaybill\":\"6757787\",\"FGoods\":\"223434\",\"FAssetID\":\"13301781203\",\"FRouteGUID\":\"42bfae96-cbed-4d2e-8e9f-c1cd4ad0d5df\",\"FRouteName\":\"43534\",\"FCarrier\":\"656546\",\"FDriverGUID\":\"\",\"FDriverName\":\"435435\",\"FDriverPhone\":\"6546\",\"FPlanStartTime\":\"2022-09-22 16:00:00\",\"FPlanEndTime\":\"2022-09-22 16:00:00\",\"FAgentGUID\":\"d6de6745-9b7b-42cd-b624-b4659f5f5ce5\",\"FRouteCode\":\"20220622103851\",\"FVehicleTypeID\":\"\",\"FVehicleImgType\":\"0\",\"FContainerNo\":\"6422f\",\"FCargoDescribe\":\"gfdgd\",\"FConsignee\":\"retgfd\",\"FFinishType\":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 = 'http://cloud.assetscontrols.com:8092/OpenApi/Admin'
data = {
    'FAction': 'AddPublicRouteDeparture',
    'FTokenID': '3acef045-d302-4032-b40a-d9ee6c1519cd',
    'FListRouteDeparture': '[{\"FVehicleName\":\"13301781203\",\"FWaybill\":\"6757787\",\"FGoods\":\"223434\",\"FAssetID\":\"13301781203\",\"FRouteGUID\":\"42bfae96-cbed-4d2e-8e9f-c1cd4ad0d5df\",\"FRouteName\":\"43534\",\"FCarrier\":\"656546\",\"FDriverGUID\":\"\",\"FDriverName\":\"435435\",\"FDriverPhone\":\"6546\",\"FPlanStartTime\":\"2022-09-22 16:00:00\",\"FPlanEndTime\":\"2022-09-22 16:00:00\",\"FAgentGUID\":\"d6de6745-9b7b-42cd-b624-b4659f5f5ce5\",\"FRouteCode\":\"20220622103851\",\"FVehicleTypeID\":\"\",\"FVehicleImgType\":\"0\",\"FContainerNo\":\"6422f\",\"FCargoDescribe\":\"gfdgd\",\"FConsignee\":\"retgfd\",\"FFinishType\":1},{\"FVehicleName\":\"13301781203\",\"FWaybill\":\"6757787\",\"FGoods\":\"223434\",\"FAssetID\":\"13301781203\",\"FRouteGUID\":\"42bfae96-cbed-4d2e-8e9f-c1cd4ad0d5df\",\"FRouteName\":\"43534\",\"FCarrier\":\"656546\",\"FDriverGUID\":\"\",\"FDriverName\":\"435435\",\"FDriverPhone\":\"6546\",\"FPlanStartTime\":\"2022-09-22 16:00:00\",\"FPlanEndTime\":\"2022-09-22 16:00:00\",\"FAgentGUID\":\"d6de6745-9b7b-42cd-b624-b4659f5f5ce5\",\"FRouteCode\":\"20220622103851\",\"FVehicleTypeID\":\"\",\"FVehicleImgType\":\"0\",\"FContainerNo\":\"6422f\",\"FCargoDescribe\":\"gfdgd\",\"FConsignee\":\"retgfd\",\"FFinishType\":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) 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