{"info":{"_postman_id":"1795eea3-8322-8901-d048-0245ef49ca3b","name":"API socket V1.3 (Swimo V3)","description":"<html><head></head><body><p>This API allow to you to send real time action and retrieve real time datas from connected devices Swimo, Maestro or Solo, using HTTPS:// requests with <strong>socket.swimo.io</strong></p>\n<p>Eventually for development purpose and API calls limitation, you are able to listen on a WWS:// with <strong>now.swimo.io</strong></p>\n<p>For special needs, you are also able to contact directly your controller from our Socket service on <strong>sock.swimo.io</strong></p>\n<p>To consume the API, you need in any case a valid Token, created by your email/ password and 30 days available. (could be 90 days, availability date is indicate in the reply)</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"3078136","collectionId":"1795eea3-8322-8901-d048-0245ef49ca3b","publishedId":"SzKQwzdk","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2022-01-21T07:45:07.000Z"},"item":[{"name":"https://socket.swimo.io/cgi-bin/get_token","id":"68d84e2d-817c-749e-f0a7-475d14df939d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"user","value":"myemail@email.com","description":"<p>valid email for admin user or pseudo for anonymous user (limited use)</p>\n"},{"key":"code","value":"testdemo","description":"<p>your password </p>\n"}],"url":"https://socket.swimo.io/cgi-bin/get_token","description":"<p>Get a valid token to consume the API</p>\n","urlObject":{"protocol":"https","path":["cgi-bin","get_token"],"host":["socket","swimo","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"68d84e2d-817c-749e-f0a7-475d14df939d"},{"name":"https://socket.swimo.io/cgi-bin/get_all","id":"cc9bd74b-99e6-a1fd-b058-26f0f304b3de","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"appid","value":"a valid token","description":"<p>Appid</p>\n"}],"url":"https://socket.swimo.io/cgi-bin/get_all","description":"<p>For multi systems by user, the first reply send a list of all systems under this account with a valid token # for that uniq token as a system (controller), <strong>get_all</strong> without parameters reply all content for this account.</p>\n<hr />\n<p><em>#add optional parameter to get specific reply like</em></p>\n<p>devices = 0 or device_number = to get specific device</p>\n<p>usefull for strips , strip_number, sensors, sensor_number as well.</p>\n<hr />\n<p>#add parameter <strong>history</strong> with a <strong>number of days</strong> since now to get all records</p>\n<p>or add a <strong>start_date</strong> and <strong>stop_date</strong> to retrieve records between 2 dates</p>\n<p>format is <strong>yyyy:mm:dd</strong></p>\n","urlObject":{"protocol":"https","path":["cgi-bin","get_all"],"host":["socket","swimo","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"cc9bd74b-99e6-a1fd-b058-26f0f304b3de"},{"name":"https://socket.swimo.io/cgi-bin/set_pass","id":"97eed159-7c98-94be-5c1f-f8ad59f5d043","request":{"method":"GET","header":[{"key":"user","value":"frederick868@gmail.com","description":"<p> add email in anycase</p>\n"},{"key":"code","value":"testosteron","description":"<p>for renew service</p>\n"},{"key":"appid","value":"azerty","description":"<p>for renew service (reveived with reset service)</p>\n"}],"body":{"mode":"formdata","formdata":[]},"url":"https://socket.swimo.io/cgi-bin/set_pass?key=1","description":"<p>To reset a password, with a valid email.. or with noticifaction push on a register phone pair with pseudo</p>\n<p>and to renew a new password with a temporary token received by email or push</p>\n","urlObject":{"protocol":"https","path":["cgi-bin","set_pass"],"host":["socket","swimo","io"],"query":[{"description":{"content":"<p>0 = reset service / 1 = renew service</p>\n","type":"text/plain"},"key":"key","value":"1"}],"variable":[]}},"response":[],"_postman_id":"97eed159-7c98-94be-5c1f-f8ad59f5d043"},{"name":"https://socket.swimo.io/cgi-bin/update_all","id":"1c78f75b-7fa3-84eb-93dc-3f758c861a44","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"appid","value":"token"}],"url":"https://socket.swimo.io/cgi-bin/update_all?key=sys_volume&value=32,5&number=1","description":"<p>to update any variable from get_all using the same key parameter<br />need a sensors, actions, system, user, alarms, favorites and pair<br />value, where key is \"device-index\" as example and value is 0, that represent first value of the array \"device_mode_display\": \"ON/OFF/AUTO\".</p>\n<p>Some key should be never changed without a good knowledge of the implications on the machine side.</p>\n<p>To know more about the controller you are programming, please visit user guide on Orkestron.Com</p>\n<p>to understand risks and limitations.</p>\n","urlObject":{"protocol":"https","path":["cgi-bin","update_all"],"host":["socket","swimo","io"],"query":[{"description":{"content":"<p>key from get_all</p>\n","type":"text/plain"},"key":"key","value":"sys_volume"},{"description":{"content":"<p>value (varchar)</p>\n","type":"text/plain"},"key":"value","value":"32,5"},{"description":{"content":"<p>sensor / device number</p>\n","type":"text/plain"},"key":"number","value":"1"},{"disabled":true,"key":"type","value":null}],"variable":[]}},"response":[],"_postman_id":"1c78f75b-7fa3-84eb-93dc-3f758c861a44"},{"name":"https://socket.swimo.io/cgi-bin/set_profile","id":"b08971f4-ce4d-9d14-e923-c452a4fe1a17","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"code","value":"demo","description":"<p>password</p>\n"},{"key":"user","value":"dodododo","description":"<p>email ou pseudo</p>\n"},{"key":"appid","value":"token","description":"<p>add distributor or admin user account to hook this new account on it</p>\n"}],"url":"https://socket.swimo.io/cgi-bin/set_profile?user_phone=09999999&user_address=4+cotes+d%27ormoy%2FEssonne&user_zip=91100&user_city=Villabe&user_country=country&user_name=name&user_firstname=firstname&user_unit=metric / imperial&user_lang=FR, EN, ES, IT, PT, NL, DE","description":"<p>Create a new user with user_pseudo and user_code in Header OR to update a user account ( with valid appid in Header, and/or update existing account.<br />type = 0 is normal user ( default when no set)<br />type = 1 anonymous user (no need valid email)<br />type = 2 professionnal user (accepted only for known distributor)</p>\n<p>minimal setup<br />user_type = 1<br />user_pseudo<br />user_code<br />user_lang<br />user_unit</p>\n<p>type 0 can add full address / name, phone<br />type 2 can add more information as website....<br />Each parameter can be set separatly</p>\n","urlObject":{"protocol":"https","path":["cgi-bin","set_profile"],"host":["socket","swimo","io"],"query":[{"key":"user_phone","value":"09999999"},{"key":"user_address","value":"4+cotes+d%27ormoy%2FEssonne"},{"key":"user_zip","value":"91100"},{"key":"user_city","value":"Villabe"},{"description":{"content":"<p>to update/change email</p>\n","type":"text/plain"},"key":"user_country","value":"country"},{"key":"user_name","value":"name"},{"key":"user_firstname","value":"firstname"},{"key":"user_unit","value":"metric / imperial"},{"key":"user_lang","value":"FR, EN, ES, IT, PT, NL, DE"}],"variable":[]}},"response":[],"_postman_id":"b08971f4-ce4d-9d14-e923-c452a4fe1a17"},{"name":"https://socket.swimo.io/cgi-bin/add_all","id":"6e2e878b-ca47-c19c-1fce-cfe275f57c37","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"appid","value":"token","description":"<p>appid to update existing user</p>\n"}],"url":"https://socket.swimo.io/cgi-bin/add_all?device_number=8&device_type=35&key=device","description":"<p>to add device, sensor or scheduled,<br />device_number / device_type<br />sensor_number / sensor_type<br />action_number or device_number / slot_start /slot_stop /slot_speed (default:0)/slot_days (default: all days)</p>\n<p><strong>See get_base_list to find right type and controller documentation to find right port</strong></p>\n","urlObject":{"protocol":"https","path":["cgi-bin","add_all"],"host":["socket","swimo","io"],"query":[{"description":{"content":"<p>available action number</p>\n","type":"text/plain"},"key":"device_number","value":"8"},{"description":{"content":"<p>for action_type</p>\n","type":"text/plain"},"key":"device_type","value":"35"},{"description":{"content":"<p>device / sensor or slot</p>\n","type":"text/plain"},"key":"key","value":"device"}],"variable":[]}},"response":[],"_postman_id":"6e2e878b-ca47-c19c-1fce-cfe275f57c37"},{"name":"https://socket.swimo.io/cgi-bin/set_controller","id":"f2afb9c4-ca63-4b2f-3e40-4602f5c0f5ee","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"appid","value":"token","description":"<p>appid to update existing user</p>\n"}],"url":"https://socket.swimo.io/cgi-bin/set_controller?sys_id=001060672&sys_ref=Spa ( text : as user reference - 30 chars)&sys_type=0 (0 = spa , 1 = pool)&sys_volume=5.8 (in cubic meter)&sys_place=_EXT / _INT&sys_number=1&sys_winter=0 (normal, 1 winter mode stops alerts)&sys_timezone=timeZone format (default: Europe/Paris)&sys_user_push=0 : none, 1 : receive push&sys_user_email=0 : none, 1 : receive email","description":"<p>Set or update a new system\nin case of setup a new system, the token is update in the answer</p>\n","urlObject":{"protocol":"https","path":["cgi-bin","set_controller"],"host":["socket","swimo","io"],"query":[{"description":{"content":"<p>uniq controller idSystem Orkestron registered</p>\n","type":"text/plain"},"key":"sys_id","value":"001060672"},{"key":"sys_ref","value":"Spa ( text : as user reference - 30 chars)"},{"key":"sys_type","value":"0 (0 = spa , 1 = pool)"},{"key":"sys_volume","value":"5.8 (in cubic meter)"},{"key":"sys_place","value":"_EXT / _INT"},{"key":"sys_number","value":"1"},{"key":"sys_winter","value":"0 (normal, 1 winter mode stops alerts)"},{"key":"sys_timezone","value":"timeZone format (default: Europe/Paris)"},{"key":"sys_user_push","value":"0 : none, 1 : receive push"},{"key":"sys_user_email","value":"0 : none, 1 : receive email"}],"variable":[]}},"response":[],"_postman_id":"f2afb9c4-ca63-4b2f-3e40-4602f5c0f5ee"},{"name":"https://sock.swimo.io","id":"8c93400b-d9af-46e1-a668-5001d1f9447f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n \"appid\":\"token\",\n\"type\":\"GET_SENSORS\"\n}"},"url":"https://sock.swimo.io","description":"<p>Force real time records to mount from your controller (Solo, Maestro, Swimo)</p>\n<p>GET_SENSORS:</p>\n<p>Return a Json objet with all sensors : sensorNum and value</p>\n<p>GET_ACTIONS:</p>\n<p>return a jSon object with all actions : mode, status, sequence and speed</p>\n","urlObject":{"protocol":"https","host":["sock","swimo","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"8c93400b-d9af-46e1-a668-5001d1f9447f"},{"name":"https://socket.swimo.io/fcm_token","id":"9fd8b5c6-dfd7-423b-99b8-4d3745537000","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"appid","value":"U1BkbytSWEs5V0lVcEh3RllMRlZkZz09","type":"text"}],"body":{"mode":"raw","raw":"{\n \"token\":\"TEST_SYSTEM_r4cv:APA91bGG3wmvrveD3BfJG-Pd93siBfXjjJzATUEFosaSZ3ovg72VHm74-bFLhmAvivV-ZhId9IrN-63-KPFIu4OS6q41npl8bM2JVXVA_eACgl9x7_u0QEo\"\n}"},"url":"https://socket.swimo.io/fcm_token.php","description":"<p>Force real time records to mount from your controller (Solo, Maestro, Swimo)</p>\n<p>GET_SENSORS:</p>\n<p>Return a Json objet with all sensors : sensorNum and value</p>\n<p>GET_ACTIONS:</p>\n<p>return a jSon object with all actions : mode, status, sequence and speed</p>\n","urlObject":{"protocol":"https","path":["fcm_token.php"],"host":["socket","swimo","io"],"query":[{"disabled":true,"key":"token","value":null}],"variable":[]}},"response":[],"_postman_id":"9fd8b5c6-dfd7-423b-99b8-4d3745537000"},{"name":"https://socket.swimo.io/cgi-bin/get_base_list","id":"6eb53df2-6a2c-b846-33fc-d1bc4fe9544b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"appid","value":"token","description":"<p>appid to update existing user</p>\n"}],"url":"https://socket.swimo.io/cgi-bin/get_base_list","description":"<p>Retrieve last list of actions type and sensors type</p>\n","urlObject":{"protocol":"https","path":["cgi-bin","get_base_list"],"host":["socket","swimo","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"6eb53df2-6a2c-b846-33fc-d1bc4fe9544b"},{"name":"https://socket.swimo.io/cgi-bin/del_all","id":"3bb7d2f3-ede6-131f-9c9e-52fdef0f70d4","request":{"method":"GET","header":[{"key":"appid","value":"token","description":"<p>appid to update existing user- admin token</p>\n"}],"url":"https://socket.swimo.io/cgi-bin/del_all?sensor_number=8&key=sensor","description":"<p>Delete sensor or device by it number : sensor_number or device_number</p>\n<p>delete Slot by it id : slot_id</p>\n<p><strong>WARNING : suppression with a connected device is real time suppressed</strong></p>\n","urlObject":{"protocol":"https","path":["cgi-bin","del_all"],"host":["socket","swimo","io"],"query":[{"description":{"content":"<p>sensor number to supress</p>\n","type":"text/plain"},"key":"sensor_number","value":"8"},{"description":{"content":"<p>device, sensor, slot</p>\n","type":"text/plain"},"key":"key","value":"sensor"}],"variable":[]}},"response":[],"_postman_id":"3bb7d2f3-ede6-131f-9c9e-52fdef0f70d4"},{"name":"wss://now.swimo.io ","id":"4f4c153a-4ba2-55b0-22be-893d0a4cf675","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"VIEW","header":[],"body":{"mode":"raw","raw":"    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.3.0/socket.io.js\"></script>\n    <script>\n\n      var socket = io(\"wss://now.swimo.io\");\n   \n      socket.emit(\"authenticate\", {\n        appid: \"token\",\n      });\n  \n      socket.on(\"data\", function (d) {\n        // console.log shows the data coming in inspect -> console you can comment it once done with checking\n        console.log(d);\n        // from here you can update your data on your web interface\n        // example :\n        // data comes in as string format so we are converting it in array format so that we can use it\n        const incomingData = JSON.parse(d);\n\n        if (incomingData.type == 'sensors-data'){\n        // here in for we are looping it for how much sensors we get\n          for (var i = 0; i < incomingData.sensors.length; i++) {\n            var newSensorData = document.getElementById('sensor-'+incomingData.sensors[i].sensorNum);\n            newSensorData.innerHTML = incomingData.sensors[i].value;\n          }\n        }\n        // somewhere in you html /php code a div with id =\"sensor-1\" for example update your value for your sensor\n        // number 1\n\n      });\n      socket.on(\"authentication\", function (d) {\n        console.log(\"from here\");\n        console.log(d);\n      });\n      socket.on(\"disconnect\", (reason) => {\n        console.log(\"disconnect...\");\n        console.log(reason);\n      });\n    </script>\n","options":{"raw":{"language":"html"}}},"url":"wws://now.swimo.io/","description":"<p>Listen real data time records from controller when a change occurs</p>\n<p>receive jSon objects</p>\n<p>{\"type\":\"sensors-data\",\"userId\":\"FR-XXXXXXXX\",\"sensors\":[{\"sensorNum\":1,\"value\":\"7.8\"}]}</p>\n<p>....</p>\n<p>{\"type\":\"actions-status-data\",\"userId\":\"FR-XXXXXXXX\",\"actions\":[{\"actionNum\":1,\"status\":1,\"mode\":0,\"sequence\":0,\"speed\":0}]}</p>\n<p>.......</p>\n<p>*Every \"user records timer\" (set at 10 minutes), you receive all sensors value and raw value and runtime actions.</p>\n<p>{\"type\":\"data\",\"userId\":\"FR-XXXXXXXX\",\"sensors\":[{\"sensorNum\":1,\"valueRaw\":\"1235.1\",\"value\":\"7.8\"},{\"sensorNum\":2,\"valueRaw\":\"2676.8\",\"value\":\"-100.0\"},{\"sensorNum\":3,\"valueRaw\":\"2722.1\",\"value\":\"6.5\"},{\"sensorNum\":4,\"valueRaw\":\"2853.6\",\"value\":\"23.3\"},{\"sensorNum\":5,\"valueRaw\":\"6.4\",\"value\":\"0.0\"},{\"sensorNum\":7,\"valueRaw\":\"0.0\",\"value\":\"0.0\"},{\"sensorNum\":8,\"valueRaw\":\"0.0\",\"value\":\"0.0\"},{\"sensorNum\":12,\"valueRaw\":\"0.0\",\"value\":\"1.0\"}],\"actions\":[{\"actionNum\":1,\"runtime\":39},{\"actionNum\":2,\"runtime\":0},{\"actionNum\":3,\"runtime\":0},{\"actionNum\":4,\"runtime\":0},{\"actionNum\":5,\"runtime\":0},{\"actionNum\":6,\"runtime\":0},{\"actionNum\":8,\"runtime\":0},{\"actionNum\":13,\"runtime\":0},{\"actionNum\":16,\"runtime\":0}]}</p>\n<ul>\n<li>may subjects to change</li>\n</ul>\n","urlObject":{"protocol":"wws","path":[""],"host":["now","swimo","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"4f4c153a-4ba2-55b0-22be-893d0a4cf675"}],"event":[{"listen":"prerequest","script":{"id":"f74091cd-0469-4e87-9d54-86de913e1778","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"9f02db12-d15d-4f00-9bab-0bccaa9c96f1","type":"text/javascript","exec":[""]}}]}