Brief description:
- Get details of a single device
API Version:
Version number | Designer | Date of design | 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 | 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 (QueryAdminAssetByFGUID) |
FGUID | Yes | string | Device unique identifier |
Response Example:
Success response:
{
"Result": 200,
"Message": "check token success",
"FObject": [
{
"FGUID": "b8ac068d-b9c2-428f-ac52-5df88d069e5e",
"FAssetID": "2690929719",
"FAssetTypeID": 200,
"FDescription": "",
"FSIMNumber": "89860410102170005799",
"FIMEI": "89860410102170005799",
"FAgentGUID": "042032ac-6382-43b6-974f-7ec7f2c0fdfb",
"FAgentName": "柯力二部",
"FCreateTime": "2022-05-31T02:08:11.873",
"FVehicleGUID": "d30bd042-f69a-4f81-ad64-bac303c70980",
"FVehicleName": "2690929719",
"FCustomerID": "",
"FAssetTypeName": "JT200KS"
}
]
}
Failure response:
{
"Result": 102,
"Message": "Action is error",
"FObject": []
}
Return Parameter Description:
Parameter name | Type | Explanation |
---|---|---|
FGUID | String | Device unique identifier |
FAssetID | String | Device ID |
FAssetTypeID | Int | Device type ID |
FAssetTypeName | String | Device type name |
FDescription | String | Device description |
FSIMNumber | String | SIM card number |
FIMEI | String | IMEI number |
FAgentGUID | String | Unique identifier of the company to which the device belongs |
FAgentName | String | Name of the company to which the device belongs |
FCreateTime | DateTime | Registration time (UTC) |
FCustomerID | DateTime | Device number |
FVehicleGUID | String | Unique identifier of the vehicle to which the device is installed |
FVehicleName | String | License plate number |
Remarks:
- More return error codes are as follows:
- 104: Token error or expired
- 105: System anomaly
- 102: Request parameter error
Request Example:
Java:
String result = "";
//Request URL
String url = "http://cloud.assetscontrols.com:8092/OpenApi/Admin";
//Request body, in json format. We recommend passing it in as an object.
String body = "{FAction:\"QueryAdminAssetByFGUID\",FTokenID:\"3acef045-d302-4032-b40a-d9ee6c1519cd\",FGUID:\"5f2d6752-2ca7-4c4e-909f-7030cefbb72a\"}";
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");
// Must set the following two lines to send a POST request
conn.setDoOutput(true);
conn.setDoInput(true);
PrintWriter pw = new PrintWriter(conn.getOutputStream());
// Send the request parameter
pw.print(body);
// Flush the 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()));
// Read the response from the URL using a BufferedReader input stream
String line;
while ((line = bufReader.readLine()) != null) {
result += line;
}
//The returned data is in JSON format
return result;
C#:
//Request URL
string url = "http://cloud.assetscontrols.com:8092/OpenApi/Admin";
//Request body, in json format. We recommend passing it in as an object.
string body = "{FAction:\"QueryAdminAssetByFGUID\",FTokenID:\"3acef045-d302-4032-b40a-d9ee6c1519cd\",FGUID:\"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))
{
//The returned data is in JSON format
return reader.ReadToEnd();
}
Python:
url = 'http://cloud.assetscontrols.com:8092/OpenApi/Admin'
data = {
'FAction': 'QueryAdminAssetByFGUID',
'FTokenID': '3acef045-d302-4032-b40a-d9ee6c1519cd',
'FGUID': '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