Brief description:
- Add Assets(Vehicles/Containers)
API Version:
Version Number | Developer | Design Date | Revision Date |
---|---|---|---|
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 (AddAdminVehicleBatch) |
FAgentGUID | Yes | string | Company unique identifier |
FT_AdminVehicleList | Yes | Object | [{“FVehicleName”:Vehicle Box number,”FAssetID”:DeviceID,”FAssetTypeID”:AssetTypeID,”FVIN”:Vehicle Identification Number,”FEngineNumber”:Engine Number,”FVehicleTypeID”:Vehicle Type,”FInsuDate”:Insurance Date,”FPurchaseDate”:Purchase Date,”FDescription”:Description},,,] |
Note:
below three parameters must be inputed in FT_AdminVehicleList field.
“FVehicleName”:Vehicle Box number,”FAssetID”:DeviceID,”FAssetTypeID”:AssetTypeID
e.g.
{
'FAction': 'AddAdminVehicleBatch',
'FTokenID': 'xxxxxx-4e0d-4df9-89c7-xxxxxxxxxxx',
'FAgentGUID': 'xxxxxx-5b56-4eab-8254-xxxxxxxxxxx',
'FT_AdminVehicleList': [{"FVehicleName":"vehiclename8052401023","FAssetID":"8052401023","FAssetTypeID":"3701","FVIN":"","FEngineNumber":"","FVehicleTypeID":1,"FInsuDate":"2024-3-9 00:00:00","FPurchaseDate":"2024-3-9 00:00:00","FDescription":""}]
}
Device type:
ID | DeviceModel |
---|---|
100 | JTR100 |
201 | JT301A |
400 | GP4000 |
500 | JT300B |
501 | JT704-04 |
502 | JT300B-04 |
503 | JT300D-02 |
504 | JT300D-04 |
551 | JT300DB |
552 | GP2000 |
553 | GP7000 |
600 | GP6000 |
601 | GP6000F |
602 | JT600C |
700 | JT700DT |
701 | JT701 |
702 | JT702 |
703 | JT703 |
704 | JT704 |
705 | JT705 |
706 | JT706 |
707 | JT707A |
709 | JT709 |
802 | JT802 |
808 | JT/T808 |
1002 | RTCC |
1010 | ConcoxTrack |
1011 | ConcoxTrack(MQTT) |
1020 | Skycniot(GT60) |
1021 | Skycniot(TX60) |
1030 | MeiTrack |
1040 | Queclink |
1050 | Eelink |
1060 | EasyTrack |
1070 | CanTrack |
1080 | TopTen |
1090 | KHDTrack |
1100 | BiidiWatch |
1110 | SeeWord(S208) |
1111 | SeeWord(S112U) |
1120 | AnyTrack |
1130 | HCIOT |
1140 | JTS6SA |
1150 | AOVX-A/G |
1151 | AOVX-V |
1160 | Teltonika |
1170 | JT300T1 |
1200 | MiWiTrack |
1301 | JT301B |
1600 | eLock |
1701 | JT701-TRA |
1704 | JT704H |
1705 | JT705A |
1707 | JT707B |
1709 | JT709A |
1808 | CB-2019 |
2000 | UDP |
2301 | JT301C |
2701 | JT701D(MQTT) |
2705 | JT705A_RH |
2707 | JT707C |
2709 | JT709B |
2808 | JT/T 808-2019 |
3301 | JT301D |
3701 | JT701D |
3709 | JT709C |
4701 | Vietnam701 |
4709 | JT709C(DMP) |
5701 | JT701D_BLE |
5709 | JT709N |
6701 | JT701(HWIOT) |
6709 | JT709C(MQTT) |
Response Example:
Returned correctly:
{
"Result": 200,
"Message": "check token success",
"FObject": []
}
Returned incorrectly:
{
"Result": 102,
"Message": "Action is error",
"FObject": []
}
{
"Result": 107,
"Message": "4564844,654564",
"FObject": []
}
Return Parameter Description:
Parameter Name | Type | Description |
---|---|---|
Note:
- More returned error codes are as follows:
- 104: Token error or expired
- 105: System exception
- 102: Request parameter error
- 106: There is an empty vehicle box number
- 107: There is a vehicle box number that already exists
Request Example:
Java:
String result = "";
//Request path
String url = "http://cloud.assetscontrols.com:8092/OpenApi/Admin";
//Request parameters, json format parameters, it is recommended to use objects to pass in
String body = "{FAction:\"AddAdminVehicleBatch\",FTokenID:\"3acef045-d302-4032-b40a-d9ee6c1519cd\",FAgentGUID:\"3acef045-d302-4032-b40a-d9ee6c1519cd\",FT_AdminVehicleList:\"[{"FVehicleName":"43564565343","FAssetID":"8052409098","FAssetTypeID":"3701","FVIN":"","FEngineNumber":"","FVehicleTypeID":1,"FInsuDate":"2023-4-6 00:00:00","FPurchaseDate":"2023-4-6 00:00:00","FDescription":"4435"},...]";
URL realUrl = new URL(url);
// Set the general 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 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 cache
pw.flush();
// Define BufferedReader input stream to read URL response
BufferedReader bufReader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
// Define BufferedReader input stream to read URL response
String line;
while ((line = bufReader.readLine()) != null) {
result += line;
}
return result;
C#:
// Request path
string url = "http://cloud.assetscontrols.com:8092/OpenApi/Admin";
// Request parameters, in JSON format. It is recommended to pass in an object.
string body = "{FAction:\"AddAdminVehicleBatch\",FTokenID:\"3acef045-d302-4032-b40a-d9ee6c1519cd\",FAgentGUID:\"3acef045-d302-4032-b40a-d9ee6c1519cd\",FT_AdminVehicleList:\"[{"FVehicleName":"43564565343","FAssetID":"8052409098","FAssetTypeID":"3701","FVIN":"","FEngineNumber":"","FVehicleTypeID":1,"FInsuDate":"2023-4-6 00:00:00","FPurchaseDate":"2023-4-6 00:00:00","FDescription":"4435"},...]\"";
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 a JSON string
return reader.ReadToEnd();
}
Python:
url = 'http://cloud.assetscontrols.com:8092/OpenApi/Admin'
data = {
'FAction': 'AddAdminVehicleBatch',
'FTokenID': '3acef045-d302-4032-b40a-d9ee6c1519cd',
'FAgentGUID': '3acef045-d302-4032-b40a-d9ee6c1519cd',
'FT_AdminVehicleList': '[{"FVehicleName":"43564565343","FAssetID":"8052409098","FAssetTypeID":"3701","FVIN":"","FEngineNumber":"","FVehicleTypeID":1,"FInsuDate":"2023-4-6 00:00:00","FPurchaseDate":"2023-4-6 00:00:00","FDescription":"4435"},...]'
}
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-03-28 15:53 作者:Jeson