{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"43f1943e-8b1c-4fdf-b8db-c8a861e9bfcc","name":"X-PoE Public API","description":"### Introduction\n\nWelcome to the Luum.io X-PoE Switch API documentation! This API provides a simple and efficient way to interact with the X-PoE switch, enabling complete control over its features and functionalities. Whether you're configuring lighting systems, retrieving device information, or setting advanced parameters, this API serves as your gateway to unlocking the full potential of the X-PoE platform.\n\nAll API endpoints require authentication with a JSON Web Token (JWT) to ensure secure communication. To retrieve your token, refer to the [Login Documentation](#ff692637-abf2-47a7-a37d-8fe1be5181fd) for instructions on obtaining and using a token.\n\nIn addition to HTTP access, the API also supports communication through an MQTT interface. This is particularly useful in constrained environments where direct HTTP communication is not feasible. Below, we outline the structure and usage of the MQTT interface.\n\n---\n\n### Getting Started\n\nTo help you get started quickly, here are the most common endpoints for interacting with the X-PoE Switch:\n\n1. **Login**  \n    Use the `/login` endpoint to authenticate and retrieve a JSON Web Token (JWT).\n    \n    - [Documentation for the Login Endpoint](#ff692637-abf2-47a7-a37d-8fe1be5181fd)\n        \n2. **All Channel Configuration**  \n    Configure all channel-specific settings (e.g., output levels, color temperature, static load) in one request using the `/config` endpoint.\n    \n    - [Documentation for All Channel Configuration](#884ea5fa-d7ca-408d-91be-d718815504a3)\n        \n3. **Channel Control**  \n    Control individual channels by setting brightness, turning them on/off, or applying fades using the `/channel_control` endpoint.\n    \n    - [Documentation for Channel Control](#ff75f905-637c-4466-8e80-d0a89bb4c8c6)\n        \n4. **Port Control**  \n    Control ports by setting brightness and color temperature, turning them on/off, or applying fades through the `/port_control` endpoint.\n    \n    - [Documentation for Port Control](#de8e3bcc-487a-4c4e-bde6-c03f865ed8f2)\n        \n\nThese endpoints cover the most common use cases for configuring and controlling the X-PoE device.\n\n---\n\n### MQTT Interface Documentation\n\n#### Overview\n\nThe MQTT interface allows clients to encapsulate HTTP requests within MQTT messages for seamless interaction with the API. This approach supports a variety of HTTP methods (e.g., `GET`, `POST`, `PUT`, `DELETE`) encapsulated inside MQTT messages.\n\n### Connecting to MQTT\n\nTo connect to the broker on X-PoE switches running build 462 or greater, use the following credentials:\n\n- **Host**: `IP address or hostname of the switch`\n    \n- **Port**: `1883 (standard unencrypted MQTT port)`\n    \n- **Username**: `integration_user`\n    \n- **Password**: `wgv^TZ?MP613KpdL`\n    \n\n---\n\n### Topics for API Communication\n\nOnce connected to the broker, you can use the following topics for communication:\n\n#### **Request Topic**\n\nTopic: `switch/[xpoe switch mac]/api`  \nExample: `switch/f8:dc:7a:32:57:93/api`\n\n#### **Response Topic**\n\nTopic: `switch/[xpoe switch mac]/api/out`  \nExample: `switch/f8:dc:7a:32:57:93/api/out`\n\n---\n\n#### Message Structure\n\nThe MQTT message consists of two main components: `meta` and `data`.\n\n- `meta`: Contains metadata about the message, such as its ID, timestamp, source, data type, and schema version.\n    \n- `data`: Contains the actual payload to be sent to the API, including the API endpoint (`url`), the HTTP method (`method`), the authentication token (`token`), and the request payload (`payload` if applicable).\n    \n\n#### Meta Structure\n\nThe `meta` section should include the following information:\n\n- `id`: A unique identifier for the message (UUIDv4).\n    \n- `ts`: The timestamp when the message was generated.\n    \n- `source`: The origin of the message (e.g., a specific client or system).\n    \n- `data_type`: The type of data being sent, typically 'json'.\n    \n- `schema`: The version of the schema used, e.g., 'mqtt_v1'.\n    \n\nExample message:\n\n``` json\n{\n    \"meta\": {\n        \"id\": \"d2de0d2f-fa21-4572-bcbf-8b4fac9d0899\",\n        \"ts\": \"1708006604\",\n        \"source\": \"AMBR MQTT Test\",\n        \"data_type\": \"json\",\n        \"schema\": \"mqtt_v1\"\n    },\n    \"errors\": [],\n    \"data\": {\n        \"url\": \"level\",\n        \"token\": \"<JWT>\",\n        \"method\": \"POST\",\n        \"payload\": {\n            \"channels\": [\n                1,\n                2,\n                3,\n                4\n            ],\n            \"target_level\": 0,\n            \"fade_time\": 1\n        }\n    }\n}\n\n ```","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"63727","team":11092,"collectionId":"43f1943e-8b1c-4fdf-b8db-c8a861e9bfcc","publishedId":"2s93eU1tfT","public":true,"publicUrl":"https://xpoe-api-docs.luum.io","privateUrl":"https://go.postman.co/documentation/63727-43f1943e-8b1c-4fdf-b8db-c8a861e9bfcc","customColor":{"top-bar":"000120","right-sidebar":"000120","highlight":"16cb1a"},"documentationLayout":"classic-double-column","customisation":null,"version":"8.11.5","publishDate":"2023-05-01T15:01:02.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{},"logos":{}},"statusCode":200},"environments":[{"name":"X-PoE Public Environment","id":"5e4de9c3-6b1c-4386-a9e4-e32c8fa58fd4","owner":"63727","values":[{"key":"server","value":"xpoe-mac.local","enabled":true,"type":"default"},{"key":"port","value":"","enabled":true,"type":"default"},{"key":"AUTH-TOKEN","value":"","enabled":true,"type":"default"},{"key":"HEADER-AUTH-TOKEN","value":"","enabled":true,"type":"any"},{"key":"port_number","value":"1","enabled":true,"type":"default"},{"key":"channel_pair","value":"2","enabled":true,"type":"default"}],"published":true}],"user":{"authenticated":false,"permissions":{"publish":false}},"run":{"button":{"js":"https://run.pstmn.io/button.js","css":"https://run.pstmn.io/button.css"}},"web":"https://www.getpostman.com/","team":{"logo":"https://res.cloudinary.com/postman/image/upload/t_team_logo_pubdoc/v1/team/8693b654c3eaf53edf2982adb9bd0d737f25af4241027f6b1f4b2d7e6cbb9afd","favicon":"https://res.cloudinary.com/postman/image/upload/v1581079907/team/hwlqowna9x7jatjyebhj.ico"},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"},{"label":"X-PoE Public Environment","value":"63727-5e4de9c3-6b1c-4386-a9e4-e32c8fa58fd4"}],"canonicalUrl":"https://xpoe-api-docs.luum.io/view/metadata/2s93eU1tfT"}