Brief description:
- Get details of a single asset.
API Version:
Version number | Developer | Date created | Last updated |
---|---|---|---|
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 | Name of the method (QueryAdminVehicleByFGUID) |
FGUID | Yes | string | Vehicle unique identifier |
Response Example:
Successful response:
{
"Result": 200,
"Message": "check token success",
"FObject": [
{
"FGUID": "b8ac068d-b9c2-428f-ac52-5df88d069e5e",
"FAssetID": "2690929719",
"FAssetTypeID": 200,
"FDescription": "",
"FVehicleCode": "89860410102170005799",
"FVIN": "89860410102170005799",
"FAgentGUID": "042032ac-6382-43b6-974f-7ec7f2c0fdfb",
"FAgentName": "柯力二部",
"FCreateTime": "2022-05-31T02:08:11.873",
"FVehicleGUID": "d30bd042-f69a-4f81-ad64-bac303c70980",
"FVehicleName": "2690929719",
"FVehicleTypeID": "1",
"FEngineNumber": "64688",
"FInsuDate": "2023-04-07",
"FPurchaseDate": "2023-04-07"
}
]
}
Error response:
{
"Result": 102,
"Message": "Action is error",
"FObject": []
}
Response Parameters:
Parameter name | Type | Description |
---|---|---|
FGUID | String | Vehicle unique identifier |
FAssetGUID | String | Device unique identifier |
FAssetID | String | Device ID |
FAssetTypeID | Int | Device type |
FVehicleCode | String | Vehicle number |
FDescription | String | Description |
FSIMNumber | String | SIM card number |
FVIN | String | VIN |
FEngineNumber | String | Engine number |
FAgentGUID | String | Company unique identifier |
FAgentName | String | Name of the company it belongs to |
FCreateTime | DateTime | Registration time (UTC time) |
FInsuDate | String | Insurance date |
FPurchaseDate | String | Purchase date |
FVehicleTypeID | Int | License plate type |
Remarks:
- More error codes returned are as follows:
- 104: Token error or expired
- 105: System exception
- 102: Request parameter error
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:\"QueryAdminVehicleByFGUID\",FTokenID:\"3acef045-d302-4032-b40a-d9ee6c1519cd\",FGUID:\"5f2d6752-2ca7-4c4e-909f-7030cefbb72a\"}";
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:\"QueryAdminVehicleByFGUID\",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 / 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': 'QueryAdminVehicleByFGUID',
'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