{"info":{"_postman_id":"71c60d66-5a1e-4f51-8fa6-84974d8c6bc3","name":"HydroSense Monitor (Staging)","description":"<html><head></head><body><p>Backend API</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"21567880","collectionId":"71c60d66-5a1e-4f51-8fa6-84974d8c6bc3","publishedId":"2sB2x2Ju3M","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2025-06-05T11:13:27.000Z"},"item":[{"name":"Submit Sensor Reading - Healthy pH","id":"cc35eb4b-0190-4515-a32c-b6ec45815b32","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"unitId\": \"24\",\n    \"timestamp\": \"1781592228\",\n    \"readings\": {\n      \"pH\": 6.5,\n      \"temp\": 22.5,\n      \"ec\": 1.8\n    }\n  }","options":{"raw":{"language":"json"}}},"url":"https://hydro-sense-monitor.3jn045m1dbz0y.eu-central-1.cs.amazonlightsail.com/api/v1/sensor","description":"<p>Submit sensor readings from a hydroponic unit with pH levels within the healthy range (5.5-7.0).</p>\n<p><strong>Returns:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"OK\",\n    \"classification\": \"Healthy\"\n }\n\n</code></pre>\n","urlObject":{"path":["sensor"],"host":["https://hydro-sense-monitor.3jn045m1dbz0y.eu-central-1.cs.amazonlightsail.com/api/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"cc35eb4b-0190-4515-a32c-b6ec45815b32"},{"name":"Submit Sensor Reading - Needs Attention (Low pH)","id":"bd41d3a9-a3c0-41cf-9978-da81815b0b90","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"unitId\": \"525\",\n    \"timestamp\": \"1781592228\",\n    \"readings\": {\n      \"pH\": 5.0,\n      \"temp\": 20.0,\n      \"ec\": 1.5\n    }\n}","options":{"raw":{"language":"json"}}},"url":"https://hydro-sense-monitor.3jn045m1dbz0y.eu-central-1.cs.amazonlightsail.com/api/v1/sensor","description":"<p>Submit sensor readings with pH below 5.5, triggering a <strong><code>Needs Attention</code></strong> classification.</p>\n<p><strong>Returns:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"OK\",\n    \"classification\": \"Needs Attention\"\n}\n\n</code></pre>\n","urlObject":{"path":["sensor"],"host":["https://hydro-sense-monitor.3jn045m1dbz0y.eu-central-1.cs.amazonlightsail.com/api/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"bd41d3a9-a3c0-41cf-9978-da81815b0b90"},{"name":"Submit Sensor Reading - Needs Attention (High pH)","id":"9d6fa223-91fc-4ff0-bb62-917992e68be2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"unitId\": \"208\",\n    \"timestamp\": \"1781592228\",\n    \"readings\": {\n      \"pH\": 8.5,\n      \"temp\": 25.0,\n      \"ec\": 2.0\n    }\n}","options":{"raw":{"language":"json"}}},"url":"https://hydro-sense-monitor.3jn045m1dbz0y.eu-central-1.cs.amazonlightsail.com/api/v1/sensor","description":"<p>Submit sensor readings with pH above 7.0, triggering a <code>Needs Attention</code> classification.</p>\n<p><strong>Returns:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"OK\",\n    \"classification\": \"Needs Attention\"\n}\n\n</code></pre>\n","urlObject":{"path":["sensor"],"host":["https://hydro-sense-monitor.3jn045m1dbz0y.eu-central-1.cs.amazonlightsail.com/api/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"9d6fa223-91fc-4ff0-bb62-917992e68be2"},{"name":"Get Alerts for Specific Unit","id":"fffa663c-6b23-4c7a-b174-e169e71702cd","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"https://hydro-sense-monitor.3jn045m1dbz0y.eu-central-1.cs.amazonlightsail.com/api/v1/alerts?unitId=test-unit-123","description":"<p>Retrieve the last 10 <code>Needs Attention</code> readings for a specific hydroponic unit.</p>\n<p><strong>Returns:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"unitId\": \"test-unit-123\",\n    \"alerts\": [\n      {\n        \"unitId\": \"test-unit-123\",\n        \"timestamp\": \"2025-01-06T10:30:00Z\",\n        \"readings\": {\n          \"pH\": 5.2,\n          \"temp\": 22.5,\n          \"ec\": 1.8\n        },\n        \"classification\": \"Needs Attention\"\n      }\n    ],\n    \"unitExists\": true,\n    \"totalReadings\": 150\n}\n\n</code></pre>\n","urlObject":{"path":["alerts"],"host":["https://hydro-sense-monitor.3jn045m1dbz0y.eu-central-1.cs.amazonlightsail.com/api/v1"],"query":[{"key":"unitId","value":"test-unit-123"}],"variable":[]}},"response":[],"_postman_id":"fffa663c-6b23-4c7a-b174-e169e71702cd"},{"name":"Get Alerts for Non-Existent Unit","id":"b2c45c90-3c8f-4ff4-87ad-a25fd09dad3b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"https://hydro-sense-monitor.3jn045m1dbz0y.eu-central-1.cs.amazonlightsail.com/api/v1/alerts?unitId=unreal","description":"<p>Demonstrates the API's behavior when querying alerts for a unit that has never submitted readings.</p>\n<p><strong>Returns:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"unitId\": \"unreal\",\n    \"alerts\": [],\n    \"unitExists\": false,\n    \"totalReadings\": 0\n}\n\n</code></pre>\n","urlObject":{"path":["alerts"],"host":["https://hydro-sense-monitor.3jn045m1dbz0y.eu-central-1.cs.amazonlightsail.com/api/v1"],"query":[{"key":"unitId","value":"unreal"}],"variable":[]}},"response":[],"_postman_id":"b2c45c90-3c8f-4ff4-87ad-a25fd09dad3b"},{"name":"Get Units Overview","id":"0f55c07d-0859-4d9e-a52b-7203f1a5b416","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://hydro-sense-monitor.3jn045m1dbz0y.eu-central-1.cs.amazonlightsail.com/api/v1/units","description":"<p>Retrieve a view of all hydroponic units with their current health status.</p>\n<p><strong>Returns:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"units\": [\n      {\n        \"unitId\": \"unit-456\",\n        \"lastReading\": {\n          \"unitId\": \"unit-456\",\n          \"timestamp\": \"2025-01-06T12:00:00Z\",\n          \"readings\": {\n            \"pH\": 8.5,\n            \"temp\": 25.0,\n            \"ec\": 2.0\n          },\n          \"classification\": \"Needs Attention\"\n        },\n        \"totalReadings\": 245,\n        \"alertsCount\": 42,\n        \"healthStatus\": \"critical\"\n      }\n    ],\n    \"totalUnits\": 5\n}\n\n</code></pre>\n","urlObject":{"path":["units"],"host":["https://hydro-sense-monitor.3jn045m1dbz0y.eu-central-1.cs.amazonlightsail.com/api/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"0f55c07d-0859-4d9e-a52b-7203f1a5b416"},{"name":"Missing Unit ID Parameter (Error Case)","id":"899d6032-a6f7-4853-bda6-061cb453b131","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"https://hydro-sense-monitor.3jn045m1dbz0y.eu-central-1.cs.amazonlightsail.com/api/v1/alerts","description":"<p>Demonstrates error handling when the required <code>unitId</code> query parameter is missing.</p>\n<p><strong>Returns:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"detail\": \"unitId query parameter is required and cannot be empty\"\n}\n\n</code></pre>\n<p><strong>Status Code:</strong> 400 Bad Request</p>\n","urlObject":{"path":["alerts"],"host":["https://hydro-sense-monitor.3jn045m1dbz0y.eu-central-1.cs.amazonlightsail.com/api/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"899d6032-a6f7-4853-bda6-061cb453b131"},{"name":"Invalid pH Value (Validation Error)","id":"377d0408-fcf3-4602-8af8-2b34fd2f244a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"unitId\": \"796\",\n    \"timestamp\": \"1781592228\",\n    \"readings\": {\n      \"pH\": 15.0,\n      \"temp\": 22.0,\n      \"ec\": 1.5\n    }\n}","options":{"raw":{"language":"json"}}},"url":"https://hydro-sense-monitor.3jn045m1dbz0y.eu-central-1.cs.amazonlightsail.com/api/v1/sensor","description":"<p>Demonstrates validation error when pH is outside the chemically possible range (0-14).</p>\n<p><strong>Returns:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"detail\": \"pH value 15.0 is outside valid range (0-14)\"\n}\n\n</code></pre>\n<p><strong>Status Code:</strong> 422 Unprocessable Entity</p>\n","urlObject":{"path":["sensor"],"host":["https://hydro-sense-monitor.3jn045m1dbz0y.eu-central-1.cs.amazonlightsail.com/api/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"377d0408-fcf3-4602-8af8-2b34fd2f244a"},{"name":"Negative EC Value (Validation Error)","id":"a29d7c88-dca9-4aa1-b8f3-2a482371b930","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"unitId\": \"526\",\n    \"timestamp\": \"1781592228\",\n    \"readings\": {\n      \"pH\": 6.5,\n      \"temp\": 22.0,\n      \"ec\": -1.5\n    }\n}","options":{"raw":{"language":"json"}}},"url":"https://hydro-sense-monitor.3jn045m1dbz0y.eu-central-1.cs.amazonlightsail.com/api/v1/sensor","description":"<p>Demonstrates validation error for physically impossible negative electrical conductivity.</p>\n<p><strong>Returns:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"detail\": \"EC value -1.5 cannot be negative\"\n}\n\n</code></pre>\n<p><strong>Status Code:</strong> 422 Unprocessable Entity</p>\n","urlObject":{"path":["sensor"],"host":["https://hydro-sense-monitor.3jn045m1dbz0y.eu-central-1.cs.amazonlightsail.com/api/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"a29d7c88-dca9-4aa1-b8f3-2a482371b930"},{"name":"Temperature Outside Valid Range","id":"630e4ae1-abd1-439a-8357-963c4940da7d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"unitId\": \"36\",\n    \"timestamp\": \"2025-06-01T10:00:00Z\",\n    \"readings\": {\n      \"pH\": 7.5,\n      \"temp\": 70.0,\n      \"ec\": 1.5\n    }\n}","options":{"raw":{"language":"json"}}},"url":"https://hydro-sense-monitor.3jn045m1dbz0y.eu-central-1.cs.amazonlightsail.com/api/v1/sensor","description":"<p>Demonstrates validation error when temperature exceeds reasonable hydroponic operating range (-10°C to 60°C).</p>\n<p><strong>Returns:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"detail\": \"Temperature 70.0°C is outside valid range (-10 to 60°C)\"\n}\n\n</code></pre>\n<p><strong>Status Code:</strong> 422 Unprocessable Entity</p>\n","urlObject":{"path":["sensor"],"host":["https://hydro-sense-monitor.3jn045m1dbz0y.eu-central-1.cs.amazonlightsail.com/api/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"630e4ae1-abd1-439a-8357-963c4940da7d"},{"name":"Future Timestamp (Validation Error)","id":"a4dec0a2-748c-44cf-8b32-917f8fa3f522","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"unitId\": \"860\",\n    \"timestamp\": \"2025-07-03T10:30:00Z\",\n    \"readings\": {\n      \"pH\": 7.5,\n      \"temp\": 7.0,\n      \"ec\": 1.5\n    }\n}","options":{"raw":{"language":"json"}}},"url":"https://hydro-sense-monitor.3jn045m1dbz0y.eu-central-1.cs.amazonlightsail.com/api/v1/sensor","description":"<p>Demonstrates validation error when sensor reports a future timestamp, indicating clock synchronization issues.</p>\n<p><strong>Returns:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"detail\": \"Timestamp cannot be in the future (current time in Israel: 2025-01-06T15:30:00+02:00)\"\n}\n\n</code></pre>\n<p><strong>Status Code:</strong> 400 Bad Request</p>\n","urlObject":{"path":["sensor"],"host":["https://hydro-sense-monitor.3jn045m1dbz0y.eu-central-1.cs.amazonlightsail.com/api/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"a4dec0a2-748c-44cf-8b32-917f8fa3f522"}],"event":[{"listen":"prerequest","script":{"id":"46bcb159-4441-48cf-8915-1bf72e2da063","type":"text/javascript","packages":{},"exec":[""]}},{"listen":"test","script":{"id":"8eb67d1c-02cc-4c26-8687-6e55197f22fe","type":"text/javascript","packages":{},"exec":[""]}}],"variable":[{"key":"base_url","value":"https://hydro-sense-monitor.3jn045m1dbz0y.eu-central-1.cs.amazonlightsail.com","type":"string"},{"key":"api_path","value":"/api/v1","type":"string"}]}