Brief Description:
- Sublock list
API Version:
Version | Author | Date | Revision Date |
---|---|---|---|
1.0.0 | lenny | 2023-09-07 | - |
Request URL:
- http://icloud.assetscontrols.com:8092/OpenApi/Instruction
- https://icloud.assetscontrols.com:3443/OpenApi/Instruction
Request Method:
- POST
Request Headers:
Parameter | Required | Type | Description |
---|---|---|---|
Content-Type | Yes | string | Request type: application/json |
Request Parameters:
Parameter | Required | Type | Description |
---|---|---|---|
FTokenID | Yes | string | Token ID |
FAction | Yes | string | Method name (QuerySubAssetInfoByFAssetGUID) |
FAssetGUID | Yes | string | Device unique identifier |
FLanguage | Yes | int | 0: English; 1: Chinese |
Response Example:
Successful Response:
{
"Result": 200,
"Message": "check token success",
"FObject": [
{
"FGUID": "8846d981-a61f-455d-94fc-33c64416ff7a",
"FAssetGUID": "2d3d4041-dc5f-4a50-8c6a-8aac15835bf0",
"FAssetID": "8052400008",
"FAssetTypeID": 3701,
"FSubAssetName": "JT709",
"FSubAssetID": "E0171E0366",
"FIndex": 9,
"FDateTime": "2023-09-07T07:03:05Z",
"FLockStatus": 0,
"FLockRope": 0,
"FOpenIns": 0,
"FPower": 93,
"FBle": 1,
"FSensorType": 4,
"FStatusJson": "{\"lockRope\":0,\"gateway\":0}",
"FEvent": 6
}
]
}
Error Response:
{
"Result": 102,
"Message": "Action is error",
"FObject": []
}
Response Parameter Description:
Parameter | Type | Description |
---|---|---|
FGUID | String | Sublocks are uniquely identified |
FAssetGUID | String | Unique identifier of the host |
FAssetID | String | Host ID |
FAssetTypeID | Int | Host type identifier |
FSubAssetName | String | Sublock name |
FSubAssetID | String | Sublock device ID |
FIndex | Int | Configured submachine number |
FDateTime | String | Last update time |
FLockStatus | Int | Lock status (0: locked, 1: unlocked) |
FLockRope | Int | Lock rope (0: closed, 1: opened) |
FOpenIns | Int | Unlock command execution status (0: not executed, 1: executed) |
FPower | Int | Power level |
FBle | Int | Whether supports Bluetooth (1: supported, 0: not supported) |
FSensorType | Int | Submachine type (1: JT126; 4: JT709; 5: JT801; 6: JT802) |
FStatusJson | String | Extended information |
FEvent | Int | Event type |
FStatusJson
Parameter | Type | Description |
---|---|---|
lockMotor | Int | Motor status (0: motor off, 1: motor on) |
lockKnob | Int | Knob status (0: closed, 1: open) |
lockValve | Int | Valve status (0: closed, 1: open) |
structuralDisassembly | Int | Structural disassembly status (0: not disassembled, 1: disassembled) |
bottomDisassembly | Int | Bottom disassembly status (0: not disassembled, 1: disassembled) |
emergencyKey | Int | Emergency key status (0: sealed, 1: enabled) |
*FEvent *
State Value | Description |
---|---|
0 | Locking Event |
1 | Bluetooth Unlock Event |
2 | Open Rear Cover Event |
3 | Remote Unlock Event |
4 | Lock Cut Alarm |
5 | Key Wake Up Event |
6 | Heartbeat Event |
7 | Charging Wake Up Event |
8, 20 | Pull Lock Rope Event |
9 | RFID Unlock Event |
10 | Unauthorized Card Alert |
14 | Slave Signal Lost Event |
15 | Valve Close Event |
16 | Valve Open Event |
17 | Low Battery Alert |
18 | Tamper Alert |
19 | Electronic Compartment Disassembled Event |
21 | Insert Lock Rope Event |
22 | Bluetooth Connection Wake Up Event |
23 | Emergency Compartment Open Alert |
24 | Emergency Compartment Close Alert |
25 | Abnormal Valve Open Alert |
26 | Lock Pin Close Event |
27 | Lock Pin Open Event |
30 | NFC Trigger |
-1 | Unknown Event |
Remarks:
- More error codes for response:
- 104: Token error or expired
- 105: Exception error
- 102: Request parameter error
sample request:
Java:
String result = "";
String url = "http://cloud.assetscontrols.com:8092/OpenApi/Instruction";
String body = "{\n\t\"FAction\": \"QuerySubAssetInfoByFAssetGUID\",\n\t\"FAssetGUID\": \"2d3d4041-dc5f-4a50-8c6a-8aac15835bf0\",\n\t\"FTokenID\": \"3acef045-d302-4032-b40a-d9ee6c1519cd\",\n\t\"FLanguage\": \"1\"\n}";
URL realUrl = new URL(url);
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");
conn.setDoOutput(true);
conn.setDoInput(true);
PrintWriter pw = new PrintWriter(conn.getOutputStream());
pw.print(body);
pw.flush();
BufferedReader bufReader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String line;
while ((line = bufReader.readLine()) != null) {
result += line;
}
return result;
C#:
string url = "http://cloud.assetscontrols.com:8092/OpenApi/Instruction";
String body = "{\n\t\"FAction\": \"QuerySubAssetInfoByFAssetGUID\",\n\t\"FAssetGUID\": \"2d3d4041-dc5f-4a50-8c6a-8aac15835bf0\",\n\t\"FTokenID\": \"3acef045-d302-4032-b40a-d9ee6c1519cd\",\n\t\"FLanguage\": \"1\"\n}";
Encoding encoding = Encoding.UTF8;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
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))
{
return reader.ReadToEnd();
}
Python:
url = 'http://cloud.assetscontrols.com:8092/OpenApi/Instruction'
data = '{ "FAction": "QuerySubAssetInfoByFAssetGUID", "FAssetGUID": "2d3d4041-dc5f-4a50-8c6a-8aac15835bf0", "FTokenID": "3acef045-d302-4032-b40a-d9ee6c1519cd",\n\t\"FLanguage\": \"1\"\n }'
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:12 作者:刘家帅