Brief description:
- Query the Delivery List of company waybill schedules
API Version:
Version | Author | Date Created | Date Updated |
---|---|---|---|
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 | Required | Type | Description |
---|---|---|---|
Content-Type | Yes | string | Request type: application/json |
Request Parameters:
Parameter | Required | Type | Description |
---|---|---|---|
FTokenID | Yes | string | Token ID |
FAction | Yes | string | Method name (QueryDepartureListByFAgentGUID) |
FAgentGUID | No | string | Company unique identifier |
FStatus | Yes | int | Waybill status (0: No departure(not shipped); 1: Departure( shipped); 2: Reached(Arrived); 3: Dispatch Schedule List(Plan)) |
FPageSize | No | int | Page size for pagination |
FPageIndex | No | int | Current page number for pagination |
Example Response:
When the request is successful:
{
"Result": 200,
"Message": "check token success",
"FObject": {
"Table": [
{
"FTotalCount": 2,
"FPlanCount": 0,
"FWaitingCount": 2,
"FRunningCount": 0,
"FFinishCount": 0
}
],
"Table1": [
{
"FGUID": "58a297aa-0703-41f4-95c2-d41440d4631d",
"FVehicleGUID": "c6d3ca9d-ec2f-4ce9-8e54-9c3b1ade194b",
"FVehicleName": "791011001167",
"FWaybill": "20230316-001",
"FGoods": "Daily necessities",
"FAssetGUID": "c4b7730e-f74b-4dee-833b-0128bf5dd7f4",
"FAssetID": "791011001167",
"FRouteGUID": "c5ed320f-5eb8-4e89-91ab-f480060bd427",
"FCarrier": "JT",
"FDriverGUID": "00000000-0000-0000-0000-000000000000",
"FDriverName": "xx",
"FDriverPhone": "885252522",
"FPlanStartTime": "2023-03-16T23:00:00",
"FActualStartTime": null,
"FPlanEndTime": "2023-03-17T00:00:00",
"FActualEndTime": null,
"FContainerNo": "20230316-001",
"FConsignee": "Huo Wanqing",
"FVehicleTypeID": 1,
"FCargoDescribe": "",
"FVehicleImgType": 0,
"FFinishType": 1,
"FDepartureType": 1,
"FPlannedDuration": 30,
"FLocationStatus": 1,
"RowNo": 2,
"FRouteName": "JT-TEST Waybill 02",
"FRouteCode": "20230314-02",
"FAssetTypeID": 1709
}]
}
}
Error Responses:
//Indicates that the unique identifier of the company passed in is empty, which should be a data format issue.
{
"Result": 102,
"Message": "FAgentGUID is null",
"FObject": []
}
//Indicates token expiration or error.
{
"Result": 104,
"Message": "token error or timeout",
"FObject": []
}
//Indicates a general error.
{
"Result": 105,
"Message": "fail",
"FObject": null
}
Note:
- More error codes are returned as follows:
- 106: Account expired.
- 103: Incorrect username or password.
- 102: Request parameter error.
- 104: Token expired or error.
- 105: General error.
Request Example:
Java:
String result = "";
// Request URL
String url = "http://cloud.assetscontrols.com:8092/OpenApi/Admin";
// Request Body - JSON format, it's recommended to pass in an object
String body = "{\"FAction\": \"QueryDepartureListByFAgentGUID\", \"FPageSize\": 50, \"FPageIndex\": 0, \"FStatus\": 0, \"FAgentGUID\": \"661E7209-C77E-4A54-AFB8-6D956F962BDF\", \"FTokenID\": \"ec51d691-d9a7-4f74-95a8-1856be2ae741\", \"FTimeDifferent\": 28800, \"FLanguage\": \"1\"}";
URL realUrl = new URL(url);
// Set the 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");
// A POST request must set the following two lines
conn.setDoOutput(true);
conn.setDoInput(true);
PrintWriter pw = new PrintWriter(conn.getOutputStream());
// Send request parameters
pw.print(body);
// flush the output stream buffer
pw.flush();
// Read URL response using BufferedReader input stream
BufferedReader bufReader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
// Read URL response line by line
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 Body - JSON format, it's recommended to pass in an object
string body = "{\"FAction\": \"QueryDepartureListByFAgentGUID\", \"FPageSize\": 50, \"FPageIndex\": 0, \"FStatus\": 0, \"FAgentGUID\": \"661E7209-C77E-4A54-AFB8-6D956F962BDF\", \"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': 'QueryDepartureListByFAgentGUID',
'FTokenID': 'ec51d691-d9a7-4f74-95a8-1856be2ae741',
'FAgentGUID':'661E7209-C77E-4A54-AFB8-6D956F962BDF',
'FStatus':0,
'FPageSize':50,
'FPageIndex':0,
'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