{"openapi":"3.0.0","servers":[{"description":"SwaggerHub API Auto Mocking","url":"https://virtserver.swaggerhub.com/student-53f/AirQ-API/1.0.0"}],"info":{"description":"This an API for a student AirQ project.","version":"1.0.0","title":"Air quality application API","contact":{"email":"you@your-company.com"},"license":{"name":"Apache 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"}},"paths":{"/api/current":{"get":{"summary":"get current data","operationId":"getCurrentData","description":"By calling the specified path the user gets the latest measurements.\n","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DataValue"}},"examples":{"Example 1":{"value":{"timestamp":"2016-08-29T09:12:33.001Z","temperature":26.75,"humidity":34.7,"pm1":11.5,"pm2":12.5,"pm10":12.5,"co2":408,"aqi":2,"tvoc":184}}}}}},"500":{"description":"Cannot retrieve current data"}}},"parameters":[]},"/api/{range}":{"get":{"summary":"get historical data","tags":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DataValue"}},"examples":{"Example 2":{"value":[{"timestamp":"2016-08-29T09:12:33.001Z","temperature":27.48,"humidity":40.1,"pm1":8.7,"pm2":10.5,"pm10":15.6,"co2":405,"aqi":2,"tvoc":167},{"timestamp":"2016-08-29T09:13:43.001Z","temperature":27.67,"humidity":40.13,"pm1":8.5,"pm2":10.2,"pm10":15.3,"co2":403,"aqi":2,"tvoc":163}]}}}}},"400":{"description":"Invalid range limit"},"500":{"description":"Failed to fetch historical data"}},"operationId":"getHistoricalData","parameters":[],"description":"Based on the provided range in the request body return data for that specific date range. "},"parameters":[{"schema":{"type":"string","enum":["hour","day","week","month","6months"],"default":"hour"},"name":"range","in":"path","required":true}]}},"components":{"schemas":{"DataValue":{"type":"object","title":"DataValue","description":"measurement data from a single point in time","x-examples":{},"properties":{"timestamp":{"type":"string","format":"date-time","example":"2016-08-29T09:12:33.001Z"},"temperature":{"type":"number","format":"double","example":27.48},"humidity":{"type":"number","x-stoplight":{"id":"mj7titny52cqd"},"format":"double","example":40.1},"pm1":{"type":"number","x-stoplight":{"id":"t1b9k1aa1sgim"},"format":"double","example":8.7},"pm2":{"type":"number","x-stoplight":{"id":"whvkwqh2dx52v"},"format":"double","example":10.5},"pm10":{"type":"number","x-stoplight":{"id":"yoy35p55h6ufm"},"format":"double","example":15.6},"co2":{"type":"number","x-stoplight":{"id":"e0n4vw5xoyslp"},"format":"double","example":405},"aqi":{"type":"integer","example":2},"tvoc":{"type":"number","x-stoplight":{"id":"eyelwli32e0uu"},"format":"double","example":167}}}}}}