Brief description:
- Query all fence group information under the company
Interface version:
Version | Developer | Date of development | Date of revision |
---|---|---|---|
1.0.0 | lenny | 2022-09-22 | 2020-09-22 |
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 (QueryGISFenceType ) |
FAgentGUID | Yes | string | Company unique identifier |
Return example:
Returned correctly:
{
"Result": 200,
"Message":"success",
"FObject": [ {
"FGUID": "df0f8ab2-742e-448b-9c5e-088f88e996d5",
"FIcon": "6",
"FName": "运输路线",
"FStrokeColor": "rgba(53, 106, 195, 0.8)",
"FFillColor": "rgba(53, 106, 195, 0.4)"
}]
}
Returned incorrectly:
// Indicates that FAgentGUID is null, which should be a data format error
{
"Result": 102,
"Message": "FAgentGUID is null",
"FObject": []
}
// Indicates that there is an exception error
{
"Result": 105,
"Message": "fail",
"FObject": []
}
Response Parameters:
Parameter | Type | Description |
---|---|---|
FGUID | string | Fence group unique identifier |
FIcon | string | Icon |
FName | string | Fence group name |
FStrokeColor | string | Border color |
FFillColor | string | Fill color |
Remarks:
- More error codes are as follows:
- 102: Request parameter error
- 104: Token expired
- 105: Indicates an exception 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 object input
String body = "{
\"FAction\": \"QueryGISFenceType\",
\"FAgentGUID\": \"661e7209-c77e-4a54-afb8-6d956f962bdf\",
\"FTokenID\": \"ec51d691-d9a7-4f74-95a8-1856be2ae745\",
\"FTimeDifferent\": 28800,
\"FLanguage\": \"1\"
}";
URL realUrl = new URL(url);
// Set 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 these two lines to send a POST request
conn.setDoOutput(true);
conn.setDoInput(true);
PrintWriter pw = new PrintWriter(conn.getOutputStream());
// Send request parameters
pw.print(body);
// Flush the output stream buffer
pw.flush();
// Define the BufferedReader input stream to read the URL response
BufferedReader bufReader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
// Define the 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 path
string url = "http://cloud.assetscontrols.com:8092/OpenApi/Admin";
//Request parameters, in JSON format, it is recommended to use object input
string body = "{
\"FAction\": \"QueryGISFenceType\",
\"FAgentGUID\": \"661e7209-c77e-4a54-afb8-6d956f962bdf\",
\"FTokenID\": \"ec51d691-d9a7-4f74-95a8-1856be2ae745\",
\"FTimeDifferent\": 28800,
\"FLanguage\": \"1\"
}";
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': 'QueryGISFenceType',
'FAgentGUID': '661e7209-c77e-4a54-afb8-6d956f962bdf',
'FTokenID': 'ec51d691-d9a7-4f74-95a8-1856be2ae745',
'FTimeDifferent': 28800,
'FLanguage': '1'
}
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')
# The returned value is a JSON string.
return page;
文档更新时间: 2023-12-01 10:17 作者:刘家帅