Brief Description:
- Delete assets
API Version:
Version number | Developer | Date of development | Date of revision |
---|---|---|---|
2.0.0 | Lenny | 2023-04-07 | - |
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 | Explanation |
---|---|---|---|
Content-Type | Yes | string | Request type: application/json |
Request Parameters:
Parameter Name | Required | Type | Explanation |
---|---|---|---|
FTokenID | Yes | string | Token ID |
FAction | Yes | string | Method name (DeleteAdminVehicle) |
FGUIDs | Yes | string | Unique identifier of the vehicle, multiple vehicles separated by commas |
Return Example:
Returned correctly:
{
"Result": 200,
"Message": "check token success",
"FObject": []
}
Returned with an error:
{
"Result": 102,
"Message": "Action is error",
"FObject": []
}
Return Parameters Description:
Parameter Name | Type | Explanation |
---|---|---|
Note:
- More return error codes are as follows:
- 104: Token error or expiration
- 105: System exception
- 102: Request parameter error
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 parameters.
String body = "{FAction:\"DeleteAdminVehicle\",FTokenID:\"3acef045-d302-4032-b40a-d9ee6c1519cd\",FGUIDs:\"5f2d6752-2ca7-4c4e-909f-7030cefbb72a,5f2d6752-2ca7-4c4e-909f-7030cefbb72a\"}";
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");
// Send POST request, must set the following two lines
conn.setDoOutput(true);
conn.setDoInput(true);
PrintWriter pw = new PrintWriter(conn.getOutputStream());
// Send the request parameters
pw.print(body);
// Flush the output stream buffer
pw.flush();
// Define a BufferedReader input stream to read the URL response
BufferedReader bufReader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
// Define a BufferedReader input stream to read the 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, use JSON format and pass in an object
string body = "{FAction:\"DeleteAdminVehicle\",FTokenID:\"3acef045-d302-4032-b40a-d9ee6c1519cd\",FGUIDs:\"5f2d6752-2ca7-4c4e-909f-7030cefbb72a,5f2d6752-2ca7-4c4e-909f-7030cefbb72a\"}";
Encoding encoding = Encoding.UTF8;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
// Request method (POST or 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))
{
// Returns a JSON string
return reader.ReadToEnd();
}
Python:
url = 'http://cloud.assetscontrols.com:8092/OpenApi/Admin'
data = {
'FAction': 'DeleteAdminVehicle',
'FTokenID': '3acef045-d302-4032-b40a-d9ee6c1519cd',
'FGUIDs': '5f2d6752-2ca7-4c4e-909f-7030cefbb72a,5f2d6752-2ca7-4c4e-909f-7030cefbb72a'
}
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;
文档更新时间: 2023-12-01 10:15 作者:Jeson