Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
indigo_2025.2_documentation:plugin_guide [2026/05/04 18:56] – [Request] davel17indigo_2025.2_documentation:plugin_guide [2026/05/04 23:49] (current) – [Plugin] davel17
Line 1661: Line 1661:
     some_other_value = action.props["someOtherKey"]     some_other_value = action.props["someOtherKey"]
          
-    some_result someOtherKey * 2 +    # the reply must be valid JSON or an indigoDict() object 
-    +    reply indigo.Dict() 
 +    reply["content"] = some_other_value * 2 
 +    reply["status_code"] = 200
     return some_result     return some_result
 </code> </code>
Line 1670: Line 1672:
  
 <code> <code>
-MY_API_KEY = abcd1234efgh  # obtained through the user's Indigo account+import httpx 
 + 
 +MY_API_KEY = "abcd1234efgh # obtained through the user's Indigo account
 MY_REFLECTOR = "someReflectorID"  # the name of the user's server machine on their Indigo account MY_REFLECTOR = "someReflectorID"  # the name of the user's server machine on their Indigo account
 PLUGIN_ID = "com.something.myPlugin" PLUGIN_ID = "com.something.myPlugin"
 ACTION_ID = "handle_message"  # The ID from Actions.xml (not an Action object ID number) ACTION_ID = "handle_message"  # The ID from Actions.xml (not an Action object ID number)
  
-# The payload must be valid JSON. The API does not support binary encoding and payloads should by of a reasonable size.+# The payload must be valid JSON. The API does not support binary encoding and payloads should be of a reasonable size.
 payload = { payload = {
-    "someKey": "some string value"+    "someKey": 1
-    "someOtherKey": 12345678+    "someOtherKey": 2
-    "someDict": {"foo": 123"bar": "abc"}+    "field3": 3,
 } }
  
-my_url = https://MY_REFLECTOR.indigodomo.net/message/PLUGIN_ID/ACTION_ID/?other=payload&api-key=MY_API_KEY+my_url = "https://MY_REFLECTOR.indigodomo.net/message/PLUGIN_ID/ACTION_ID/?other=payload&api-key=MY_API_KEY
 +response = httpx.get(my_url, verify=False) 
 + 
 +print(f"{response.status_code}"
 +print(f"{response.text}")
 </code> </code>
  
  • /www/perceptive/wiki/data/attic/indigo_2025.2_documentation/plugin_guide.1777920979.txt.gz
  • Last modified: 2026/05/04 18:56
  • by davel17