Brief description:
- Delete waybill schedule
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 (DeleteRouteDepartureByFGUIDs) |
FGUIDs | No | string | List of unique identifiers for waybill schedules, separated by commas (e.g. “aaf42ad9-5b26-4a79-ac1b-be9f1d53423d,aaf42ad9-5b26-4a79-ac1b-be9f1d53423d”) |
Response Example:
Success:
{
"Result": 200,
"Message": "succeed",
"FObject": []
}
Error:
// Empty list of unique identifiers for train schedules provided. This 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 that an exception has occurred
{
"Result": 105,
"Message": "fail",
"FObject": null
}
Remarks:
- Additional error codes are as follows:
- 106: Account has expired
- 103: Incorrect username or password
- 102: Incorrect request parameters
- 104: Token has expired
- 105: Indicates that an exception has occurred.
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 the parameter
String body = "{
\"FAction\": \"DeleteRouteDepartureByFGUIDs\",
\"FGUIDs\": \"aaf42ad9-5b26-4a79-ac1b-be9f1d53423d\",
\"FTokenID\": \"ec51d691-d9a7-4f74-95a8-1856be2ae745\",
\"FTimeDifferent\": 28800,
\"FLanguage\": \"1\"
}";
URL realUrl = new URL(url);
// Set the common properties of the 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 requires the following two lines to be set
conn.setDoOutput(true);
conn.setDoInput(true);
PrintWriter pw = new PrintWriter(conn.getOutputStream());
// Send the request parameters
pw.print(body);
// Flush output stream buffer
pw.flush();
// Define BufferedReader to read the response from the URL
BufferedReader bufReader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
// Read the response from the URL using the BufferedReader input stream
String line;
while ((line = bufReader.readLine()) != null) {
result += line;
}
// The response is in the form of 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 the parameter
string body = "{
\"FAction\": \"DeleteRouteDepartureByFGUIDs\",
\"FGUIDs\": \"aaf42ad9-5b26-4a79-ac1b-be9f1d53423d\",
\"FTokenID\": \"ec51d691-d9a7-4f74-95a8-1856be2ae745\",
\"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 response is in the form of a JSON string
return reader.ReadToEnd();
}
Python:
url = 'http://cloud.assetscontrols.com:8092/OpenApi/Admin'
data = {
'FAction': 'DeleteRouteDepartureByFGUIDs',
'FGUIDs': 'aaf42ad9-5b26-4a79-ac1b-be9f1d53423d',
'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')
# The response is in the form of a JSON string
# json_array = json.loads(page)
return page;
文档更新时间: 2024-12-24 14:06 作者:Jeson