Skip to content

Commit 76bc9aa

Browse files
committed
updated docs: api.md
1 parent 3e17bd0 commit 76bc9aa

1 file changed

Lines changed: 25 additions & 1 deletion

File tree

docs/backend-docs/api.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,31 @@ The add farm endpoint also creates an entry on our redis server in the form of `
108108
**NOTE: The above body is only an example and the values need not be equal to the ones present. They must only be equal in data type.**<br>
109109
**NOTE: Please do ensure ownerId is a valid and existing OwnerId for the above request body.**
110110

111-
## 1.4 Notifications
111+
## 1.5 Dashboard
112+
113+
- `api/dashboard/latest?userId={userId}` => Returns real-time sensor data for all animals. Returns latest readings per sensor with heart rate, temperature, and location.
114+
- **Method**: GET;
115+
- **Access**: Secured
116+
- **Response Body**:
117+
```json
118+
{
119+
"latestReadings": [
120+
{
121+
"sensorId": 1,
122+
"animalId": 100,
123+
"heartRate": 85,
124+
"temperature": 38.5,
125+
"xPosition": 3,
126+
"yPosition": 6,
127+
"timestamp": "2026-04-19T10:30:00Z"
128+
}
129+
],
130+
"totalSensors": 5,
131+
"timestamp": 1713607800000
132+
}
133+
```
134+
135+
## 1.6 Notifications
112136

113137
- `api/notif/animal_escape` => Sends a notification to everyone with a matching farm_id of the animal. The request body must be as such:
114138
```json

0 commit comments

Comments
 (0)