GeoFence
Description
GET [API_URL]/rpt_geofence
Obtain the entry and exit of the devices in geofences.
Call limit: 1 request every 15 seconds
Cache live time: 300 seconds
Headers
Name
Value
Content-Type
application/json
tenant
logicsat
Authorization
Bearer eyJhbGciOiJIUzI1NiIsInR...
Body
Name
Type
Description
pagination
IPagination
devices
string[]
devices name
geogences
string[]
geofences
idletime
integer
idle time in geofence
startdate*
datetime
from (YYYY-MM-DDTHH:mm:ss)
enddate*
datetime
to (YYYY-MM-DDTHH:mm:ss)
export interface IApiDev_RptGeofenceFilter {
pagination?: IPageInfo;
devices?: string[];
geofences?: string[];
idletime?: number;
startdate: string;
enddate: string;
}Response
export interface IApiDev_RptGeofence {
full_count?: number;
device_name?: string;
people?: string;
datetime_in?: string;
datetime_out?: string;
idle?: number;
geofence?: string;
}[
{
"full_count": "3",
"device_name": "Renault",
"people": null,
"datetime_in": "2024-06-20T00:04:33",
"datetime_out": "2024-06-20 15:34:58",
"idle": 930,
"geofence": "Torres Nuevo Centro"
}
]{
"status": "ERROR",
"message": "General server error. Please verify your data or contact support."
}{
"status": "ERROR",
"message": "Invalid credentials."
}TOO_MANY_REQUESTS
curl --location --request GET '[API_URL]/rpt_geogence' \
--header 'tenant: logicsat' \
--header 'Authorization: Bearer {your_token}' \
--header 'Content-Type: application/json' \
--data '{
"pagination": {
"limit": 1,
"offset": 0
},
"devices": [],
"geofences": [],
"idletime": null,
"startdate": "2024-06-20",
"enddate": "2024-06-22"
}'const axios = require('axios');
const data = {
pagination: {
limit: 1,
offset: 0
},
devices: [],
geofences: [],
idletime: null,
startdate: '2024-06-20',
enddate: '2024-06-22'
};
axios.get('[API_URL]/rpt_geogence', {
headers: {
'tenant': 'logicsat',
'Authorization': 'Bearer {your_token}',
'Content-Type': 'application/json'
},
data: data
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});
import requests
url = '[API_URL]/rpt_geogence'
headers = {
'tenant': 'logicsat',
'Authorization': 'Bearer {your_token}',
'Content-Type': 'application/json'
}
data = {
'pagination': {
'limit': 1,
'offset': 0
},
'devices': [],
'geofences': [],
'idletime': None,
'startdate': '2024-06-20',
'enddate': '2024-06-22'
}
response = requests.get(url, headers=headers, json=data)
print(response.json())
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
namespace Example
{
class Program
{
static async Task Main(string[] args)
{
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "[API_URL]/rpt_geogence");
request.Headers.Add("tenant", "logicsat");
request.Headers.Add("Authorization", "Bearer {your_token}");
request.Headers.Add("Content-Type", "application/json");
var json = "{\"pagination\":{\"limit\":1,\"offset\":0},\"devices\":[],\"geofences\":[],\"idletime\":null,\"startdate\":\"2024-06-20\",\"enddate\":\"2024-06-22\"}";
request.Content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
}
}
require 'net/http'
require 'json'
require 'uri'
uri = URI('[API_URL]/rpt_geogence')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri.path, {
'tenant' => 'logicsat',
'Authorization' => 'Bearer {your_token}',
'Content-Type' => 'application/json'
})
request.body = {
pagination: {
limit: 1,
offset: 0
},
devices: [],
geofences: [],
idletime: nil,
startdate: '2024-06-20',
enddate: '2024-06-22'
}.to_json
response = http.request(request)
puts response.body
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
public class Main {
public static void main(String[] args) {
try {
URL url = new URL("[API_URL]/rpt_geogence");
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("tenant", "logicsat");
con.setRequestProperty("Authorization", "Bearer {your_token}");
con.setRequestProperty("Content-Type", "application/json");
con.setDoOutput(true);
String jsonInputString = "{\"pagination\":{\"limit\":1,\"offset\":0},\"devices\":[],\"geofences\":[],\"idletime\":null,\"startdate\":\"2024-06-20\",\"enddate\":\"2024-06-22\"}";
try(OutputStream os = con.getOutputStream()) {
byte[] input = jsonInputString.getBytes(StandardCharsets.UTF_8);
os.write(input, 0, input.length);
}
int status = con.getResponseCode();
System.out.println("Response Code: " + status);
try(BufferedReader br = new BufferedReader(new InputStreamReader(con.getInputStream(), StandardCharsets.UTF_8))) {
StringBuilder response = new StringBuilder();
String responseLine;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
}
System.out.println(response.toString());
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
Last updated