{"info":{"_postman_id":"1df62209-1fa9-4e45-a63c-9981fb6bcbfc","name":"CSA_Smart_Campus_API","description":"<html><head></head><body><h1 id=\"csa-smart-campus-api\">CSA Smart Campus API</h1>\n<p>This collection tests the <strong>Smart Campus REST API</strong> (<code>api/v1</code>), a backend service for managing IoT infrastructure across a smart campus environment. It covers the full lifecycle of campus resources including rooms, sensors, and sensor readings.</p>\n<h2 id=\"resource-domains\">Resource Domains</h2>\n<ul>\n<li><p><strong>Rooms</strong> – Create, retrieve, and delete campus rooms</p>\n</li>\n<li><p><strong>Sensors</strong> – Register and filter sensors by type (Temperature, CO2, Occupancy)</p>\n</li>\n<li><p><strong>Sensor Readings</strong> – Post and retrieve time-series readings per sensor</p>\n</li>\n</ul>\n<h2 id=\"operations-covered\">Operations Covered</h2>\n<ul>\n<li><p><strong>CRUD</strong> operations across all resource types</p>\n</li>\n<li><p><strong>Error handling</strong> – duplicate entries, missing fields, invalid IDs, content-type mismatches, and 500-level errors</p>\n</li>\n<li><p><strong>Edge cases</strong> – empty collections, maintenance-state sensors, non-existent resources, and filtered queries with no matches</p>\n</li>\n</ul>\n<h2 id=\"collection-structure\">Collection Structure</h2>\n<p>Organized into 5 sequential parts: <em>Discovery → Rooms → Sensors → Sensor Readings → Errors</em>, reflecting a logical API exploration and validation workflow.</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"CSA Smart Campus API","slug":"csa-smart-campus-api"}],"owner":"54114927","collectionId":"1df62209-1fa9-4e45-a63c-9981fb6bcbfc","publishedId":"2sBXqDsiQo","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2026-04-23T13:44:11.000Z"},"item":[{"name":"Part 1 - Discovery","item":[{"name":"Discovery Request","id":"5a151c07-72d1-4f1b-87e1-dffdcc6ef9f7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:8080/Smart_Campus_API/api/v1/","description":"<p>Sends a <code>GET</code> request to the root endpoint <code>GET /api/v1/</code> to verify that the Smart Campus API is reachable and operational. This serves as the entry point for the API, confirming the service is running and returning a valid response before any further operations are performed.</p>\n","urlObject":{"protocol":"http","port":"8080","path":["Smart_Campus_API","api","v1",""],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"5a151c07-72d1-4f1b-87e1-dffdcc6ef9f7"}],"id":"f21959b2-52b2-4576-9259-8c235f22b1a5","description":"<p>This folder tests the API's root discovery endpoint, which serves as the entry point for the Smart Campus API. It includes a single <code>GET /api/v1/</code> request to verify that the API is reachable and returns the expected top-level resource or metadata. This is typically used to confirm the API is live and to explore available endpoints or versioning information.</p>\n","_postman_id":"f21959b2-52b2-4576-9259-8c235f22b1a5"},{"name":"Part 2 - Rooms","item":[{"name":"Empty Rooms","id":"64f1941a-a104-4977-8ed6-48aa743e2c92","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:8080/Smart_Campus_API/api/v1/rooms","description":"<p>Sends a <code>GET</code> request to <code>GET /api/v1/rooms</code> before any rooms have been created. Verifies that the API correctly returns an empty list (or appropriate empty-state response) when no room resources exist in the system.</p>\n","urlObject":{"protocol":"http","port":"8080","path":["Smart_Campus_API","api","v1","rooms"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"64f1941a-a104-4977-8ed6-48aa743e2c92"},{"name":"Create Room - R101","id":"2226b126-37bc-4cde-868c-d183106be51e","protocolProfileBehavior":{"disableBodyPruning":true,"disabledSystemHeaders":{"content-type":true}},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n  \"id\": \"R101\",\r\n  \"name\": \"Lab Room\",\r\n  \"capacity\": 30\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:8080/Smart_Campus_API/api/v1/rooms","description":"<p>Sends a <code>POST</code> request to <code>POST /api/v1/rooms</code> to create a new room with ID <code>R101</code>, named \"Lab Room\", with a capacity of 30. Verifies that the API successfully registers the room and returns the expected created resource.</p>\n","urlObject":{"protocol":"http","port":"8080","path":["Smart_Campus_API","api","v1","rooms"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"2226b126-37bc-4cde-868c-d183106be51e"},{"name":"Create Room - R102","id":"b54a5e62-aafb-460f-adce-386212d6419f","protocolProfileBehavior":{"disableBodyPruning":true,"disabledSystemHeaders":{"content-type":true}},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n  \"id\": \"R102\",\r\n  \"name\": \"Lecture Hall\",\r\n  \"capacity\": 100\r\n}"},"url":"http://localhost:8080/Smart_Campus_API/api/v1/rooms","description":"<p>Sends a <code>POST</code> request to <code>POST /api/v1/rooms</code> to create a second room with ID <code>R102</code>. Verifies that the API can register multiple rooms independently and returns the correct response for the newly created resource.</p>\n","urlObject":{"protocol":"http","port":"8080","path":["Smart_Campus_API","api","v1","rooms"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"b54a5e62-aafb-460f-adce-386212d6419f"},{"name":"Create Room - R103","id":"8b198bb3-ced8-45cf-bd6c-48125740fa77","protocolProfileBehavior":{"disableBodyPruning":true,"disabledSystemHeaders":{"content-type":true}},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n  \"id\": \"R103\",\r\n  \"name\": \"Library Quiet Study\",\r\n  \"capacity\": 50\r\n}"},"url":"http://localhost:8080/Smart_Campus_API/api/v1/rooms","description":"<p>Sends a <code>POST</code> request to <code>POST /api/v1/rooms</code> to create a third room with ID <code>R103</code>, named \"Library Quiet Study\", with a capacity of 50. Verifies successful room creation and is also used as the target room for subsequent duplicate and deletion tests.</p>\n","urlObject":{"protocol":"http","port":"8080","path":["Smart_Campus_API","api","v1","rooms"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"8b198bb3-ced8-45cf-bd6c-48125740fa77"},{"name":"Create Duplicate Room","id":"91a13f19-8a1d-4bae-bc84-61aebe73dc36","protocolProfileBehavior":{"disableBodyPruning":true,"disabledSystemHeaders":{"content-type":true}},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n  \"id\": \"R103\",\r\n  \"name\": \"Library Quiet Study\",\r\n  \"capacity\": 50\r\n}"},"url":"http://localhost:8080/Smart_Campus_API/api/v1/rooms","description":"<p>Sends a <code>POST</code> request to <code>POST /api/v1/rooms</code> attempting to create a room with ID <code>R103</code>, which already exists in the system. Verifies that the API correctly rejects the duplicate and returns an appropriate error response (e.g., <code>409 Conflict</code>).</p>\n","urlObject":{"protocol":"http","port":"8080","path":["Smart_Campus_API","api","v1","rooms"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"91a13f19-8a1d-4bae-bc84-61aebe73dc36"},{"name":"Create Room without ID","id":"ed42565d-d603-47f2-9399-3e2bd7ab4a17","protocolProfileBehavior":{"disableBodyPruning":true,"disabledSystemHeaders":{"content-type":true}},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n  \"name\": \"No ID Room\",\r\n  \"capacity\": 20\r\n}"},"url":"http://localhost:8080/Smart_Campus_API/api/v1/rooms","description":"<p>Sends a <code>POST</code> request to <code>POST /api/v1/rooms</code> with a body that omits the required <code>id</code> field, providing only <code>name</code> and <code>capacity</code>. Verifies that the API enforces field validation and returns an appropriate error response (e.g., <code>400 Bad Request</code>) when a required field is missing.</p>\n","urlObject":{"protocol":"http","port":"8080","path":["Smart_Campus_API","api","v1","rooms"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"ed42565d-d603-47f2-9399-3e2bd7ab4a17"},{"name":"Get All Rooms","id":"3ead9363-2609-49a7-8a45-bce5e08de6cc","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:8080/Smart_Campus_API/api/v1/rooms","description":"<p>Sends a <code>GET</code> request to <code>GET /api/v1/rooms</code> after multiple rooms have been created. Verifies that the API returns a complete list of all registered rooms, confirming that room data is persisted and retrievable correctly.</p>\n","urlObject":{"protocol":"http","port":"8080","path":["Smart_Campus_API","api","v1","rooms"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"3ead9363-2609-49a7-8a45-bce5e08de6cc"},{"name":"Get Room by ID","id":"d416f3d9-5a37-426a-8d7a-a9c7962e4d80","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:8080/Smart_Campus_API/api/v1/rooms/R101","description":"<p>Sends a <code>GET</code> request to <code>GET /api/v1/rooms/R101</code> to retrieve a specific room by its ID. Verifies that the API returns the correct room details for the given identifier, confirming individual resource lookup works as expected.</p>\n","urlObject":{"protocol":"http","port":"8080","path":["Smart_Campus_API","api","v1","rooms","R101"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"d416f3d9-5a37-426a-8d7a-a9c7962e4d80"},{"name":"Get Non-Existent Room","id":"705ec8fc-8b6a-4793-be58-4137e2785563","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:8080/Smart_Campus_API/api/v1/rooms/R1Fake","description":"<p>Sends a <code>GET</code> request to <code>GET /api/v1/rooms/R1Fake</code> using an ID that does not correspond to any registered room. Verifies that the API returns an appropriate error response (e.g., <code>404 Not Found</code>) when a requested resource does not exist.</p>\n","urlObject":{"protocol":"http","port":"8080","path":["Smart_Campus_API","api","v1","rooms","R1Fake"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"705ec8fc-8b6a-4793-be58-4137e2785563"},{"name":"Content-Type Mismatch","id":"0e318c45-02da-4ace-b6cb-69f1543e0ee9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"text/plain","type":"text"}],"body":{"mode":"raw","raw":"This is plain Text, not JSON","options":{"raw":{"language":"text"}}},"url":"http://localhost:8080/Smart_Campus_API/api/v1/rooms","description":"<p>Sends a <code>POST</code> request to <code>POST /api/v1/rooms</code> with the <code>Content-Type</code> header set to <code>text/plain</code> and a plain-text body instead of JSON. Verifies that the API correctly rejects requests with an unsupported or mismatched content type and returns an appropriate error response (e.g., <code>415 Unsupported Media Type</code> or <code>400 Bad Request</code>).</p>\n","urlObject":{"protocol":"http","port":"8080","path":["Smart_Campus_API","api","v1","rooms"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"0e318c45-02da-4ace-b6cb-69f1543e0ee9"},{"name":"Delete Empty Room","id":"488784fe-56fc-4529-9925-fb96ffa61f0c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"url":"http://localhost:8080/Smart_Campus_API/api/v1/rooms/R103","description":"<p>Sends a <code>DELETE</code> request to <code>DELETE /api/v1/rooms/R103</code> to remove a room that has no sensors assigned to it. Verifies that the API successfully deletes an unoccupied room and returns the appropriate success response.</p>\n","urlObject":{"protocol":"http","port":"8080","path":["Smart_Campus_API","api","v1","rooms","R103"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"488784fe-56fc-4529-9925-fb96ffa61f0c"}],"id":"020ca480-d0a0-4706-a2d5-69d8bbec9678","description":"<p>This folder tests the full lifecycle of room management via the <code>/api/v1/rooms</code> endpoints, covering creation, retrieval, and deletion operations. Key scenarios include creating multiple rooms (R101, R102, R103), fetching all rooms and a specific room by ID, and deleting both empty rooms and rooms that have sensors attached. Notable edge cases include attempting to create a duplicate room, creating a room without an ID, retrieving a non-existent room, and sending a request with a Content-Type mismatch to validate error handling.</p>\n","_postman_id":"020ca480-d0a0-4706-a2d5-69d8bbec9678"},{"name":"Part 3 - Sensors","item":[{"name":"Register Sensor - TEMP-001","id":"c9ddafa4-8851-4ee7-a6fe-b3c3a2580848","protocolProfileBehavior":{"disableBodyPruning":true,"disabledSystemHeaders":{"content-type":true}},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n  \"id\": \"TEMP-001\",\r\n  \"type\": \"Temperature\",\r\n  \"status\": \"ACTIVE\",\r\n  \"currentValue\": 22.5,\r\n  \"roomId\": \"R101\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:8080/Smart_Campus_API/api/v1/sensors","description":"<p>Sends a <code>POST</code> request to <code>POST /api/v1/sensors</code> to register a new Temperature sensor with ID <code>TEMP-001</code>, assigned to room <code>R101</code>, with an <code>ACTIVE</code> status and an initial value of <code>22.5</code>. Verifies that the API successfully creates the sensor and returns the expected resource.</p>\n","urlObject":{"protocol":"http","port":"8080","path":["Smart_Campus_API","api","v1","sensors"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"c9ddafa4-8851-4ee7-a6fe-b3c3a2580848"},{"name":"Register Sensor - CO2-001","id":"80dc0cac-1c26-400c-87cb-374251e6f350","protocolProfileBehavior":{"disableBodyPruning":true,"disabledSystemHeaders":{"content-type":true}},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n  \"id\": \"CO2-001\",\r\n  \"type\": \"CO2\",\r\n  \"status\": \"ACTIVE\",\r\n  \"currentValue\": 400.0,\r\n  \"roomId\": \"R101\"\r\n}"},"url":"http://localhost:8080/Smart_Campus_API/api/v1/sensors","description":"<p>Sends a <code>POST</code> request to <code>POST /api/v1/sensors</code> to register a CO2 sensor with ID <code>CO2-001</code>, assigned to room <code>R101</code>, with an <code>ACTIVE</code> status and an initial value of <code>400.0</code>. Verifies that the API supports multiple sensor types and correctly persists the new sensor.</p>\n","urlObject":{"protocol":"http","port":"8080","path":["Smart_Campus_API","api","v1","sensors"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"80dc0cac-1c26-400c-87cb-374251e6f350"},{"name":"Register Sensor - OCC-001 (MAINTENANCE)","id":"526a53e2-bc53-4a6f-af0e-99d394ae3401","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n  \"id\": \"OCC-001\",\r\n  \"type\": \"Occupancy\",\r\n  \"status\": \"MAINTENANCE\",\r\n  \"currentValue\": 0.0,\r\n  \"roomId\": \"R101\"\r\n}"},"url":"http://localhost:8080/Smart_Campus_API/api/v1/sensors","description":"<p>Sends a <code>POST</code> request to <code>POST /api/v1/sensors</code> to register an Occupancy sensor with ID <code>OCC-001</code>, assigned to room <code>R101</code>, with a <code>MAINTENANCE</code> status and an initial value of <code>0.0</code>. Verifies that the API correctly handles sensors in non-active states and persists the resource accordingly.</p>\n","urlObject":{"protocol":"http","port":"8080","path":["Smart_Campus_API","api","v1","sensors"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"526a53e2-bc53-4a6f-af0e-99d394ae3401"},{"name":"Register Sensor With Invalid ID","id":"88f120ac-0cb4-4340-b9d3-3a6be4b06169","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n  \"id\": \"TEMP-999\",\r\n  \"type\": \"Temperature\",\r\n  \"status\": \"ACTIVE\",\r\n  \"currentValue\": 22.5,\r\n  \"roomId\": \"FAKE-ROOM\"\r\n}"},"url":"http://localhost:8080/Smart_Campus_API/api/v1/sensors","description":"<p>Sends a <code>POST</code> request to <code>POST /api/v1/sensors</code> attempting to register a sensor assigned to a non-existent room (<code>FAKE-ROOM</code>). Verifies that the API enforces referential integrity by rejecting the registration and returning an appropriate error response (e.g., <code>404 Not Found</code> or <code>400 Bad Request</code>).</p>\n","urlObject":{"protocol":"http","port":"8080","path":["Smart_Campus_API","api","v1","sensors"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"88f120ac-0cb4-4340-b9d3-3a6be4b06169"},{"name":"Register Duplicate Sensor","id":"7b81e32f-1add-4b9d-960b-037c54958d19","protocolProfileBehavior":{"disableBodyPruning":true,"disabledSystemHeaders":{"content-type":true}},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n  \"id\": \"TEMP-001\",\r\n  \"type\": \"Temperature\",\r\n  \"status\": \"ACTIVE\",\r\n  \"currentValue\": 25.0,\r\n  \"roomId\": \"R101\"\r\n}"},"url":"http://localhost:8080/Smart_Campus_API/api/v1/sensors","description":"<p>Sends a <code>POST</code> request to <code>POST /api/v1/sensors</code> attempting to register a sensor with ID <code>TEMP-001</code>, which already exists in the system. Verifies that the API correctly rejects the duplicate registration and returns an appropriate error response (e.g., <code>409 Conflict</code>).</p>\n","urlObject":{"protocol":"http","port":"8080","path":["Smart_Campus_API","api","v1","sensors"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"7b81e32f-1add-4b9d-960b-037c54958d19"},{"name":"Get All Sensors","id":"7bf1e726-3798-4cfb-bcad-e74bd8b24481","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"url":"http://localhost:8080/Smart_Campus_API/api/v1/sensors","description":"<p>Sends a <code>GET</code> request to <code>GET /api/v1/sensors</code> to retrieve the full list of registered sensors. Verifies that all previously created sensors are returned correctly, confirming that sensor data is persisted and the list endpoint functions as expected.</p>\n","urlObject":{"protocol":"http","port":"8080","path":["Smart_Campus_API","api","v1","sensors"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"7bf1e726-3798-4cfb-bcad-e74bd8b24481"},{"name":"Get Sensors Filtered By Type - Temperature","id":"29578631-a740-4794-b296-f2ec7c8929c4","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"url":"http://localhost:8080/Smart_Campus_API/api/v1/sensors?type=Temperature","description":"<p>Sends a <code>GET</code> request to <code>GET /api/v1/sensors?type=Temperature</code> to retrieve only sensors of type <code>Temperature</code>. Verifies that the API correctly applies the type filter and returns only matching sensors from the registered list.</p>\n","urlObject":{"protocol":"http","port":"8080","path":["Smart_Campus_API","api","v1","sensors"],"host":["localhost"],"query":[{"key":"type","value":"Temperature"}],"variable":[]}},"response":[],"_postman_id":"29578631-a740-4794-b296-f2ec7c8929c4"},{"name":"Get Sensors Filtered By Type - CO2","id":"2cc373e3-3158-4a90-8872-84bbd9f25f11","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:8080/Smart_Campus_API/api/v1/sensors?type=CO2","description":"<p>Sends a <code>GET</code> request to <code>GET /api/v1/sensors?type=CO2</code> to retrieve only sensors of type <code>CO2</code>. Verifies that the type filter works correctly for a different sensor type and returns only the matching sensor(s).</p>\n","urlObject":{"protocol":"http","port":"8080","path":["Smart_Campus_API","api","v1","sensors"],"host":["localhost"],"query":[{"key":"type","value":"CO2"}],"variable":[]}},"response":[],"_postman_id":"2cc373e3-3158-4a90-8872-84bbd9f25f11"},{"name":"Get Sensors Filtered By Type - No Match","id":"c75f9449-2507-44a4-b34e-f65335b88de5","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:8080/Smart_Campus_API/api/v1/sensors?type=Humidity","description":"<p>Sends a <code>GET</code> request to <code>GET /api/v1/sensors?type=Humidity</code> to filter sensors by a type that has no registered sensors. Verifies that the API returns an empty list (or appropriate empty-state response) when no sensors match the specified filter.</p>\n","urlObject":{"protocol":"http","port":"8080","path":["Smart_Campus_API","api","v1","sensors"],"host":["localhost"],"query":[{"key":"type","value":"Humidity"}],"variable":[]}},"response":[],"_postman_id":"c75f9449-2507-44a4-b34e-f65335b88de5"},{"name":"Delete Room With Sensors","id":"01a411ec-7900-4072-b36e-8623ae261067","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"url":"http://localhost:8080/Smart_Campus_API/api/v1/rooms/R101","description":"<p>Sends a <code>DELETE</code> request to <code>DELETE /api/v1/rooms/R101</code> to attempt deletion of a room that has active sensors registered to it. Verifies that the API enforces referential integrity by rejecting the deletion and returning an appropriate error response (e.g., <code>409 Conflict</code> or <code>400 Bad Request</code>).</p>\n","urlObject":{"protocol":"http","port":"8080","path":["Smart_Campus_API","api","v1","rooms","R101"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"01a411ec-7900-4072-b36e-8623ae261067"}],"id":"2f8b9642-1ecf-4cd7-8e43-fddeaa596f6b","description":"<p>This folder tests sensor registration and retrieval operations via the <code>/api/v1/sensors</code> endpoints. It covers registering sensors of different types (Temperature, CO2, and an Occupancy sensor in MAINTENANCE status), fetching all sensors, and filtering sensors by type — including a filter that returns no matches. Edge cases include attempting to register a duplicate sensor and registering a sensor with an invalid ID format to verify proper validation and error responses.</p>\n","_postman_id":"2f8b9642-1ecf-4cd7-8e43-fddeaa596f6b"},{"name":"Part 4 - Sensor Readings","item":[{"name":"Post Reading to TEMP-001 - Reading 1","id":"cda70562-373d-442e-89ea-a4a068e1e6b8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n  \"value\": 24.5\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:8080/Smart_Campus_API/api/v1/sensors/TEMP-001/readings","description":"<p>Sends a <code>POST</code> request to <code>POST /api/v1/sensors/TEMP-001/readings</code> to submit the first sensor reading (value: <code>24.5</code>) for the active Temperature sensor <code>TEMP-001</code>. Verifies that the API accepts and persists the reading for an active sensor.</p>\n","urlObject":{"protocol":"http","port":"8080","path":["Smart_Campus_API","api","v1","sensors","TEMP-001","readings"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"cda70562-373d-442e-89ea-a4a068e1e6b8"},{"name":"Post Reading to TEMP-001 - Reading 2","id":"3864fa52-f3dc-4e9f-b31f-aa4152671f95","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n  \"value\": 25.0\r\n}"},"url":"http://localhost:8080/Smart_Campus_API/api/v1/sensors/TEMP-001/readings","description":"<p>Sends a <code>POST</code> request to <code>POST /api/v1/sensors/TEMP-001/readings</code> to submit a second sensor reading for <code>TEMP-001</code>. Verifies that the API correctly appends multiple readings to the same sensor's history.</p>\n","urlObject":{"protocol":"http","port":"8080","path":["Smart_Campus_API","api","v1","sensors","TEMP-001","readings"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"3864fa52-f3dc-4e9f-b31f-aa4152671f95"},{"name":"Post Reading to TEMP-001 - Reading 3","id":"c1e0693e-bfcc-4a30-8a96-00b76030bdb9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n  \"value\": 23.8\r\n}"},"url":"http://localhost:8080/Smart_Campus_API/api/v1/sensors/TEMP-001/readings","description":"<p>Sends a <code>POST</code> request to <code>POST /api/v1/sensors/TEMP-001/readings</code> to submit a third sensor reading for <code>TEMP-001</code>. Verifies continued accumulation of readings and that the sensor's reading history grows as expected.</p>\n","urlObject":{"protocol":"http","port":"8080","path":["Smart_Campus_API","api","v1","sensors","TEMP-001","readings"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"c1e0693e-bfcc-4a30-8a96-00b76030bdb9"},{"name":"Get All Readings for TEMP-001","id":"09cf4595-4eb2-4c3d-8ded-e721b631015e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:8080/Smart_Campus_API/api/v1/sensors/TEMP-001/readings","description":"<p>Sends a <code>GET</code> request to <code>GET /api/v1/sensors/TEMP-001/readings</code> to retrieve the full reading history for sensor <code>TEMP-001</code>. Verifies that all previously posted readings are returned correctly and that the readings endpoint reflects the accumulated data.</p>\n","urlObject":{"protocol":"http","port":"8080","path":["Smart_Campus_API","api","v1","sensors","TEMP-001","readings"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"09cf4595-4eb2-4c3d-8ded-e721b631015e"},{"name":"Get Readings for Non-Existent Sensor","id":"9560283f-1a69-4bec-9fef-5fa3d1b63c5f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:8080/Smart_Campus_API/api/v1/sensors/TEMP-999/readings","description":"<p>Sends a <code>GET</code> request to <code>GET /api/v1/sensors/TEMP-999/readings</code> using a sensor ID that does not exist in the system. Verifies that the API returns an appropriate error response (e.g., <code>404 Not Found</code>) when attempting to retrieve readings for an unregistered sensor.</p>\n","urlObject":{"protocol":"http","port":"8080","path":["Smart_Campus_API","api","v1","sensors","TEMP-999","readings"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"9560283f-1a69-4bec-9fef-5fa3d1b63c5f"},{"name":"Verify CurrentValue Updated","id":"fc1cfa7a-6f49-4cd5-9118-14a7eb423bd9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:8080/Smart_Campus_API/api/v1/sensors/TEMP-001","description":"<p>Sends a <code>GET</code> request to <code>GET /api/v1/sensors/TEMP-001</code> to retrieve the current state of sensor <code>TEMP-001</code> after multiple readings have been posted. Verifies that the sensor's <code>currentValue</code> field has been updated to reflect the most recent reading, confirming that the API correctly maintains live sensor state.</p>\n","urlObject":{"protocol":"http","port":"8080","path":["Smart_Campus_API","api","v1","sensors","TEMP-001"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"fc1cfa7a-6f49-4cd5-9118-14a7eb423bd9"},{"name":"Get Readings With Empty History","id":"e68a0f01-82a9-482f-bb66-94471f06e335","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:8080/Smart_Campus_API/api/v1/sensors/OCC-001/readings","description":"<p>Sends a <code>GET</code> request to <code>GET /api/v1/sensors/OCC-001/readings</code> to retrieve readings for sensor <code>OCC-001</code>, which has had no readings posted. Verifies that the API returns an empty list (or appropriate empty-state response) when a sensor exists but has no reading history.</p>\n","urlObject":{"protocol":"http","port":"8080","path":["Smart_Campus_API","api","v1","sensors","OCC-001","readings"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"e68a0f01-82a9-482f-bb66-94471f06e335"},{"name":"Post Reading to MAINTENANCE Sensor","id":"159f1b37-ad5e-46b3-a6a0-30dac0e8635f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n  \"value\": 500.0\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:8080/Smart_Campus_API/api/v1/sensors/OCC-001/readings","description":"<p>Sends a <code>POST</code> request to <code>POST /api/v1/sensors/OCC-001/readings</code> attempting to post a reading (value: <code>500.0</code>) to sensor <code>OCC-001</code>, which is in <code>MAINTENANCE</code> status. Verifies that the API correctly rejects readings for non-active sensors and returns an appropriate error response.</p>\n","urlObject":{"protocol":"http","port":"8080","path":["Smart_Campus_API","api","v1","sensors","OCC-001","readings"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"159f1b37-ad5e-46b3-a6a0-30dac0e8635f"}],"id":"b27f5e4b-ed59-4a88-84fd-b93e3f1989e1","description":"<p>This folder tests posting and retrieving sensor readings via the <code>/api/v1/sensors/{sensorId}/readings</code> endpoints. It includes posting multiple readings to an active sensor (TEMP-001) and verifying that the sensor's <code>currentValue</code> is updated accordingly. Notable edge cases include posting a reading to a sensor in MAINTENANCE status (OCC-001), retrieving readings for a sensor with no history, and fetching readings for a non-existent sensor to validate appropriate error responses.</p>\n","_postman_id":"b27f5e4b-ed59-4a88-84fd-b93e3f1989e1"},{"name":"Part 5 - Errors","item":[{"name":"500 Error Trigger","id":"c6e5c54e-cffe-451f-a9e1-1621e54963b6","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"id\": \"R500\",\r\n    \"name\": \"Lab\",\r\n    \"capacity\": 20\r\n","options":{"raw":{"language":"json"}}},"url":"http://localhost:8080/Smart_Campus_API/api/v1/rooms","description":"<p>Sends a <code>POST</code> request to <code>POST /api/v1/rooms</code> with a deliberately malformed JSON body (missing the closing brace) to trigger a server-side parsing failure. Verifies that the API returns a <code>500 Internal Server Error</code> under this error condition, testing the API's handling of unexpected server-side failures.</p>\n","urlObject":{"protocol":"http","port":"8080","path":["Smart_Campus_API","api","v1","rooms"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"c6e5c54e-cffe-451f-a9e1-1621e54963b6"}],"id":"e0ea2716-1417-4025-8139-bccd10442f34","description":"<p>This folder tests the API's handling of server-side error conditions, specifically targeting scenarios that trigger a <code>500 Internal Server Error</code>. It contains a single <code>POST /api/v1/rooms</code> request crafted to provoke an unexpected server failure, verifying that the API returns a proper error response rather than crashing silently. This is useful for confirming that error handling and logging are functioning correctly under fault conditions.</p>\n","_postman_id":"e0ea2716-1417-4025-8139-bccd10442f34"}]}