API
This tutorial is aimed at software integrators who use the API interface of IPS Tools software as background business functions. Through the API interface, you can obtain the UID, coordinates, power, working status of Anchor and Tag devices, as well as the real-time positioning of the Tag. The data format is JSON, and the interface protocols include MQTT, UDP, webhook, HTTP, etc. The software supports deployment on Ubuntu, Windows, MacOs and other platforms.
1. Data Format: JSON
Targeting Data Example:
{
"data": {
"mapId": 2, // Location floor ID
"pos": [
-3.2616942,
4.3123593,
1.1999172
], // Positioning: x,y,z
"noiseRadius": 0.085815825, // Positioning noise, the larger the value, the lower the confidence
"posVar": [
0.71,
0.62,
0.03
],// Positioning noise in the x, y, and z directions. The larger the value, the lower the confidence.
"time": 1731034496, // Locate the unix timestamp
"vel": [
-0.08,
0.1,
0
], //Speed: x,y,z
"velVar": [
0.13,
0.13,
0.01
], //Velocity noise in the x, y, and z directions. The larger the value, the lower the confidence
"properties": {
"tansmit": "xxxxxxxxxxxx" // Transparent data, base64 encoding
},
"rxAnchorSn": "1e00400007503148", // The strongest received signal corresponds to the base station UID
"rxRssi": -47.235565185546875 // Strongest reception signal
},
"deviceName": "T4", // Device name, unique within the software
"name": "Pos", // Message Type
"uid": "ea221ffdb4fbea42", //Device UID
}
2. Tag Location Data API Configuration Entry
Open the IPS Tool software and follow the steps below to enter the configuration page.
3. MQTT Obtains Tag Location Data
address: {IP or Domain name}:{Interface}
clientId: Client ID, can be empty
topic: Topic name
4. UDP Obtains Tag Positioning Data
address: {IP or Domain name}:{Interface}
5. Webhook Obtains Tag Location Data
URL format: http://{IP or Domain name}:{Interface}/{Custom uri}
http method: POST
6. HTTP to Get Device Status
URL: GET http://localhost:8088/openapi/v1/devices?deviceType=&online=&query=&page=&pageSize=
Query parameters:
Parameter Name | Parameter Type | Parameter Description |
---|---|---|
deviceType | int | Search by device type. Empty means querying all types of devices. 4 means querying Anchor devices. 5 means querying Tag devices. |
online | bool | According to whether to search online, empty means to query all states, false means to query offline devices, true means to query online devices |
query | string | Search by device name prefix or device UID suffix |
page | int | The default pagination number is 1, which means the first page, and so on |
pageSize | int | The default page size is 20, and the maximum is 100 |
响应数据:
{
"code": 0, // 0 indicates success, non-0 indicates failure
"message": "",
"data": {
"records": [
{
"type": 4, // Device type. 4 indicates an Anchor device and 5 indicates a Tag device
"online": false, // Is online
"onlineTime": 1727323909, //Online and offline time. "online" is true for online time, and "online" is false for offline time
"uid": "1b00530007503148", // Device UID
"product": "A01", // Device Model
"coordinate": { // Device coordinates, currently only available on Anchor devices
"coords": [
13.302, // x-coordinate
12.9, // y-coordinate
2.9 // z-coordinate
]
},
"name": "A1" // Device Name
},
{
"type": 5, // Device type. 4 indicates an Anchor device and 5 indicates a Tag device
"online": false, // Is online
"onlineTime": 1730860539, //Online and offline time. "online" is true for online time, and "online" is false for offline time
"uid": "72bc78a7911d836f", // Device UID
"power": 50, // Device battery percentage. Currently only available for Tag devices
"product": "T02", // Device Model
"name": "T5" // Device Name
}
],
"total": 1 // Total number for current search criteria
}
}