Skip to content

Commit 90516da

Browse files
committed
Add query parameters and configuration example for Latest Location API
- Document `since` parameter usage. - Add Uptime Kuma monitoring setup steps and accompanying image.
1 parent e7e410a commit 90516da

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

docs/api/latest-location.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ curl https://your-reitti-instance/api/v1/latest-location?token=your-api-token
4646

4747
The endpoint returns a JSON response with information about the latest location data:
4848

49-
```json
49+
```
5050
{
5151
"point": {
5252
"latitude": 53.86329752,
@@ -77,21 +77,29 @@ You can monitor your location tracking reliability using [Uptime Kuma](https://g
7777

7878
1. Add a new monitor in Uptime Kuma, select **JSON Query** as the monitor type.
7979
2. Set the URL to your Reitti instance endpoint, including the API token:
80+
8081
```
8182
https://your-reitti-instance/api/v1/latest-location
8283
```
84+
8385
3. Set the **Headers** field to:
84-
```json
86+
87+
```
8588
{ "X-API-TOKEN": "your-api-token" }
8689
```
90+
8791
4. In the **JSON Query Expression** field, enter the expression that calculates the age of the latest point in seconds:
92+
8893
```
8994
$floor(($toMillis($now()) - $toMillis(point.timestamp))/1000
9095
```
96+
9197
5. Set the **Condition** to **less than** and enter a value that defines your acceptable freshness window. For example, to alert if no fresh location data has arrived in the last 10 minutes:
92-
```
98+
99+
```
93100
< 600
94-
```
101+
```
102+
95103
6. Set your expected check interval (e.g. every 5 minutes) and alerting preferences.
96104

97105
![Uptime Kuma JSON Query configuration](../img/uptime-kuma-check.png)

0 commit comments

Comments
 (0)