Brief Description:
- Start analysis of supervision: the waybill starts to be analyzed, and the vehicle status is monitored (the vehicle will become “already started” when it leaves the starting point fence)
- Start supervision: after the Waybil is dispatched, start supervision analysis, that is, the status of the waybill becomes “already started”
- End supervision: end the start-up supervision analysis, that is, the status of the waybill directly becomes “completed”
API Version:
Version | Author | Date | Revision |
---|---|---|---|
1.0.0 | lenny | 2022-10-14 | 2020-10-14 |
Request URL:
- http://icloud.assetscontrols.com:8092/OpenApi/Admin
- https://icloud.assetscontrols.com:3443/OpenApi/Admin
Request Method:
- POST
Request Headers:
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 (SendCommandToRouteAnalysis) |
FAssetID | Yes | string | Device number |
FType | Yes | int | 0: analysis of supervision start 1: start supervision 2: end supervision |
Response Example:
Correct response example:
{
"Result": 200,
"Message":"success",
"FObject": null
}
Error response example:
//indicates that the input parameter is incorrect
{
"Result": 102,
"Message": "param is error",
"FObject": null
}
//indicates that there is an exception error, and the message will be different depending on the parameter condition
{
"Result": 105,
"Message": "start analysis task fail" / "start analysis fail" / "check fail",
"FObject": null
}
//indicates that the device cannot be found
{
"Result": 106,
"Message": "device does not exist",
"FObject": null
}
//indicates that the waybill associated with the device cannot be found
{
"Result": 121,
"Message": "no task found",
"FObject": null
}
//indicates that the analysis has already started or the supervision has started, no need to start again
{
"Result": 135,
"Message": "task started",
"FObject": null
}
//indicates that the task cannot be found during the analysis, and you need to wait for the analysis program to initialize
{
"Result": 134,
"Message": "task is being initialized",
"FObject": null
}
//indicates that analysis needs to be started before starting supervision
{
"Result": 136,
"Message": "analysis task is not started",
"FObject": null
}
Notes:
- More error codes are as follows:
- 103: incorrect username or password
- 102: request parameter error
- 105: indicates that there is an exception error
- 106: indicates that the device number cannot be found
- 121: indicates that the waybill associated with the device cannot be found
- 134: indicates that the task cannot be found during analysis, and you need to wait for the analysis program to initialize
- 135: indicates that the analysis has already started or the supervision has started, no need to start again
- 136: indicates that analysis needs to be started before starting supervision
Request Example:
Java:
String result = "";
// Request path
String url = "http://cloud.assetscontrols.com:8092/OpenApi/Admin";
// Request parameters, in json format, it is recommended to use an object to pass in
String body = "{FAction:\"SendCommandToRouteAnalysis\",FTokenID:\"3acef045-d302-4032-b40a-d9ee6c1519cd\",FAssetID:\"13301781203\",FType: 0}";
URL realUrl = new URL(url);
// Set the properties of the common request
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");
// Sending 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 output stream 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 path
string url = "http://cloud.assetscontrols.com:8092/OpenApi/Admin";
// Request parameters, in json format, it is recommended to use an object to pass in
string body = "{FAction:\"SendCommandToRouteAnalysis\",FTokenID:\"3acef045-d302-4032-b40a-d9ee6c1519cd\",FAssetID:\"13301781203\",FType: 0}";
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': 'SendCommandToRouteAnalysis',
'FTokenID': '3acef045-d302-4032-b40a-d9ee6c1519cd',
'FAssetID':'13301781203',
'FType':'0',
}
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