{"info":{"_postman_id":"f13eed74-b2d6-45ca-84ad-067601cc59c5","name":"Relogic API Documentation","description":"<html><head></head><body><p>The Relogic API is designed to interact with and control relays within a system. It provides endpoints for monitoring the state of individual relays, as well as the ability to change their status, channel by channel.</p>\n<h1 id=\"errors\">Errors</h1>\n<p>The Relogic API uses conventional HTTP response codes to indicate the success or failure of an API request. The <code>200</code> status code indicates success. The <code>4xx</code> status codes indicate an error that failed given the information provided. The <code>500</code> status code indicates an error with Relogic servers. Here is an overview of common errors and possible causes.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Error Code and Message</th>\n<th>Possible Reasons</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>400 - \"Invalid address\"</td>\n<td>The relay address inserted is outside the allowed range</td>\n</tr>\n<tr>\n<td>400 - \"The browser (or proxy) sent a request that this server could not understand\"</td>\n<td>Incomplete request body</td>\n</tr>\n<tr>\n<td>400 - \"Invalid relay channel number\"</td>\n<td>The relay channel inserted is outside the limit allowed</td>\n</tr>\n<tr>\n<td>404 - \"Request Not Found\"</td>\n<td>The relay address or relay channel field is empty</td>\n</tr>\n</tbody>\n</table>\n</div></body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"Errors","slug":"errors"}],"owner":"30811685","collectionId":"f13eed74-b2d6-45ca-84ad-067601cc59c5","publishedId":"2s9Ye8euX3","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2023-11-18T19:34:31.000Z"},"item":[{"name":"Relay State","item":[{"name":"Relay State","id":"4d7fb97f-8502-45f5-80e2-73479c1e1cb6","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{bearer_token}}"}]},"isInherited":false},"method":"GET","header":[],"url":"http://{{server}}:{{port}}/relay_state/:relayAddress/:relayChannel","description":"<p>Retrieves the current state of a specific relay within the system.</p>\n","urlObject":{"protocol":"http","port":"{{port}}","path":["relay_state",":relayAddress",":relayChannel"],"host":["{{server}}"],"query":[],"variable":[{"id":"c5145ae2-d2b6-4ae0-afea-37a27f5c12b2","description":{"content":"<p>(Required) ||\nRepresents the unique address or identifier associated with a relay in the system || \nType: string ||\nExample: '0x20', '0x21', etc. ||\nDefault value: '0x20' ||\nMinimum value: '0x20' ||\nMaximum value: '0x27'</p>\n","type":"text/plain"},"type":"any","value":"{{relayAddress}}","key":"relayAddress"},{"id":"440595c2-4d29-455b-927a-f852bc7f4d0e","description":{"content":"<p>{Required} ||\nRepresents the specific channel or sub-component of a relay. ||\nType: integer ||\nExample: '1', '2', '3', etc.||\nDefault value: '2' ||\nMinimum value: '1' ||\nMaximum value: '16' </p>\n","type":"text/plain"},"type":"any","value":"{{relayChannel}}","key":"relayChannel"}]}},"response":[{"id":"5ad7ec99-e3d5-4c3c-919d-f43cb7860c86","name":"GET Relay State","originalRequest":{"method":"GET","header":[{"key":"Authorization","value":"{{bearer_token}}","type":"text","disabled":true}],"url":{"raw":"http://{{server}}:{{port}}/relay_state/:relayAddress/:relayChannel","protocol":"http","host":["{{server}}"],"port":"{{port}}","path":["relay_state",":relayAddress",":relayChannel"],"variable":[{"key":"relayAddress","value":"{{relayAddress}}","description":"(Required)\nRepresents the unique address or identifier associated with a relay in the system. \nType: string\nExample: 0x20, 0x21, etc. (Indicate starting points and ending points)\nDefault value: 0x20"},{"key":"relayChannel","value":"{{relayChannel}}","description":"{Required}\nRepresents the specific channel or sub-component of a relay.\nType: integer\nExample: 1, 2, 3, etc.\nDefault value: 2"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Werkzeug/2.2.3 Python/3.7.0"},{"key":"Date","value":"Wed, 08 Nov 2023 22:23:39 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"117"},{"key":"Connection","value":"close"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Read Success..!!\",\n    \"units\": [\n        {\n            \"address\": \"0x20\",\n            \"relay\": [\n                {\n                    \"channel\": 2,\n                    \"status\": true\n                }\n            ],\n            \"unit_status\": true\n        }\n    ]\n}"}],"_postman_id":"4d7fb97f-8502-45f5-80e2-73479c1e1cb6"},{"name":"Relay State","id":"5d4a435e-7207-43d1-bc6e-e2371b9be3eb","protocolProfileBehavior":{"disabledSystemHeaders":{"content-type":true},"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{bearer_token}}"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"units\" : [\r\n        {\r\n            \"address\" : \"0x20\",\r\n            \"relay\" : [\r\n                {\r\n                    \"channel\" : 1,\r\n                    \"status\" : 0\r\n                },\r\n                {\r\n                    \"channel\" : 2,\r\n                    \"status\" : 1\r\n                },\r\n                {\r\n                    \"channel\" : 4,\r\n                    \"status\" : 1\r\n                }\r\n            ]\r\n        }\r\n    ]\r\n}","options":{"raw":{"language":"json"}}},"url":"http://{{server}}:{{port}}/relay_state","description":"<p>Updates the state of a single or multiple relays.</p>\n<p>By specifying the channels and status of relays, you can perform 7 functions in this endpoint:</p>\n<ul>\n<li>Turn on a relay</li>\n<li>Turn off a relay</li>\n<li>Turn on multiple relays</li>\n<li>Turn off multiple relays</li>\n<li>Turn on a relay per unit</li>\n<li>Turn off a relay per unit</li>\n<li>Update relays across units</li>\n</ul>\n<p><strong>Access examples of all functions by clicking the drop-down icon beside the title of the example request.</strong></p>\n<h2 id=\"parameters\"><strong>Parameters</strong></h2>\n<ul>\n<li><strong><code>units</code></strong> <strong>(required)</strong>:<ul>\n<li><strong>Description</strong>: An array containing relay units to be updated, each specified with its address and an array of channels with corresponding states.</li>\n<li><strong>Type</strong>: Array</li>\n</ul>\n</li>\n<li><strong><code>address</code></strong> <strong>(required)</strong>:<ul>\n<li><strong>Description</strong>: Unique identifier or address (in hexadecimal) of the relay unit to be updated.</li>\n<li><strong>Type</strong>: String</li>\n</ul>\n</li>\n</ul>\n<hr />\n<ul>\n<li><strong><code>relay</code></strong> <strong>(required)</strong>:<ul>\n<li><strong>Description</strong>: An array specifying the channels within the relay unit and their desired states.</li>\n<li><strong>Type</strong>: Array</li>\n</ul>\n</li>\n</ul>\n<hr />\n<ul>\n<li><strong><code>channel</code></strong> <strong>(required)</strong>:<ul>\n<li><strong>Description</strong>: Channel or sub-component within the relay unit.</li>\n<li><strong>Type</strong>: Integer</li>\n</ul>\n</li>\n</ul>\n<hr />\n<ul>\n<li><strong><code>status</code></strong> <strong>(required)</strong>:<ul>\n<li><strong>Description</strong>: Desired state of the channel. <code>0</code> represents OFF, and <code>1</code> represents ON.</li>\n<li><strong>Type</strong>: Integer</li>\n</ul>\n</li>\n</ul>\n<hr />\n<h2 id=\"returns\"><strong>Returns</strong></h2>\n<p>The request returns ' Relay Updated Successfully..!!' if successful. Otherwise, it returns an error message.</p>\n","urlObject":{"protocol":"http","port":"{{port}}","path":["relay_state"],"host":["{{server}}"],"query":[],"variable":[]}},"response":[{"id":"b3bbe576-2269-4b53-9377-7ca81f825ad1","name":"Turn on a relay","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"units\" : [\r\n        {\r\n            \"address\" : \"0x21\",\r\n            \"relay\" : [\r\n                {\r\n                    \"channel\" : 1,\r\n                    \"status\" : 1\r\n                }\r\n            ]\r\n        }\r\n    ]\r\n}","options":{"raw":{"language":"json"}}},"url":"http://{{server}}:{{port}}/relay_state"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Werkzeug/2.2.3 Python/3.7.0"},{"key":"Date","value":"Thu, 09 Nov 2023 09:20:00 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"45"},{"key":"Connection","value":"close"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Relay Updated Successfully..!!\"\n}"},{"id":"632b968d-dbd0-4007-b32e-10ce82ae51b5","name":"Turn off a relay","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"units\" : [\r\n        {\r\n            \"address\" : \"0x21\",\r\n            \"relay\" : [\r\n                {\r\n                    \"channel\" : 1,\r\n                    \"status\" : 0\r\n                }\r\n            ]\r\n        }\r\n    ]\r\n}","options":{"raw":{"language":"json"}}},"url":"http://{{server}}:{{port}}/relay_state"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Werkzeug/2.2.3 Python/3.7.0"},{"key":"Date","value":"Thu, 09 Nov 2023 09:23:43 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"45"},{"key":"Connection","value":"close"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Relay Updated Successfully..!!\"\n}"},{"id":"e9c5541a-d6c6-417e-a7c2-c8d246d7a1d0","name":"Turn on multiple relays","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"units\" : [\r\n        {\r\n            \"address\" : \"0x21\",\r\n            \"relay\" : [\r\n                {\r\n                    \"channel\" : 1,\r\n                    \"status\" : 0\r\n                },\r\n                {\r\n                    \"channel\" : 2,\r\n                    \"status\" : 0\r\n                },\r\n                {\r\n                    \"channel\" : 4,\r\n                    \"status\" : 0\r\n                }\r\n            ]\r\n        }\r\n    ]\r\n}","options":{"raw":{"language":"json"}}},"url":"http://{{server}}:{{port}}/relay_state"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Werkzeug/2.2.3 Python/3.7.0"},{"key":"Date","value":"Thu, 09 Nov 2023 09:27:02 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"45"},{"key":"Connection","value":"close"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Relay Updated Successfully..!!\"\n}"},{"id":"791d76eb-ddfb-40f0-9272-890e4e510f3b","name":"Turn off multiple relays","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"units\" : [\r\n        {\r\n            \"address\" : \"0x21\",\r\n            \"relay\" : [\r\n                {\r\n                    \"channel\" : 1,\r\n                    \"status\" : 0\r\n                },\r\n                {\r\n                    \"channel\" : 2,\r\n                    \"status\" : 0\r\n                },\r\n                {\r\n                    \"channel\" : 4,\r\n                    \"status\" : 0\r\n                }\r\n            ]\r\n        }\r\n    ]\r\n}","options":{"raw":{"language":"json"}}},"url":"http://{{server}}:{{port}}/relay_state"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Werkzeug/2.2.3 Python/3.7.0"},{"key":"Date","value":"Thu, 09 Nov 2023 09:28:18 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"45"},{"key":"Connection","value":"close"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Relay Updated Successfully..!!\"\n}"},{"id":"7c46f82f-4d5f-4cf4-a96f-1e1b20045944","name":"Turn on a relay per unit","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"units\" : [\r\n        {\r\n            \"address\" : \"0x21\",\r\n            \"relay\" : [\r\n                {\r\n                    \"channel\" : 1,\r\n                    \"status\" : 0\r\n                },\r\n                {\r\n                    \"channel\" : 2,\r\n                    \"status\" : 1\r\n                },\r\n                {\r\n                    \"channel\" : 4,\r\n                    \"status\" : 0\r\n                }\r\n\r\n            ]\r\n        }\r\n    ]\r\n}","options":{"raw":{"language":"json"}}},"url":"http://{{server}}:{{port}}/relay_state"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Werkzeug/2.2.3 Python/3.7.0"},{"key":"Date","value":"Thu, 09 Nov 2023 09:33:00 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"45"},{"key":"Connection","value":"close"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Relay Updated Successfully..!!\"\n}"},{"id":"0bc2a8ea-c609-4f62-aef7-a557f5f81c3a","name":"Turn off a relay per unit","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"units\" : [\r\n        {\r\n            \"address\" : \"0x21\",\r\n            \"relay\" : [\r\n                {\r\n                    \"channel\" : 1,\r\n                    \"status\" : 1\r\n                },\r\n                {\r\n                    \"channel\" : 2,\r\n                    \"status\" : 1\r\n                },\r\n                {\r\n                    \"channel\" : 4,\r\n                    \"status\" : 0\r\n                }\r\n\r\n            ]\r\n        }\r\n    ]\r\n}","options":{"raw":{"language":"json"}}},"url":"http://{{server}}:{{port}}/relay_state"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Werkzeug/2.2.3 Python/3.7.0"},{"key":"Date","value":"Thu, 09 Nov 2023 09:35:18 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"45"},{"key":"Connection","value":"close"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Relay Updated Successfully..!!\"\n}"},{"id":"cd9a6364-4bac-4d73-8ee2-576c8a3366ed","name":"Update relays across units","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"units\" : [\r\n        {\r\n            \"address\" : \"0x21\",\r\n            \"relay\" : [\r\n                {\r\n                    \"channel\" : 1,\r\n                    \"status\" : 0\r\n                },\r\n                {\r\n                    \"channel\" : 2,\r\n                    \"status\" : 1\r\n                },\r\n                {\r\n                    \"channel\" : 4,\r\n                    \"status\" : 0\r\n                }\r\n            ]\r\n        },\r\n        {\r\n            \"address\" : \"0x22\",\r\n            \"relay\" : [\r\n                {\r\n                    \"channel\" : 1,\r\n                    \"status\" : 1\r\n                },\r\n                {\r\n                    \"channel\" : 2,\r\n                    \"status\" : 0\r\n                },\r\n                {\r\n                    \"channel\" : 4,\r\n                    \"status\" : 1\r\n                }\r\n            ]\r\n        }\r\n    ]\r\n}\r\n","options":{"raw":{"language":"json"}}},"url":"http://{{server}}:{{port}}/relay_state"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Werkzeug/2.2.3 Python/3.7.0"},{"key":"Date","value":"Thu, 09 Nov 2023 10:16:39 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"45"},{"key":"Connection","value":"close"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Relay Updated Successfully..!!\"\n}"}],"_postman_id":"5d4a435e-7207-43d1-bc6e-e2371b9be3eb"}],"id":"543cbb70-75a8-47a3-ae33-654e58a59caf","description":"<p>Relay State contains a collection of requests and examples related to managing the state of relay devices within the system. It includes both GET and POST requests for querying and updating relay states.</p>\n","_postman_id":"543cbb70-75a8-47a3-ae33-654e58a59caf"}]}