Differences
This shows you the differences between two versions of the page.
| indigo_2022.2_documentation:api [2024/06/27 00:08] – external edit 127.0.0.1 | indigo_2022.2_documentation:api [2025/04/14 20:10] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| In Indigo v2022.2, we’ve completely redesigned the Indigo Web Server plugin (commonly referred to as IWS). The first major change is the new Indigo Touch for Web UI. We know you'll love this new UI (particularly given the old UI which was super dated): | In Indigo v2022.2, we’ve completely redesigned the Indigo Web Server plugin (commonly referred to as IWS). The first major change is the new Indigo Touch for Web UI. We know you'll love this new UI (particularly given the old UI which was super dated): | ||
| - | {{: | + | {{: |
| This article, however, is about the two new APIs in IWS that developers can use to integrate Indigo with external services: | This article, however, is about the two new APIs in IWS that developers can use to integrate Indigo with external services: | ||
| Line 10: | Line 10: | ||
| * [[#HTTP API]] – shares as much of the messaging construction with the WebSocket interface as is practical. | * [[#HTTP API]] – shares as much of the messaging construction with the WebSocket interface as is practical. | ||
| - | Both of these APIs are authenticated with HTTP Digest and API Keys (either as a query string or preferably an Authorization header) depending on how the user configures it in the Start Local Server dialog. | + | Both of these APIs are authenticated with HTTP Digest and API Keys (either as a query string or preferably an Authorization header) depending on how the user configures it in the Start Local Server dialog. |
| <color red> | <color red> | ||
| Line 20: | Line 20: | ||
| A quick note on versioning: moving forward, all APIs will be versioned under the following scheme: | A quick note on versioning: moving forward, all APIs will be versioned under the following scheme: | ||
| - | * '' | + | * '' |
| ==== Python vs JavaScript ==== | ==== Python vs JavaScript ==== | ||
| Line 36: | Line 36: | ||
| - | Python developers will notice the use of '' | + | Python developers will notice the use of '' |
| ^Python^JSON Equivalent^ | ^Python^JSON Equivalent^ | ||
| Line 89: | Line 89: | ||
| The best way to use an API Key is to include it in an **Authorization** header on your HTTP request. If you are using a system which does not allow you to set headers for your HTTP request, you can include the API Key as a query argument with the URL: | The best way to use an API Key is to include it in an **Authorization** header on your HTTP request. If you are using a system which does not allow you to set headers for your HTTP request, you can include the API Key as a query argument with the URL: | ||
| - | '' | + | '' |
| Note the protocol: '' | Note the protocol: '' | ||
| Line 788: | Line 788: | ||
| ==== Log Feed ==== | ==== Log Feed ==== | ||
| - | Use this feed to catch all log messages as they happen in the Indigo Server. When you first open the log-feed WebSocket, you will receive the last 25 log messages from the server **//in chronological order//**. After that, the messages come through the socket as they are generated (chronological order). See the [[#Log Messages]] section below for a description of a log message object. | + | Use this feed to catch all log messages as they happen in the Indigo Server. When you first open the log-feed WebSocket, you will receive the last 25 log messages from the server **//in chronological order//**. After that, the messages come through the socket as they are generated (chronological order). See the [[#Log Messages]] section below for a description of a log message object. |
| Here are the URLs you will use to connect to this feed: | Here are the URLs you will use to connect to this feed: | ||
| Line 1687: | Line 1687: | ||
| Message that contain device objects generate those objects by first converting the device to a python dictionary and then converting the python dictionary to JSON. See the [[device_class# | Message that contain device objects generate those objects by first converting the device to a python dictionary and then converting the python dictionary to JSON. See the [[device_class# | ||
| - | <html><span style=" | + | <color red>Note:</color>The '' |
| === Device Command Messages === | === Device Command Messages === | ||
| Line 1711: | Line 1711: | ||
| **Note:** This message will work on any Indigo device type, though the device that it targets may not respond to status request messages in which case it will do nothing. | **Note:** This message will work on any Indigo device type, though the device that it targets may not respond to status request messages in which case it will do nothing. | ||
| - | < | + | This won't necessarily cause a device update message - if the device didn't have any changes after the status request, there will be no updates to the device in the server, so no update message will be sent out the websocket. |
| **toggle** '' | **toggle** '' | ||
| Line 2216: | Line 2216: | ||
| Messages that contain variable objects generate those objects by first converting the variable to a python dictionary and then converting the python dictionary to JSON. See the [[variable_class# | Messages that contain variable objects generate those objects by first converting the variable to a python dictionary and then converting the python dictionary to JSON. See the [[variable_class# | ||
| - | <html><span style=" | + | <color red>Note:</color>The '' |
| === Variable Command Messages === | === Variable Command Messages === | ||
| Line 2273: | Line 2273: | ||
| </ | </ | ||
| - | <html><span style=" | + | <color red>Note:</color> The '' |
| === Action Group Command Messages === | === Action Group Command Messages === | ||
| Line 2307: | Line 2307: | ||
| </ | </ | ||
| - | Note that '' | + | Note that '' |
| <code python> | <code python> | ||