{"info":{"_postman_id":"c02a7a05-ca68-4d03-a5fb-0a6bb8745c7d","name":"Tiki IoT REST API v1.0.0","description":"<html><head></head><body><p>Tiki IoT API documentation provides all details of creating and managing devices(energy monitors) and also about getting sensors readings (voltage, current, kWh).</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"5095898","collectionId":"c02a7a05-ca68-4d03-a5fb-0a6bb8745c7d","publishedId":"VUr1FXZm","public":true,"customColor":{"top-bar":"010101","right-sidebar":"303030","highlight":"0e75db"},"publishDate":"2022-08-26T05:54:37.000Z"},"item":[{"name":"Auth","item":[{"name":"Signup","id":"eba7ee56-a4f7-4e19-a07a-05c150f1188f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"name\": \"My User2\",\n    \"timezone\": \"America/Merida\",\n    \"email\": \"testUser2@gmail.com\",\n    \"password\": \"secret_key\"\n}","options":{"raw":{"language":"json"}}},"url":"{{url}}/api/v1/auth/signup","description":"<p>To create a new user (signup) you must provide a valid email and password.</p>\n","urlObject":{"path":["api","v1","auth","signup"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[{"id":"d8ad450f-3b1c-42e2-97f2-aa8bec821081","name":"Signup - OK","originalRequest":{"method":"POST","header":[{"key":"","value":"","type":"text","disabled":true}],"body":{"mode":"raw","raw":"{\n    \"name\": \"My User\",\n    \"timezone\": \"America/Merida\",\n    \"email\": \"testUser@gmail.com\",\n    \"password\": \"secret_key\"\n}","options":{"raw":{"language":"json"}}},"url":"{{url}}/api/v1/auth/signup"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"msg\": \"success\",\n    \"user\": {\n        \"name\": \"My User\",\n        \"email\": \"testuser@gmail.com\",\n        \"timezone\": \"Etc/GMT\",\n        \"_id\": \"6307d8dc59163fe56496428a\"\n    },\n    \"accessToken\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2MzA3ZDhkYzU5MTYzZmU1NjQ5NjQyOGEiLCJpYXQiOjE2NjE0NTg2NTMsImV4cCI6MTY2MTQ2MjI1M30.o5ATZBcHFqdmv6HePP6PlBX4tG6A4TonGWGLLMngGm8\",\n    \"refreshToken\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2MzA3ZDhkYzU5MTYzZmU1NjQ5NjQyOGEiLCJpYXQiOjE2NjE0NTg2NTMsImV4cCI6MTY2NDA1MDY1M30.hiOdt6fc3qHB6g9bHV0wouPfM9qsWrVq6z_YNn8EC7M\"\n}"},{"id":"d62af416-b041-4e5f-949f-2d92f1a131a9","name":"Signup - 400 (wrong password length)","originalRequest":{"method":"POST","header":[{"key":"","value":"","type":"text","disabled":true}],"body":{"mode":"raw","raw":"{\n    \"name\": \"My User\",\n    \"timezone\": \"America/Merida\",\n    \"email\": \"testUser@gmail.com\",\n    \"password\": \"secret\"\n}","options":{"raw":{"language":"json"}}},"url":"{{url}}/api/v1/auth/signup"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"errors\": [\n        {\n            \"value\": \"secret\",\n            \"msg\": \"Invalid value\",\n            \"param\": \"password\",\n            \"location\": \"body\"\n        }\n    ]\n}"},{"id":"de7546d3-be43-416b-ad78-6609dd0c653b","name":"Signup - 400 (email already in use)","originalRequest":{"method":"POST","header":[{"key":"","value":"","type":"text","disabled":true}],"body":{"mode":"raw","raw":"{\n    \"name\": \"My User\",\n    \"timezone\": \"America/Merida\",\n    \"email\": \"testUser@gmail.com\",\n    \"password\": \"secret_key\"\n}","options":{"raw":{"language":"json"}}},"url":"{{url}}/api/v1/auth/signup"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"email\": \"testuser3@emailcom\",\n    \"password\": \"qwertyui8\"\n}"},{"id":"f964e18c-ce6d-4887-bf8f-298909dd7f96","name":"Signup - 400 (missing some parameters)","originalRequest":{"method":"POST","header":[{"key":"","value":"","type":"text","disabled":true}],"body":{"mode":"raw","raw":"{\n    \"name\": \"My User\",\n    \"timezone\": \"America/Merida\",\n    \"email\": \"testUser@gmail.com\"\n}","options":{"raw":{"language":"json"}}},"url":"{{url}}/api/v1/auth/signup"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"errors\": [\n        {\n            \"msg\": \"Invalid value\",\n            \"param\": \"password\",\n            \"location\": \"body\"\n        }\n    ]\n}"}],"_postman_id":"eba7ee56-a4f7-4e19-a07a-05c150f1188f"},{"name":"Signin","id":"b2cf5e77-2ca4-49d7-b947-6337f6cb7f61","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"email\": \"testuser3@email.com\",\n    \"password\": \"qwertyui8\"\n}","options":{"raw":{"language":"json"}}},"url":"{{url}}/api/v1/auth/signin","description":"<p>After creating of a new user, you must be logged inserting the email &amp; password.\nThe response will include an access and refresh token.</p>\n","urlObject":{"path":["api","v1","auth","signin"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[{"id":"77fee784-206e-43b6-8a32-87bb614b0dae","name":"Signin - OK","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"email\": \"testuser3@email.com\",\n    \"password\": \"qwertyui8\"\n}","options":{"raw":{"language":"json"}}},"url":"{{url}}/api/v1/auth/signin"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"msg\": \"success\",\n    \"user\": {\n        \"_id\": \"62b9cc872420ba1a6e06128e\",\n        \"name\": \"user test\",\n        \"email\": \"testuser3@email.com\",\n        \"timezone\": \"(UTC-06:00) Guadalajara, Mexico City, Monterrey\"\n    },\n    \"accessToken\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2MmI5Y2M4NzI0MjBiYTFhNmUwNjEyOGUiLCJpYXQiOjE2NjE0NTg3NDgsImV4cCI6MTY2MTQ2MjM0OH0.jsEG-W3AB43aIBLLNFMPDd48vEIR9tiitDEiGs9y_U8\",\n    \"refreshToken\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2MmI5Y2M4NzI0MjBiYTFhNmUwNjEyOGUiLCJpYXQiOjE2NjE0NTg3NDgsImV4cCI6MTY2NDA1MDc0OH0._YG5LA7F58x-FBT_kQ73FVC8hTZEUJqwfw_-W3opfYU\"\n}"},{"id":"3b207e22-37b7-4c8a-ae95-1ae3105ac807","name":"Signin - 400 (missing some parameters)","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"email\": \"testuser3@email.com\"\n}","options":{"raw":{"language":"json"}}},"url":"{{url}}/api/v1/auth/signin"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"errors\": [\n        {\n            \"msg\": \"Invalid value\",\n            \"param\": \"password\",\n            \"location\": \"body\"\n        }\n    ]\n}"},{"id":"95ca0ca7-caf1-4219-8c47-2d42e88ddc5c","name":"Signin - 400 (missing some parameters) Copy","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"email\": \"testuser3@emailcom\",\n    \"password\": \"qwertyui8\"\n}","options":{"raw":{"language":"json"}}},"url":"{{url}}/api/v1/auth/signin"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"errors\": [\n        {\n            \"value\": \"testuser3@emailcom\",\n            \"msg\": \"Invalid value\",\n            \"param\": \"email\",\n            \"location\": \"body\"\n        }\n    ]\n}"}],"_postman_id":"b2cf5e77-2ca4-49d7-b947-6337f6cb7f61"},{"name":"Refresh Token","id":"4bd624c2-ee9b-4b11-a373-9f5353a27022","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"refreshToken\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2MmI5Y2M4NzI0MjBiYTFhNmUwNjEyOGUiLCJpYXQiOjE2NjE0NTg3NDgsImV4cCI6MTY2NDA1MDc0OH0._YG5LA7F58x-FBT_kQ73FVC8hTZEUJqwfw\"\n}","options":{"raw":{"language":"json"}}},"url":"{{url}}/api/v1/auth/refreshToken","description":"<p>After 60 minutes, the access token will be expired, so you should update it passing the refresh token.</p>\n<p>After 30 days, the refresh token will be expires, you should login again.</p>\n","urlObject":{"path":["api","v1","auth","refreshToken"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[{"id":"ac0d359e-547d-4e88-9e05-7fc1364a632c","name":"Refresh Token - OK","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"refreshToken\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2Mjc5NzUzZGI3N2MxMGEyNjkyNGM1NjkiLCJpYXQiOjE2NTIxMjcyNzIsImV4cCI6MTY1MjEyNzMzMn0.eEq0Yzo1TZpdp0vYiFyZ_dbsn_jhOYYa7m6o8rR1iWo\"\n}","options":{"raw":{"language":"json"}}},"url":"{{url}}/api/v1/auth/refreshToken"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"status\": true,\n    \"msg\": \"success\",\n    \"accessToken\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2MmI5Y2M4NzI0MjBiYTFhNmUwNjEyOGUiLCJpYXQiOjE2NjE0NTk2NzEsImV4cCI6MTY2MTQ2MzI3MX0.aCzY7_gFjFVM05b86Nn2M8hup2wa2vZR-FJBeAKlAJs\",\n    \"user\": {\n        \"_id\": \"62b9cc872420ba1a6e06128e\",\n        \"name\": \"My new username\"\n    },\n    \"refreshToken\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2MmI5Y2M4NzI0MjBiYTFhNmUwNjEyOGUiLCJpYXQiOjE2NjE0NTk2NzEsImV4cCI6MTY2NDA1MTY3MX0.E5xVmETFBrz5zxD-HVanPP6CCDzXJhbdwpaRnKDe7xw\"\n}"},{"id":"c0e37521-dceb-4186-b32f-5c9003242aaa","name":"Refresh Token - 400 (expired Token)","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"refreshToken\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2Mjc5NzUzZGI3N2MxMGEyNjkyNGM1NjkiLCJpYXQiOjE2NTIxMjcyNzIsImV4cCI6MTY1MjEyNzMzMn0.eEq0Yzo1TZpdp0vYiFyZ_dbsn_jhOYYa7m6o8rR1iWo\"\n}","options":{"raw":{"language":"json"}}},"url":"{{url}}/api/v1/auth/refreshToken"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"msg\": \"Authentication Invalid\",\n    \"moreInfo\": [\n        \"error: TokenExpiredError, msg: jwt expired \"\n    ]\n}"},{"id":"a75ce619-70f0-47fc-8a75-0e64e0660f09","name":"Refresh Token - 400 (malformed Token)","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"refreshToken\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2MmI5Y2M4NzI0MjBiYTFhNmUwNjEyOGUiLCJpYXQiOjE2NjE0NTg3NDgsImV4cCI6MTY2NDA1MDc0OH0._YG5LA7F58x-FBT_kQ73FVC8hTZEUJqwfw\"\n}","options":{"raw":{"language":"json"}}},"url":"{{url}}/api/v1/auth/refreshToken"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"msg\": \"Authentication Invalid\",\n    \"moreInfo\": [\n        \"error: JsonWebTokenError, msg: invalid signature \"\n    ]\n}"}],"_postman_id":"4bd624c2-ee9b-4b11-a373-9f5353a27022"},{"name":"User Profile","id":"c3042677-b29b-456e-9a0b-576545f70feb","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[{"key":"x-token","value":"{{access_token}}","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"name\": \"My new username\",\n    \"email\": \"testuser3email.com\",\n    \"timezone\":\"America/Merida\"\n}","options":{"raw":{"language":"json"}}},"url":"{{url}}/api/v1/auth/user","description":"<p>Update basic user information : name, email and timezone.\nTimezone value its important because the sensor's data is displayed trough charts based on the user's timezone.</p>\n","urlObject":{"path":["api","v1","auth","user"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[{"id":"069c2d18-a81e-4528-a46b-24abd0a4453e","name":"User Profile -OK","originalRequest":{"method":"PATCH","header":[{"key":"x-token","value":"{{access_token}}","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"name\": \"My new username\",\n    \"email\": \"testuser3@email.com\",\n    \"timezone\":\"America/Merida\"\n}","options":{"raw":{"language":"json"}}},"url":"{{url}}/api/v1/auth/user"},"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"msg\": \"success\",\n    \"user\": {\n        \"_id\": \"62b9cc872420ba1a6e06128e\",\n        \"name\": \"My new username\",\n        \"email\": \"testuser3@email.com\",\n        \"timezone\": \"America/Merida\"\n    }\n}"},{"id":"58b4e62c-1fb7-4ec5-bcec-6fdeae32c1a6","name":"User Profile - 400 (missing some parameters)","originalRequest":{"method":"PATCH","header":[{"key":"x-token","value":"{{access_token}}","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"email\": \"testuser3@email.com\",\n    \"timezone\":\"America/Merida\"\n}","options":{"raw":{"language":"json"}}},"url":"{{url}}/api/v1/auth/user"},"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"errors\": [\n        {\n            \"msg\": \"Invalid value\",\n            \"param\": \"name\",\n            \"location\": \"body\"\n        },\n        {\n            \"msg\": \"Invalid value\",\n            \"param\": \"name\",\n            \"location\": \"body\"\n        }\n    ]\n}"},{"id":"ed66195f-659e-4228-a284-b6c94ebc6e61","name":"User Profile - 400 (invalid email)","originalRequest":{"method":"PATCH","header":[{"key":"x-token","value":"{{access_token}}","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"email\": \"testuser3email.com\",\n    \"timezone\":\"America/Merida\"\n}","options":{"raw":{"language":"json"}}},"url":"{{url}}/api/v1/auth/user"},"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"errors\": [\n        {\n            \"value\": \"testuser3email.com\",\n            \"msg\": \"Invalid value\",\n            \"param\": \"email\",\n            \"location\": \"body\"\n        }\n    ]\n}"}],"_postman_id":"c3042677-b29b-456e-9a0b-576545f70feb"}],"id":"e3b6b6b4-b70d-41fa-aa24-a949a2cc4f8b","description":"<p>You must be an authenticated and authorized user to consume the whole API.The next end-points we'll explain how to be an authenticated and authorized user.</p>\n<h4 id=\"data-schema\">Data Schema</h4>\n<ul>\n<li><strong>name</strong> (string, <em>required</em>)</li>\n<li><strong>email</strong> (string, <em>required</em>, <em>unique</em>)</li>\n<li><strong>password</strong> (string, <em>required</em>, min length: 8)</li>\n<li><strong>timezone</strong> (string, <em>optional</em>, default: \"Etc/GMT)</li>\n</ul>\n","_postman_id":"e3b6b6b4-b70d-41fa-aa24-a949a2cc4f8b"},{"name":"Device","item":[{"name":"Create Device","id":"5ba50402-78c7-4208-b033-d0514aea3657","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"x-token","value":"{{access_token}}","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"mac\": \"74:69:69:2D:30:02\",\n    \"type\": 1\n}","options":{"raw":{"language":"json"}}},"url":"{{url}}/api/v1/device","description":"<p>Create a new device. You must provide a valid device <strong>name</strong>, <strong>MAC Address</strong> and a device <strong>type</strong>.</p>\n<p>The <strong>type</strong> describe the energy monitor device type. We have 2 device <strong>types</strong>:</p>\n<p><strong>1</strong> : single phase energy meter\n<strong>2</strong> : three phase energy meter</p>\n","urlObject":{"path":["api","v1","device"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[{"id":"2da4f3bf-86bb-46d9-8c00-fa6d77bc5033","name":"Create Device - OK","originalRequest":{"method":"POST","header":[{"key":"x-token","value":"{{access_token}}","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"name\": \"device_test_1\",\n    \"mac\": \"74:69:69:2D:30:02\",\n    \"type\": 1 \n}","options":{"raw":{"language":"json"}}},"url":"{{url}}/api/v1/device"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"msg\": \"success\",\n    \"device\": {\n        \"userId\": \"62b9cc872420ba1a6e06128e\",\n        \"token\": \"820e0e88b0ae8195175eaa460af38eb0961d1dc1feb67250de0f15d9838b9e5f\",\n        \"name\": \"device_test_1\",\n        \"type\": 1,\n        \"mac\": \"74:69:69:2D:30:02\",\n        \"connected\": false,\n        \"_id\": \"63084cf08e5804491fcaa4f8\"\n    }\n}"},{"id":"c55b8486-177e-4f18-8f82-095016db35dc","name":"Create Device - 400 (Authentication Error, Expired JWT)","originalRequest":{"method":"POST","header":[{"key":"x-token","value":"{{access_token}}","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"name\": \"device_test_1\",\n    \"mac\": \"74:69:69:2D:30:02\",\n    \"type\": 1 \n}","options":{"raw":{"language":"json"}}},"url":"{{url}}/api/v1/device"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"msg\": \"Authentication Invalid\",\n    \"moreInfo\": [\n        \"error: TokenExpiredError, msg: jwt expired \"\n    ]\n}"},{"id":"bc4f9a12-3348-4e23-ad69-a0bc03c1efd5","name":"Create Device - 400 (Missed parameters)","originalRequest":{"method":"POST","header":[{"key":"x-token","value":"{{access_token}}","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"mac\": \"74:69:69:2D:30:02\",\n    \"type\": 1 \n}","options":{"raw":{"language":"json"}}},"url":"{{url}}/api/v1/device"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"msg\": \"Please provide valid values\",\n    \"moreInfo\": [\n        {\n            \"msg\": \"Invalid value\",\n            \"param\": \"name\",\n            \"location\": \"body\"\n        }\n    ]\n}"},{"id":"d0b2095c-e253-43dc-b37e-47a2fd49bb22","name":"Create Device - 400 (Invalid Device Type)","originalRequest":{"method":"POST","header":[{"key":"x-token","value":"{{access_token}}","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"name\": \"device_test_1\",\n    \"mac\": \"74:69:69:2D:30:02\",\n    \"type\": \"1233\"\n}","options":{"raw":{"language":"json"}}},"url":"{{url}}/api/v1/device"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"msg\": \"Please provide valid values\",\n    \"moreInfo\": [\n        {\n            \"value\": \"1233\",\n            \"msg\": \"Invalid value\",\n            \"param\": \"type\",\n            \"location\": \"body\"\n        }\n    ]\n}"}],"_postman_id":"5ba50402-78c7-4208-b033-d0514aea3657"},{"name":"Get List of Devices","id":"78833c42-c997-4fdb-aac6-86f8d62cca45","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"x-token","value":"{{access_token}}","type":"text"}],"url":"{{url}}/api/v1/device","description":"<p>Get a list of created devices with filter, sorting and pagination options.</p>\n<h4 id=\"status-query-param\"><em>status</em> query param</h4>\n<p>Allows us to filter devices by network connection status options: [<strong>\"connected\"</strong>, <strong>\"disconnected\"</strong>] </p>\n<h4 id=\"search-query-param\"><em>search</em> query param</h4>\n<p>Allows us to filter devices by their name</p>\n<h4 id=\"sort-query-param\"><em>sort</em> query param</h4>\n<p>Allows us to sort devices by the date of creation: [<strong>\"oldest</strong>, <strong>\"latest\"</strong>] and by their name: [<strong>\"a-z</strong>, <strong>\"z-a\"</strong>]</p>\n<h4 id=\"page-query-param\"><em>page</em> query param</h4>\n<p>Allows us to add pagination. By default the max number of entities by each request is 10.</p>\n","urlObject":{"path":["api","v1","device"],"host":["{{url}}"],"query":[{"disabled":true,"description":{"content":"<p>optional query param</p>\n","type":"text/plain"},"key":"status","value":"\"connected\""},{"disabled":true,"description":{"content":"<p>optional query param</p>\n","type":"text/plain"},"key":"search","value":"\"device name\""},{"disabled":true,"description":{"content":"<p>optional query param</p>\n","type":"text/plain"},"key":"page","value":"1"},{"disabled":true,"key":"sort","value":"\"latest\""}],"variable":[]}},"response":[{"id":"ddd718d6-9750-4211-bc45-7ff436514d5a","name":"Get Devices","originalRequest":{"method":"GET","header":[{"key":"x-token","value":"{{access_token}}","type":"text"}],"url":"{{url}}/api/v1/device"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"msg\": \"success\",\n    \"devices\": [\n        {\n            \"_id\": \"62b9d151b8bb9311eb64170d\",\n            \"userId\": \"62b9cc872420ba1a6e06128e\",\n            \"token\": \"5ba0fdf0ce43f5828df8b864100871a8bf60ed8f09f35bbe18215a208fb5e0d1\",\n            \"name\": \"kitchen_device_1\",\n            \"mac\": \"74:69:69:2D:30:08\",\n            \"connected\": false,\n            \"lastConnected\": \"2022-08-02T19:41:18.958Z\",\n            \"lastReport\": \"2022-08-02T19:41:18.958Z\",\n            \"type\": 1\n        },\n        {\n            \"_id\": \"62cf09da61236943ec42d5c5\",\n            \"userId\": \"62b9cc872420ba1a6e06128e\",\n            \"token\": \"85a976a57457eccf73a0b6d5cdd7d695cd795a69b12b1d49c31b729225fff7df\",\n            \"name\": \"3 phase monitor\",\n            \"type\": 2,\n            \"mac\": \"FF:FF:FF:FF:FF:01\",\n            \"connected\": false\n        }\n    ],\n    \"totalDevices\": 2,\n    \"numOfPages\": 1\n}"},{"id":"db5ce262-c56c-4017-9b3d-ba92fe5a1433","name":"Get All Devices - 400(invalid/expired access Token)","originalRequest":{"method":"GET","header":[{"key":"x-token","value":"{{access_token}}","type":"text"}],"url":"{{url}}/api/v1/device"},"code":400,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"msg\": \"Authentication Invalid\",\n    \"moreInfo\": [\n        \"error: TokenExpiredError, msg: jwt expired \"\n    ]\n}"},{"id":"deb80264-4fa4-4f8c-8d65-3a8f25751288","name":"Get All Devices - 400(missed access Token in the Headers)","originalRequest":{"method":"GET","header":[{"key":"x-token","value":"{{access_token}}","type":"text"}],"url":"{{url}}/api/v1/device"},"code":400,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"msg\": \"Authentication Invalid\",\n    \"moreInfo\": [\n        \"Token is not present in the headers\"\n    ]\n}"}],"_postman_id":"78833c42-c997-4fdb-aac6-86f8d62cca45"},{"name":"Get Device by Id","id":"57b22198-4942-44fc-aab8-3e25d9cb7529","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"x-token","value":"{{access_token}}","type":"text"}],"url":"{{url}}/api/v1/device/61fd5c9a2865b16216c97e1f","description":"<p>Get an unique device by <strong>id</strong> and the value must be a <strong>MongoDB ObjectId</strong> type.</p>\n","urlObject":{"path":["api","v1","device","61fd5c9a2865b16216c97e1f"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[{"id":"374996f8-95aa-4460-b40b-7ea55f9953a5","name":"Get Device by Id","originalRequest":{"method":"GET","header":[{"key":"x-token","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2MWZjMTkwM2YwMWJlMDBiZjgxZmY0MDAiLCJpYXQiOjE2NDM5OTIzNDAsImV4cCI6MTY0Mzk5NTk0MH0.zaPCWxzPnUqIWA6L2xwf6TYA2lGTI1xv8Cz_o8tTPHA","type":"text"}],"url":"{{url}}/api/v1/device/61fd5c9a2865b16216c97e1f"},"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":null},{"id":"ec66ff2c-0e09-4c9e-9dbc-2a8796854152","name":"Get Device - 400 (invalid/expired access token)","originalRequest":{"method":"GET","header":[{"key":"x-token","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2MWZjMTkwM2YwMWJlMDBiZjgxZmY0MDAiLCJpYXQiOjE2NDM5OTIzNDAsImV4cCI6MTY0Mzk5NTk0MH0.zaPCWxzPnUqIWA6L2xwf6TYA2lGTI1xv8Cz_o8tTPHA","type":"text"}],"url":"{{url}}/api/v1/device/61fd5c9a2865b16216c97e1f"},"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"msg\": \"Authentication Invalid\",\n    \"moreInfo\": [\n        \"error: TokenExpiredError, msg: jwt expired \"\n    ]\n}"},{"id":"e35b8d54-57d3-49c8-95a8-8dfcebc0bb99","name":"Get Device - 400 (Device not found for provided Id)","originalRequest":{"method":"GET","header":[{"key":"x-token","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2MWZjMTkwM2YwMWJlMDBiZjgxZmY0MDAiLCJpYXQiOjE2NDM5OTIzNDAsImV4cCI6MTY0Mzk5NTk0MH0.zaPCWxzPnUqIWA6L2xwf6TYA2lGTI1xv8Cz_o8tTPHA","type":"text"}],"url":"{{url}}/api/v1/device/61fd5c9a2865b16216c97e1f"},"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"msg\": \"No Device with id :61fd5c9a2865b16216c97e1f\",\n    \"moreInfo\": []\n}"},{"id":"5aa7fed1-2b55-4600-9b5e-3a2e34a52525","name":"Get Device - 400 (Invalid device Id format)","originalRequest":{"method":"GET","header":[{"key":"x-token","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2MWZjMTkwM2YwMWJlMDBiZjgxZmY0MDAiLCJpYXQiOjE2NDM5OTIzNDAsImV4cCI6MTY0Mzk5NTk0MH0.zaPCWxzPnUqIWA6L2xwf6TYA2lGTI1xv8Cz_o8tTPHA","type":"text"}],"url":"{{url}}/api/v1/device/dfet"},"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"msg\": \"No Device with id :61fd5c9a2865b16216c97e1f\",\n    \"moreInfo\": []\n}"}],"_postman_id":"57b22198-4942-44fc-aab8-3e25d9cb7529"},{"name":"Update Device Token","id":"bb60eb36-87ad-47e7-843f-e7984f21f3ec","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[{"key":"x-token","value":"{{access_token}}","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"token\" : \"6c626a222bf6a65f782cc2c17f47d9ad2eea68d475fc11318f1a9881a6d9fzzb\"\n}","options":{"raw":{"language":"json"}}},"url":"{{url}}/api/v1/device/63084cf08e5804491fcaa4f8","description":"<p>This enables us to change the device's token. We must provide the <strong>id</strong> of the device we want to make change.</p>\n<p>The <strong>id</strong> value must be a <strong>MongoDB ObjectId</strong> type.</p>\n","urlObject":{"path":["api","v1","device","63084cf08e5804491fcaa4f8"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[{"id":"8dc73629-9945-41a7-b58b-a9561a0e6055","name":"Update Device Token - OK","originalRequest":{"method":"PUT","header":[{"key":"x-token","value":"{{access_token}}","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"token\" : \"6c626a222bf6a65f782cc2c17f47d9ad2eea68d475fc11318f1a9881a6d9fzzb\"\n}","options":{"raw":{"language":"json"}}},"url":"{{url}}/api/v1/device/6272a54269954a8870614865"},"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"msg\": \"success\",\n    \"device\": {\n        \"_id\": \"63084cf08e5804491fcaa4f8\",\n        \"userId\": \"62b9cc872420ba1a6e06128e\",\n        \"token\": \"6c626a222bf6a65f782cc2c17f47d9ad2eea68d475fc11318f1a9881a6d9fzzb\",\n        \"name\": \"device_test_1\",\n        \"type\": 1,\n        \"mac\": \"74:69:69:2D:30:02\",\n        \"connected\": false\n    }\n}"},{"id":"2e3f473b-e466-4f21-9967-d847590e5485","name":"Update Device Token - 400 (Device not found for provided Id)","originalRequest":{"method":"PUT","header":[{"key":"x-token","value":"{{access_token}}","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"token\" : \"6c626a222bf6a65f782cc2c17f47d9ad2eea68d475fc11318f1a9881a6d9fddb\"\n}","options":{"raw":{"language":"json"}}},"url":"{{url}}/api/v1/device/6272a54269954a8870614865"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"msg\": \"No device with id :6272a54269954a8870614865\",\n    \"moreInfo\": []\n}"},{"id":"b5105af2-f5ba-4ca1-814b-4497c71f06bd","name":"Update Device Token - 400 (Invalid device Id Format)","originalRequest":{"method":"PUT","header":[{"key":"x-token","value":"{{access_token}}","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"token\" : \"6c626a222bf6a65f782cc2c17f47d9ad2eea68d475fc11318f1a9881a6d9fddb\"\n}","options":{"raw":{"language":"json"}}},"url":"{{url}}/api/v1/device/123"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"msg\": \"Please provide valid values\",\n    \"moreInfo\": [\n        {\n            \"value\": \"123\",\n            \"msg\": \"Invalid value\",\n            \"param\": \"id\",\n            \"location\": \"params\"\n        }\n    ]\n}"}],"_postman_id":"bb60eb36-87ad-47e7-843f-e7984f21f3ec"},{"name":"Delete Device by Id","id":"2905ac46-7ed8-4090-8860-3bf9eb72a97e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"x-token","value":"{{access_token}}","type":"text"}],"url":"{{url}}/api/v1/device/63084cf08e5804491fcaa4f8","description":"<p>Remove a device from the registry providing an <strong>id</strong>. The <strong>id</strong> value must be a <strong>MongoDB ObjectId</strong> type.</p>\n","urlObject":{"path":["api","v1","device","63084cf08e5804491fcaa4f8"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[{"id":"623b45fa-5137-4855-84f6-972b4d9dda41","name":"Delete Device - OK","originalRequest":{"method":"DELETE","header":[{"key":"x-token","value":"{{access_token}}","type":"text"}],"url":"{{url}}/api/v1/device/63084cf08e5804491fcaa4f8"},"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"msg\": \"success\",\n    \"device\": {\n        \"_id\": \"63084cf08e5804491fcaa4f8\",\n        \"userId\": \"62b9cc872420ba1a6e06128e\",\n        \"token\": \"6c626a222bf6a65f782cc2c17f47d9ad2eea68d475fc11318f1a9881a6d9fzzb\",\n        \"name\": \"device_test_1\",\n        \"type\": 1,\n        \"mac\": \"74:69:69:2D:30:02\",\n        \"connected\": false\n    }\n}"},{"id":"143f1086-10f0-4322-bbd6-9af652b77ea1","name":"Delete Device - 400 (Device not found for provided Id)","originalRequest":{"method":"DELETE","header":[{"key":"x-token","value":"{{access_token}}","type":"text"}],"url":"{{url}}/api/v1/device/6261c15e32735b10b87e7d9b"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"msg\": \"No device with id :6261c15e32735b10b87e7d9b\",\n    \"moreInfo\": []\n}"},{"id":"908e05ab-1db3-4369-80ff-6c9f5d18d745","name":"Delete Device - 400 (Invalid device Id Format)","originalRequest":{"method":"DELETE","header":[{"key":"x-token","value":"{{access_token}}","type":"text"}],"url":"{{url}}/api/v1/device/6261"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"msg\": \"Please provide valid values\",\n    \"moreInfo\": [\n        {\n            \"value\": \"6261\",\n            \"msg\": \"Invalid value\",\n            \"param\": \"id\",\n            \"location\": \"params\"\n        }\n    ]\n}"}],"_postman_id":"2905ac46-7ed8-4090-8860-3bf9eb72a97e"}],"id":"d5599d0f-953e-4a16-a539-0286a0dd6b27","description":"<p>In the next end-points we'll explain how to create and manage the IoT devices. The Device entity represent a physical IoT devices and each device can have many sensors.</p>\n<h4 id=\"device-auth\">Device Auth</h4>\n<p>Before to create Sensors Readings, we will grant access to Devices to our REST API by providing a Token.</p>\n<p>That means, when device reports sensors data, it will embedded the Token to Request's Body.</p>\n<h4 id=\"data-schema\">Data Schema</h4>\n<ul>\n<li><strong>UserId</strong> (ObjectId)</li>\n<li><strong>token</strong> (string, <em>required</em>, <em>unique</em>)</li>\n<li><strong>name</strong> (string, <em>required</em>)</li>\n<li><strong>type</strong> (number, <em>required</em>)</li>\n<li><strong>mac</strong> (string, <em>required</em>)</li>\n<li><strong>connected</strong> (boolean, <em>optional</em>, default: false)</li>\n<li><strong>LastConnected</strong> (Date, default: null)</li>\n<li><strong>LastDisconnected</strong> (Date, default: null)</li>\n<li><strong>LastReport</strong> (Date, default: null)</li>\n</ul>\n","_postman_id":"d5599d0f-953e-4a16-a539-0286a0dd6b27"},{"name":"Read","item":[{"name":"Create Read","id":"eaae311e-d505-4130-b889-8d8437cdc174","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"token\": \"85a976a57457eccf73a0b6d5cdd7d695cd795a69b12b1d49c31b729225fff7df\",\n    \"timestamp\": \"1653335761\",\n    \"metadata\": [\n        {\n            \"type\": \"CURRENT\",\n            \"value\": 254,\n            \"unit\": \"A\"\n        },\n        {\n            \"type\": \"VOLT_A\",\n            \"value\": 22550,\n            \"unit\": \"V\"\n        },\n        {\n            \"type\": \"TOTAL_ACTIVE_KWH\",\n            \"value\": 16588,\n            \"unit\": \"kwh\"\n        },\n        {\n            \"type\": \"ACTIVE_POWER\",\n            \"value\": 16588,\n            \"unit\": \"kw\"\n        },\n        {\n            \"type\": \"POWER_FACTOR\",\n            \"value\": 16588,\n            \"unit\": \"NA\"\n        },\n        {\n            \"type\": \"FREQUENCY\",\n            \"value\": 16588,\n            \"unit\": \"Hz\"\n        }\n    ]\n}","options":{"raw":{"language":"json"}}},"url":"{{url}}/api/v1/read","description":"<p>This end-point is consumed only by the IoT devices. Each IoT device create a new Read document each 10 seconds.</p>\n","urlObject":{"path":["api","v1","read"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[{"id":"26c3def7-0c3f-4ec0-82f1-2c6b5e592918","name":"Create Read - OK","originalRequest":{"method":"POST","header":[{"key":"x-token","value":"{{access_token}}","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"token\": \"e7d332795b07a345e0b68be9392ca9e2c0eb6e9e7ba4da1f0dd2d8f8f811eee6\",\n    \n            \"timestamp\": \"1653335761\",\n            \"metadata\": [\n                {\n                    \"type\": \"CURRENT_A\",\n                    \"value\": 254,\n                    \"unit\": \"A\",\n                    \"_id\": \"628be5da11c34a0f9e3d0133\"\n                },\n                {\n                    \"type\": \"VOLT_A\",\n                    \"value\": 22550,\n                    \"unit\": \"V\",\n                    \"_id\": \"628be5da11c34a0f9e3d0134\"\n                },\n                {\n                    \"type\": \"TOTAL_ACTIVE_KWH\",\n                    \"value\": 16588,\n                    \"unit\": \"kwh\",\n                    \"_id\": \"628be5da11c34a0f9e3d0135\"\n                }\n            ]\n        }","options":{"raw":{"language":"json"}}},"url":"{{url}}/api/v1/read"},"code":200,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"msg\": \"success\"\n}"},{"id":"dc85523e-c8be-4817-a483-7c41be3cad0e","name":"Create Read -400 (Invalid Sensor Unit)","originalRequest":{"method":"POST","header":[{"key":"x-token","value":"{{access_token}}","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"token\": \"e7d332795b07a345e0b68be9392ca9e2c0eb6e9e7ba4da1f0dd2d8f8f811eee6\",\n    \n            \"timestamp\": \"1653335761\",\n            \"metadata\": [\n                {\n                    \"type\": \"CURRENT_A\",\n                    \"value\": 254,\n                    \"unit\": \"A\",\n                    \"_id\": \"628be5da11c34a0f9e3d0133\"\n                },\n                {\n                    \"type\": \"VOLT_A\",\n                    \"value\": 22550,\n                    \"unit\": \"V\",\n                    \"_id\": \"628be5da11c34a0f9e3d0134\"\n                },\n                {\n                    \"type\": \"TOTAL_ACTIVE_KWH\",\n                    \"value\": 16588,\n                    \"unit\": \"kwh\",\n                    \"_id\": \"628be5da11c34a0f9e3d0135\"\n                }\n            ]\n        }","options":{"raw":{"language":"json"}}},"url":"{{url}}/api/v1/read"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"errors\": [\n        {\n            \"value\": \"AMPER\",\n            \"msg\": \"Invalid value\",\n            \"param\": \"metadata[0].unit\",\n            \"location\": \"body\"\n        }\n    ]\n}"},{"id":"4f0367db-4eff-4aa3-bcc1-6b07e38d66e7","name":"Create Read -400 (Invalid Sensor Type)","originalRequest":{"method":"POST","header":[{"key":"x-token","value":"{{access_token}}","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"token\": \"e7d332795b07a345e0b68be9392ca9e2c0eb6e9e7ba4da1f0dd2d8f8f811eee6\",\n    \n            \"timestamp\": \"1653335761\",\n            \"metadata\": [\n                {\n                    \"type\": \"CURRENT_A\",\n                    \"value\": 254,\n                    \"unit\": \"A\",\n                    \"_id\": \"628be5da11c34a0f9e3d0133\"\n                },\n                {\n                    \"type\": \"VOLT_A\",\n                    \"value\": 22550,\n                    \"unit\": \"V\",\n                    \"_id\": \"628be5da11c34a0f9e3d0134\"\n                },\n                {\n                    \"type\": \"TOTAL_ACTIVE_KWH\",\n                    \"value\": 16588,\n                    \"unit\": \"kwh\",\n                    \"_id\": \"628be5da11c34a0f9e3d0135\"\n                }\n            ]\n        }","options":{"raw":{"language":"json"}}},"url":"{{url}}/api/v1/read"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"errors\": [\n        {\n            \"value\": \"CURRENT\",\n            \"msg\": \"Invalid value\",\n            \"param\": \"metadata[0].type\",\n            \"location\": \"body\"\n        }\n    ]\n}"},{"id":"9b0608bb-f862-4f94-b0b4-5ae769d6ede0","name":"Create Read - 400 (Device not found with Token)","originalRequest":{"method":"POST","header":[{"key":"x-token","value":"{{access_token}}","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"token\": \"e7d332795b07a345e0b68be9392ca9e2c0eb6e9e7ba4da1f0dd2d8f8f811eee6\",\n    \n            \"timestamp\": \"1653335761\",\n            \"metadata\": [\n                {\n                    \"type\": \"CURRENT_A\",\n                    \"value\": 254,\n                    \"unit\": \"A\",\n                    \"_id\": \"628be5da11c34a0f9e3d0133\"\n                },\n                {\n                    \"type\": \"VOLT_A\",\n                    \"value\": 22550,\n                    \"unit\": \"V\",\n                    \"_id\": \"628be5da11c34a0f9e3d0134\"\n                },\n                {\n                    \"type\": \"TOTAL_ACTIVE_KWH\",\n                    \"value\": 16588,\n                    \"unit\": \"kwh\",\n                    \"_id\": \"628be5da11c34a0f9e3d0135\"\n                }\n            ]\n        }","options":{"raw":{"language":"json"}}},"url":"{{url}}/api/v1/read"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"msg\": \"No Device with token :e7d332795b07a345e0b68be9392ca9e2c0eb6e9e7ba4da1f0dd2d8f8f811eee6\",\n    \"moreInfo\": []\n}"},{"id":"6f69e2db-6dc5-4802-80fa-530b5e07bda5","name":"Create Read - 400 (Invalid Device Token)","originalRequest":{"method":"POST","header":[{"key":"x-token","value":"{{access_token}}","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"token\": \"e7d332795b07a345e0b68be9392ca9e2c0eb6e9e7ba4da1f0dd2d8f8f811eee6\",\n    \n            \"timestamp\": \"1653335761\",\n            \"metadata\": [\n                {\n                    \"type\": \"CURRENT_A\",\n                    \"value\": 254,\n                    \"unit\": \"A\",\n                    \"_id\": \"628be5da11c34a0f9e3d0133\"\n                },\n                {\n                    \"type\": \"VOLT_A\",\n                    \"value\": 22550,\n                    \"unit\": \"V\",\n                    \"_id\": \"628be5da11c34a0f9e3d0134\"\n                },\n                {\n                    \"type\": \"TOTAL_ACTIVE_KWH\",\n                    \"value\": 16588,\n                    \"unit\": \"kwh\",\n                    \"_id\": \"628be5da11c34a0f9e3d0135\"\n                }\n            ]\n        }","options":{"raw":{"language":"json"}}},"url":"{{url}}/api/v1/read"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"errors\": [\n        {\n            \"value\": \"e7d332795b07a345e0b68be9392ca9e2c0eb6e9\",\n            \"msg\": \"Invalid value\",\n            \"param\": \"token\",\n            \"location\": \"body\"\n        }\n    ]\n}"}],"_postman_id":"eaae311e-d505-4130-b889-8d8437cdc174"},{"name":"Get All Reads","id":"ddf0552c-7336-4543-ac56-6cee221752c0","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"x-token","value":"{{access_token}}","type":"text"}],"url":"{{url}}/api/v1/read?deviceId=61fd5c9a2865b16216c97e1f&type=lastMinute","description":"<p>Reading all sensors values providing a deviceId and pagination params.</p>\n","urlObject":{"path":["api","v1","read"],"host":["{{url}}"],"query":[{"key":"deviceId","value":"61fd5c9a2865b16216c97e1f"},{"key":"type","value":"lastMinute"},{"disabled":true,"key":"","value":null}],"variable":[]}},"response":[{"id":"7c788084-88d0-46c8-b840-203b46fe093f","name":"Get All Reads","originalRequest":{"method":"GET","header":[{"key":"x-token","value":"{{access_token}}","type":"text"}],"url":{"raw":"{{url}}/api/v1/read?type=lastMinute&deviceId=61fd5c9a2865b16216c97e1f","host":["{{url}}"],"path":["api","v1","read"],"query":[{"key":"type","value":"lastMinute","description":"Especify we want to query the last minute sensors reads "},{"key":"","value":null,"disabled":true},{"key":"deviceId","value":"61fd5c9a2865b16216c97e1f"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"msg\": \"success\",\n    \"reads\": {\n        \"deviceId\": \"62b9d151b8bb9311eb64170d\",\n        \"current\": [\n            {\n                \"timestamp\": \"2022-08-02T19:41:18.000Z\",\n                \"value\": 1.7930189263402567\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:41:07.000Z\",\n                \"value\": 1.4915821831543936\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:40:57.000Z\",\n                \"value\": 5.041983690243526\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:40:46.000Z\",\n                \"value\": 2.032545142494955\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:40:35.000Z\",\n                \"value\": 6.046859066698829\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:40:24.000Z\",\n                \"value\": 5.001599478996731\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:40:12.000Z\",\n                \"value\": 2.6527771712943853\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:40:02.000Z\",\n                \"value\": 4.476647128284629\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:39:51.000Z\",\n                \"value\": 5.863014952013075\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:39:40.000Z\",\n                \"value\": 3.691112501176205\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:39:30.000Z\",\n                \"value\": 1.4321075291411955\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:39:19.000Z\",\n                \"value\": 4.073485356288253\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:39:08.000Z\",\n                \"value\": 2.958122614024914\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:38:57.000Z\",\n                \"value\": 3.0463072619199134\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:38:46.000Z\",\n                \"value\": 4.24650726446445\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:38:35.000Z\",\n                \"value\": 2.725197578890559\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:38:23.000Z\",\n                \"value\": 3.6695791798451225\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:38:12.000Z\",\n                \"value\": 2.5784066097633462\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:38:01.000Z\",\n                \"value\": 4.223017341765361\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:37:51.000Z\",\n                \"value\": 5.020015586690141\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:37:40.000Z\",\n                \"value\": 4.26252603788514\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:37:29.000Z\",\n                \"value\": 5.733847765323938\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:37:19.000Z\",\n                \"value\": 2.7288630247575005\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:37:08.000Z\",\n                \"value\": 3.438229647134287\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:36:57.000Z\",\n                \"value\": 1.6746209279605226\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:36:45.000Z\",\n                \"value\": 5.293027848169402\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:36:34.000Z\",\n                \"value\": 2.5462896725201007\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:36:22.000Z\",\n                \"value\": 2.9337633186659557\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:36:11.000Z\",\n                \"value\": 3.2177802325521445\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:36:00.000Z\",\n                \"value\": 1.3126421124811696\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:35:49.000Z\",\n                \"value\": 1.3351306772248477\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:35:38.000Z\",\n                \"value\": 2.95135835636606\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:35:26.000Z\",\n                \"value\": 3.3020811178098994\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:35:13.000Z\",\n                \"value\": 4.654835096593006\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:35:02.000Z\",\n                \"value\": 3.499038153601033\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:34:51.000Z\",\n                \"value\": 3.459556878383437\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:34:39.000Z\",\n                \"value\": 3.2777507313900975\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:34:28.000Z\",\n                \"value\": 4.1490672147191585\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:34:18.000Z\",\n                \"value\": 5.630626921553023\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:34:07.000Z\",\n                \"value\": 2.9458816697919095\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:33:56.000Z\",\n                \"value\": 3.320457566794211\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:33:45.000Z\",\n                \"value\": 1.2300305374880078\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:33:34.000Z\",\n                \"value\": 6.064568582100849\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:33:24.000Z\",\n                \"value\": 4.482906067588541\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:33:13.000Z\",\n                \"value\": 3.787181176488456\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:33:03.000Z\",\n                \"value\": 4.3547348117173\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:32:51.000Z\",\n                \"value\": 1.2509485560195923\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:32:40.000Z\",\n                \"value\": 3.1821872950801677\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:32:29.000Z\",\n                \"value\": 5.6136174270458\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:32:17.000Z\",\n                \"value\": 4.099959778215225\n            }\n        ],\n        \"lineCurrent\": 1.7930189263402567,\n        \"voltage\": [\n            {\n                \"timestamp\": \"2022-08-02T19:41:18.000Z\",\n                \"value\": 125.29904445209877\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:41:07.000Z\",\n                \"value\": 126.09560709544043\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:40:57.000Z\",\n                \"value\": 129.3286754639776\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:40:46.000Z\",\n                \"value\": 128.9542009832362\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:40:35.000Z\",\n                \"value\": 124.31615993283837\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:40:24.000Z\",\n                \"value\": 126.73269114686396\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:40:12.000Z\",\n                \"value\": 124.51796605180073\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:40:02.000Z\",\n                \"value\": 128.71972810881132\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:39:51.000Z\",\n                \"value\": 125.39856112812201\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:39:40.000Z\",\n                \"value\": 124.63643402431065\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:39:30.000Z\",\n                \"value\": 130.27945976577269\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:39:19.000Z\",\n                \"value\": 125.33233814004376\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:39:08.000Z\",\n                \"value\": 124.99306063962791\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:38:57.000Z\",\n                \"value\": 125.92467128938657\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:38:46.000Z\",\n                \"value\": 127.67064269003934\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:38:35.000Z\",\n                \"value\": 125.55366026130137\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:38:23.000Z\",\n                \"value\": 129.82381356325664\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:38:12.000Z\",\n                \"value\": 126.23734750756785\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:38:01.000Z\",\n                \"value\": 129.2815325976609\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:37:51.000Z\",\n                \"value\": 124.01321047776678\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:37:40.000Z\",\n                \"value\": 128.4762240455946\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:37:29.000Z\",\n                \"value\": 125.22698221512638\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:37:19.000Z\",\n                \"value\": 129.73827595249398\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:37:08.000Z\",\n                \"value\": 129.6518209056037\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:36:57.000Z\",\n                \"value\": 130.19125617899172\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:36:45.000Z\",\n                \"value\": 131.04223413268582\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:36:34.000Z\",\n                \"value\": 126.32008908407488\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:36:22.000Z\",\n                \"value\": 125.769377181376\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:36:11.000Z\",\n                \"value\": 127.65741990419585\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:36:00.000Z\",\n                \"value\": 126.6055799564595\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:35:49.000Z\",\n                \"value\": 125.26664213444651\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:35:38.000Z\",\n                \"value\": 129.20984263476484\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:35:26.000Z\",\n                \"value\": 127.35663446479019\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:35:13.000Z\",\n                \"value\": 129.6048753181609\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:35:02.000Z\",\n                \"value\": 130.99777146553035\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:34:51.000Z\",\n                \"value\": 125.84396073380078\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:34:39.000Z\",\n                \"value\": 130.24458046857853\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:34:28.000Z\",\n                \"value\": 127.29559162437377\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:34:18.000Z\",\n                \"value\": 125.17936154630857\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:34:07.000Z\",\n                \"value\": 126.09392569781228\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:33:56.000Z\",\n                \"value\": 124.9187830184129\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:33:45.000Z\",\n                \"value\": 126.95899271921613\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:33:34.000Z\",\n                \"value\": 130.2334940385281\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:33:24.000Z\",\n                \"value\": 126.34881827573275\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:33:13.000Z\",\n                \"value\": 127.55257716807222\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:33:03.000Z\",\n                \"value\": 124.42727919023622\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:32:51.000Z\",\n                \"value\": 129.97119470565278\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:32:40.000Z\",\n                \"value\": 127.47097362952425\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:32:29.000Z\",\n                \"value\": 126.48090804078086\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:32:17.000Z\",\n                \"value\": 131.10144175672707\n            }\n        ],\n        \"lineVoltage\": 125.29904445209877,\n        \"activeKwh\": [\n            {\n                \"timestamp\": \"2022-08-02T19:41:18.000Z\",\n                \"value\": 12.636229316561412\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:41:07.000Z\",\n                \"value\": 5.558874888485927\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:40:57.000Z\",\n                \"value\": 18.141048954045132\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:40:46.000Z\",\n                \"value\": 23.113528231158732\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:40:35.000Z\",\n                \"value\": 12.176070237659818\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:40:24.000Z\",\n                \"value\": 15.696949858731085\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:40:12.000Z\",\n                \"value\": 8.341152653401485\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:40:02.000Z\",\n                \"value\": 20.628142632732004\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:39:51.000Z\",\n                \"value\": 12.235399542608452\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:39:40.000Z\",\n                \"value\": 23.075601433746073\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:39:30.000Z\",\n                \"value\": 5.530304399586602\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:39:19.000Z\",\n                \"value\": 22.820363540706143\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:39:08.000Z\",\n                \"value\": 5.846965970827297\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:38:57.000Z\",\n                \"value\": 19.04706130841798\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:38:46.000Z\",\n                \"value\": 13.44513002219718\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:38:35.000Z\",\n                \"value\": 10.343451006808667\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:38:23.000Z\",\n                \"value\": 12.10550035818298\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:38:12.000Z\",\n                \"value\": 9.0594028661377\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:38:01.000Z\",\n                \"value\": 18.653894484643896\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:37:51.000Z\",\n                \"value\": 22.98861941363688\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:37:40.000Z\",\n                \"value\": 8.442858710784282\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:37:29.000Z\",\n                \"value\": 5.691892561884061\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:37:19.000Z\",\n                \"value\": 12.545328515628338\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:37:08.000Z\",\n                \"value\": 5.928984491369409\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:36:57.000Z\",\n                \"value\": 12.990102651585282\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:36:45.000Z\",\n                \"value\": 20.573930344265737\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:36:34.000Z\",\n                \"value\": 15.445146778672779\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:36:22.000Z\",\n                \"value\": 8.096790437035438\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:36:11.000Z\",\n                \"value\": 19.028937950806284\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:36:00.000Z\",\n                \"value\": 22.21971347443642\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:35:49.000Z\",\n                \"value\": 13.826314634927744\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:35:38.000Z\",\n                \"value\": 16.834256892604763\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:35:26.000Z\",\n                \"value\": 22.27169569314526\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:35:13.000Z\",\n                \"value\": 21.99611783559787\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:35:02.000Z\",\n                \"value\": 9.998946421406961\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:34:51.000Z\",\n                \"value\": 7.387738247421311\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:34:39.000Z\",\n                \"value\": 21.845567210862882\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:34:28.000Z\",\n                \"value\": 6.097749488045635\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:34:18.000Z\",\n                \"value\": 6.754604193249754\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:34:07.000Z\",\n                \"value\": 11.485658905216443\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:33:56.000Z\",\n                \"value\": 13.15149080832951\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:33:45.000Z\",\n                \"value\": 9.355800554500105\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:33:34.000Z\",\n                \"value\": 5.956199710283749\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:33:24.000Z\",\n                \"value\": 13.389616142638431\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:33:13.000Z\",\n                \"value\": 8.7426175684787\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:33:03.000Z\",\n                \"value\": 20.79126162869814\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:32:51.000Z\",\n                \"value\": 14.473162511983325\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:32:40.000Z\",\n                \"value\": 12.197452666378943\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:32:29.000Z\",\n                \"value\": 20.859461676972376\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:32:17.000Z\",\n                \"value\": 17.509100798476386\n            }\n        ],\n        \"energy\": 12.636229316561412,\n        \"frequencyTS\": [\n            {\n                \"timestamp\": \"2022-08-02T19:41:18.000Z\",\n                \"value\": 60.28646270757918\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:41:07.000Z\",\n                \"value\": 61.04278948882201\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:40:57.000Z\",\n                \"value\": 59.46016864825936\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:40:46.000Z\",\n                \"value\": 60.410515523967575\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:40:35.000Z\",\n                \"value\": 61.3772224272105\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:40:24.000Z\",\n                \"value\": 62.585551844804336\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:40:12.000Z\",\n                \"value\": 60.58668975835112\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:40:02.000Z\",\n                \"value\": 58.27705569748467\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:39:51.000Z\",\n                \"value\": 60.87280472255529\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:39:40.000Z\",\n                \"value\": 59.49240760012265\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:39:30.000Z\",\n                \"value\": 58.797753790985446\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:39:19.000Z\",\n                \"value\": 60.70188431992331\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:39:08.000Z\",\n                \"value\": 60.10875799784296\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:38:57.000Z\",\n                \"value\": 58.83445185655904\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:38:46.000Z\",\n                \"value\": 60.48843153847201\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:38:35.000Z\",\n                \"value\": 57.58125249036532\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:38:23.000Z\",\n                \"value\": 60.16276093336364\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:38:12.000Z\",\n                \"value\": 59.424705038282674\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:38:01.000Z\",\n                \"value\": 60.40070254162042\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:37:51.000Z\",\n                \"value\": 61.532270303258954\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:37:40.000Z\",\n                \"value\": 61.34090153203259\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:37:29.000Z\",\n                \"value\": 58.19792280299146\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:37:19.000Z\",\n                \"value\": 62.293683143911316\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:37:08.000Z\",\n                \"value\": 58.774635228956065\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:36:57.000Z\",\n                \"value\": 60.12055242557173\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:36:45.000Z\",\n                \"value\": 60.21437764795503\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:36:34.000Z\",\n                \"value\": 61.811681504977955\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:36:22.000Z\",\n                \"value\": 62.52321219988631\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:36:11.000Z\",\n                \"value\": 57.49433358811896\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:36:00.000Z\",\n                \"value\": 60.37035813657303\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:35:49.000Z\",\n                \"value\": 57.80426565721219\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:35:38.000Z\",\n                \"value\": 59.27166340820757\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:35:26.000Z\",\n                \"value\": 59.146372966330844\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:35:13.000Z\",\n                \"value\": 60.56505038096724\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:35:02.000Z\",\n                \"value\": 60.4011285713741\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:34:51.000Z\",\n                \"value\": 59.2387844663012\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:34:39.000Z\",\n                \"value\": 57.274157367893054\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:34:28.000Z\",\n                \"value\": 57.62142832105329\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:34:18.000Z\",\n                \"value\": 59.111571269316435\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:34:07.000Z\",\n                \"value\": 62.50365375702689\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:33:56.000Z\",\n                \"value\": 57.1691048462434\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:33:45.000Z\",\n                \"value\": 60.939581169070415\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:33:34.000Z\",\n                \"value\": 61.59215220939937\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:33:24.000Z\",\n                \"value\": 61.89088335394992\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:33:13.000Z\",\n                \"value\": 60.751355473290225\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:33:03.000Z\",\n                \"value\": 62.775455599046225\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:32:51.000Z\",\n                \"value\": 58.577832135196694\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:32:40.000Z\",\n                \"value\": 61.17378855982963\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:32:29.000Z\",\n                \"value\": 59.96331445046143\n            },\n            {\n                \"timestamp\": \"2022-08-02T19:32:17.000Z\",\n                \"value\": 59.38078950181471\n            }\n        ],\n        \"frequency\": 60.28646270757918,\n        \"pf\": 1.2042924292862414,\n        \"power\": 9.076007849818868\n    }\n}"}],"_postman_id":"ddf0552c-7336-4543-ac56-6cee221752c0"}],"id":"6fd26171-5ce9-41ea-bef8-df629fb02994","description":"<p>This section will describe the end-points that allow us to create and query device's sensors readings.</p>\n<h4 id=\"reads-schema\">Reads Schema</h4>\n<ul>\n<li><strong>deviceId</strong> (ObjectId)</li>\n<li><strong>timestamp</strong> (Date)</li>\n<li><strong>metadata</strong> (SensorData Schema[] )</li>\n</ul>\n<h4 id=\"sensordata-schema\">SensorData Schema</h4>\n<ul>\n<li><strong>type</strong> (String, <em>required</em>). Options: <ul>\n<li>\"CURRENT_A\"</li>\n<li>\"CURRENT_B\"</li>\n<li>\"CURRENT_C\"</li>\n<li>\"VOLT_A\"</li>\n<li>\"VOLT_B\"</li>\n<li>\"VOLT_C\"</li>\n<li>\"TOTAL_ACTIVE_KWH\"</li>\n<li>\"ACTIVE_POWER\"</li>\n<li>\"POWER_FACTOR\"</li>\n<li>\"FREQUENCY\"</li>\n</ul>\n</li>\n<li><strong>value</strong> (number, <em>required</em>)</li>\n<li><strong>unit</strong> (string, <em>required</em>). Options: <ul>\n<li>\"A\" </li>\n<li>\"VOLT\"</li>\n<li>\"kwh\"</li>\n<li>\"kw\"</li>\n<li>\"Hz\"</li>\n</ul>\n</li>\n</ul>\n","_postman_id":"6fd26171-5ce9-41ea-bef8-df629fb02994"}]}