This API fetches geofence alerts for a specific device and geofence within the provided start and end time. If no device ID is entered, alerts for all devices under the account will be included, and if no fence ID is entered, alerts for all geofences will be considered.
Request
Authorization
Add parameter in header
x-api-key
Example:
x-api-key: ********************
Query Params
devId
string
optional
Device ID, if no value provided, query all devices under the account
fenceId
string
optional
Fence ID, if no value provided, query all fences under the account
startTime
number
optional
Start time. Format: yyyyMMddHHmmss
Example:
20250208000000
endTime
number
optional
End time. Format: yyyyMMddHHmmss
Example:
20250209000000
pageNo
number
optional
The index number for pagination.
Default:
1
pageSize
number
optional
The maximum records count for pagination
Default:
200
Request samples
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl--location--request GET '/geofence/alerts' \
--header'x-api-key;'
Responses
🟢200成功
application/json
200 response
Body
total
integer
required
Total number of records
Example:
1
pageSize
integer
required
Number of records per page
Example:
200
pageNo
integer
required
Current page number
Example:
1
rows
array [object {6}]
required
Array of alert records
deviceId
string
required
Device ID
Example:
7200000087
alertAction
integer
required
Alert action type
Example:
1
tmTime
string
required
Timestamp of the alert
Example:
20250208014810
acconTime
string
required
Timestamp of the trip start
Example:
20250208014120
fenceId
integer
required
Fence ID
Example:
12345
fenceName
string
required
Fence name
Example:
A Test Fence
totalPage
integer
required
Total number of pages
Example:
1
nextPage
integer
required
Number of the next page
Example:
1
lastPage
boolean
required
Whether this is the last page
Example:
true
firstPage
boolean
required
Whether this is the first page
Example:
true
prePage
integer
required
Number of the previous page
Example:
1
Example
{"total":1,"pageSize":200,"pageNo":1,"rows":[{"deviceId":"7200000087","alertAction":1,"tmTime":"20250208014810","acconTime":"20250208014120","fenceId":12345,"fenceName":"A Test Fence"}],"totalPage":1,"nextPage":1,"lastPage":true,"firstPage":true,"prePage":1}