Brief description:

  • Query Transportation reports by DeviceID or Asset(VehicleName)

Interface version:

Version Number Developer Date of Development Date of Revision
1.0.0 lenny 2024-12-03 2024-12-03

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 (QueryReportRouteDepartureListByFGUIDs )
FGUIDs Required string Vehicle/Device(separate multiple with commas)
FSelectType Required int 1:by Vehicle;0:by Device
FStatus Required int Waybill Status(-2:All; -1:voided;0:Unfinished;1:Completed 2:Expired (Actual arrival time is greater than planned completion time, indicating expiration) 3:Intend(Plan))
FStartTime Required datetime Start time (UTC time)
FEndTime Required datetime End time (UTC time)
FTimeDifferent Required int Time difference in sec. UTC+3 3*3600=10800
FKey Optional string Fuzzy query by waybill number (Declaration No.)
FPageSize Optional int Pagination query Number of records per page
FPageIndex Optional int Pagination query Current page number

Return Example:

When correct, it returns:

{
    "Result": 200,
    "Message": "check token success",
    "FObject": {
        "Table": [
            {
                "FTotalCount": 2
            }
        ],
        "Table1": [
            {
                "FGUID": "fa7cc011-21d5-4c78-bca1-b02871122314",
                "FVehicleGUID": "d7ca53d2-eb4c-4ab9-ba1a-9477becd4563",
                "FVehicleName": "KAA111A",
                "FWaybill": "",
                "FGoods": "",
                "FAssetGUID": "ac305cdc-24d0-4b2b-9581-69bf53fc1235",
                "FAssetID": "3454354353",
                "FRouteGUID": "7ed92857-8770-4351-9904-0d66d0933452",
                "FCarrier": "",
                "FDriverGUID": "00000000-0000-0000-0000-000000000000",
                "FDriverName": "",
                "FDriverPhone": "",
                "FPlanStartTime": "2024-12-03T06:02:00",
                "FActualStartTime": "2024-12-03T06:01:13.937",
                "FPlanEndTime": "2024-12-03T21:00:00",
                "FActualEndTime": null,
                "FStatus": 4,
                "FFinishTime": "2024-12-03T06:02:59.903",
                "FAgentGUID": "0f0f2e76-4733-4388-9242-9ed7db004562",
                "FCreateTime": "2024-12-03T06:00:54.07",
                "FContainerNo": "",
                "FCargoDescribe": "",
                "FConsignee": "",
                "FFinishType": 2,
                "FDepartureType": 0,
                "FPlannedDuration": 30,
                "RowNo": 1,
                "FRouteName": "a-c",
                "FRouteCode": "20241017094717",
                "FAgentName": "KPM Tech Solution",
                "TransportationTime": "451",
                "TransportationMileage": "0",
                "ViewDetails": ""
            } 
        ]
    }
}

Error returns:

//The unique identifier of the company(FGUIDs) passed in is empty, which may be due to incorrect data format.
{
    "Result": 102,
    "Message": "FGUIDs is null",
    "FObject": []
}
//Indicates that the token has expired.
{
    "Result": 104,
    "Message": "token error or timeout",
    "FObject": []
}
//Indicates an abnormal error
{
    "Result": 105,
    "Message": "fail",
    "FObject": null
}

Return Table parameter description:

Parameter Name Type Description
FTotalCount int Total number of pages

Return to Table1 parameter description:

Parameter Name Type Description
FGUID string Unique waybill identifier
FVehicleGUID String Vehicle unique identification
FVehicleName string Vehicle Name(Vehicle License plate number)
FAssetGUID string Unique device identifier
FAssetID string DeviceID
FRouteGUID string Route unique identifier
FRouteName string Route Name
FRouteCode string Route code
FAgentGUID string Unique company identifier
FAgentName string Company Name
FPlanStartTime DateTime PlanStartTime(UTC time)
FPlanEndTime DateTime PlanEndTime(UTC time)
FActualStartTime DateTime ActualStartTime(UTC time)
FActualEndTime DateTime ActualEndTime (UTC time)
FFinishTime DateTime FinishTime(UTC time)
FCreateTime DateTime CreateTime(UTC time)
FWaybill string Waybill Number (Declaration No.)
FGoods string Goods Name
FCarrier string Carrier
FDriverName string DriverName
FDriverPhone string DriverPhone
FContainerNo string ContainerNo
FCargoDescribe string CargoDescribe
FConsignee string Consignee
FFinishType int Completion Rules 0:Complete(Leave destination) 1:Complete(Reach destination) 2:Complete(Unlock in destination)
FDepartureType int Dispatch Type 0:Regular Dispatch 1:Planned Dispatch
FPlannedDuration int Planned order lead time (minutes)
FStatus int Waybill Status(-1:Voided;0:Unfinished;1:Auto-completed 2:Expired 3:Intend(Plan) 4:Manual completion)
TransportationTime string Transportation Time(Total Trip time) .Unit in Seconds
TransportationMileage string Transportation Mileage(Total Trip Mileage) Unit in KM
ViewDetails string Waybill Details Link

Remarks:

  • More error codes returned are as follows:
  • 106:Account Expired
  • 103:Wrong username or password
  • 102:Request parameter error
  • 104:Token expired exception error
  • 105:Indicates an abnormal error

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\": \"QueryReportRouteDepartureListByFGUIDs\", \"FPageSize\": 50, \"FPageIndex\": 1, \"FStatus\": 0, \"FGUIDs\": \"661E7209-C77E-4A54-AFB8-6D956F962BDF\",FSelectType:\"1\",FStartTime:\"2020-08-18 16:00:00\",FEndTime:\"2020-08-25 15:59:59\", \"FTokenID\": \"ec51d691-d9a7-4f74-95a8-1856be2ae741\", \"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\": \"QueryReportRouteDepartureListByFGUIDs\", \"FPageSize\": 50, \"FPageIndex\": 1, \"FStatus\": 0, \"FGUIDs\": \"661E7209-C77E-4A54-AFB8-6D956F962BDF\",FSelectType:\"1\",FStartTime:\"2020-08-18 16:00:00\",FEndTime:\"2020-08-25 15:59:59\", \"FTokenID\": \"ec51d691-d9a7-4f74-95a8-1856be2ae741\", \"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 = 'http://cloud.assetscontrols.com:8092/OpenApi/Admin'
      data = {
        'FAction': 'QueryReportRouteDepartureListByFGUIDs',
        'FTokenID': 'ec51d691-d9a7-4f74-95a8-1856be2ae741',
        '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',
        'FStatus':0,
        'FPageSize':50,
        'FPageIndex':1,
        '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