mirror of
https://github.com/pablorevilla-meshtastic/meshview.git
synced 2026-08-09 18:32:49 +02:00
update api docs
This commit is contained in:
+157
-5
@@ -111,12 +111,29 @@ Returns a list of packets with optional filters.
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### Notes
|
---
|
||||||
- All timestamps (`import_time`, `last_seen`) are returned in ISO 8601 format.
|
|
||||||
- `portnum` is an integer representing the packet type.
|
|
||||||
- `payload` is always a UTF-8 decoded string.
|
|
||||||
|
|
||||||
## 4 Statistics API: GET `/api/stats`
|
## 4. Channels API
|
||||||
|
|
||||||
|
### GET `/api/channels`
|
||||||
|
Returns a list of channels seen in a given time period.
|
||||||
|
|
||||||
|
**Query Parameters**
|
||||||
|
- `period_type` (optional, string): Time granularity (`hour` or `day`). Default: `hour`.
|
||||||
|
- `length` (optional, int): Number of periods to look back. Default: `24`.
|
||||||
|
|
||||||
|
**Response Example**
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"channels": ["LongFast", "MediumFast", "ShortFast"]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 5. Statistics API
|
||||||
|
|
||||||
|
### GET `/api/stats`
|
||||||
|
|
||||||
Retrieve packet statistics aggregated by time periods, with optional filtering.
|
Retrieve packet statistics aggregated by time periods, with optional filtering.
|
||||||
|
|
||||||
@@ -157,3 +174,138 @@ Retrieve packet statistics aggregated by time periods, with optional filtering.
|
|||||||
// more entries...
|
// more entries...
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 6. Edges API
|
||||||
|
|
||||||
|
### GET `/api/edges`
|
||||||
|
Returns network edges (connections between nodes) based on traceroutes and neighbor info.
|
||||||
|
|
||||||
|
**Query Parameters**
|
||||||
|
- `type` (optional, string): Filter by edge type (`traceroute` or `neighbor`). If omitted, returns both types.
|
||||||
|
|
||||||
|
**Response Example**
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"edges": [
|
||||||
|
{
|
||||||
|
"from": 12345678,
|
||||||
|
"to": 87654321,
|
||||||
|
"type": "traceroute"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": 11111111,
|
||||||
|
"to": 22222222,
|
||||||
|
"type": "neighbor"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 7. Configuration API
|
||||||
|
|
||||||
|
### GET `/api/config`
|
||||||
|
Returns the current site configuration (safe subset exposed to clients).
|
||||||
|
|
||||||
|
**Response Example**
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"site": {
|
||||||
|
"domain": "meshview.example.com",
|
||||||
|
"language": "en",
|
||||||
|
"title": "Bay Area Mesh",
|
||||||
|
"message": "Real time data from around the bay area",
|
||||||
|
"starting": "/chat",
|
||||||
|
"nodes": "true",
|
||||||
|
"conversations": "true",
|
||||||
|
"everything": "true",
|
||||||
|
"graphs": "true",
|
||||||
|
"stats": "true",
|
||||||
|
"net": "true",
|
||||||
|
"map": "true",
|
||||||
|
"top": "true",
|
||||||
|
"map_top_left_lat": 39.0,
|
||||||
|
"map_top_left_lon": -123.0,
|
||||||
|
"map_bottom_right_lat": 36.0,
|
||||||
|
"map_bottom_right_lon": -121.0,
|
||||||
|
"map_interval": 3,
|
||||||
|
"firehose_interval": 3,
|
||||||
|
"weekly_net_message": "Weekly Mesh check-in message.",
|
||||||
|
"net_tag": "#BayMeshNet",
|
||||||
|
"version": "2.0.8 ~ 10-22-25"
|
||||||
|
},
|
||||||
|
"mqtt": {
|
||||||
|
"server": "mqtt.bayme.sh",
|
||||||
|
"topics": ["msh/US/bayarea/#"]
|
||||||
|
},
|
||||||
|
"cleanup": {
|
||||||
|
"enabled": "false",
|
||||||
|
"days_to_keep": "14",
|
||||||
|
"hour": "2",
|
||||||
|
"minute": "0",
|
||||||
|
"vacuum": "false"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 8. Language/Translations API
|
||||||
|
|
||||||
|
### GET `/api/lang`
|
||||||
|
Returns translation strings for the UI.
|
||||||
|
|
||||||
|
**Query Parameters**
|
||||||
|
- `lang` (optional, string): Language code (e.g., `en`, `es`). Defaults to site language setting.
|
||||||
|
- `section` (optional, string): Specific section to retrieve translations for.
|
||||||
|
|
||||||
|
**Response Example (full)**
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"chat": {
|
||||||
|
"title": "Chat",
|
||||||
|
"send": "Send"
|
||||||
|
},
|
||||||
|
"map": {
|
||||||
|
"title": "Map",
|
||||||
|
"zoom_in": "Zoom In"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Response Example (section-specific)**
|
||||||
|
Request: `/api/lang?section=chat`
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"title": "Chat",
|
||||||
|
"send": "Send"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 9. Version API
|
||||||
|
|
||||||
|
### GET `/version`
|
||||||
|
Returns version information including semver and git revision.
|
||||||
|
|
||||||
|
**Response Example**
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"version": "2.0.8 ~ 10-22-25",
|
||||||
|
"git_revision": "6416978a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q",
|
||||||
|
"git_revision_short": "6416978"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Notes
|
||||||
|
- All timestamps (`import_time`, `last_seen`) are returned in ISO 8601 format.
|
||||||
|
- `portnum` is an integer representing the packet type.
|
||||||
|
- `payload` is always a UTF-8 decoded string.
|
||||||
|
- Node IDs are integers (e.g., `12345678`).
|
||||||
|
|||||||
+1
-1
@@ -8,6 +8,6 @@ These documents are intended for developers, contributors, and advanced users wh
|
|||||||
|
|
||||||
- [ALEMBIC_SETUP.md](ALEMBIC_SETUP.md) - Database migration setup and management
|
- [ALEMBIC_SETUP.md](ALEMBIC_SETUP.md) - Database migration setup and management
|
||||||
- [TIMESTAMP_MIGRATION.md](TIMESTAMP_MIGRATION.md) - Details on timestamp schema changes
|
- [TIMESTAMP_MIGRATION.md](TIMESTAMP_MIGRATION.md) - Details on timestamp schema changes
|
||||||
- **API Documentation** - REST API endpoints and usage (coming soon)
|
- [API_Documentation.md](API_Documentation.md) - REST API endpoints and usage
|
||||||
|
|
||||||
For initial setup and basic usage instructions, please see the main [README.md](../README.md) in the root directory.
|
For initial setup and basic usage instructions, please see the main [README.md](../README.md) in the root directory.
|
||||||
|
|||||||
Reference in New Issue
Block a user