GWAPI: Commands

From Yombo
Jump to: navigation, search

Gateway API Home

See also

Summary

The commands endpoint displays all commands that the gateway knows about. Note, not all devices can use the all commands.

Get all commands

Get a listing of all commands.

  <div id="curl<random_number></random_number>" class="tab-pane fade in active" style="border: 1px solid #ccc; border-radius: 5px; padding: 0.7em;">
curl \
-H "x-auth-key: kip8EaWvR7Y6eLN2c0t0L2z3oELs3hR0jeEDrAr6Ozm7EB" \
http://localhost:8080/api/v1/command
  <div id="python<random_number></random_number>" class="tab-pane fade" style="border: 1px solid #ccc; border-radius: 5px; padding: 0.7em;">
import requests

url = 'http://localhost:8080/api/v1/command'
headers = {
    'x-auth-key': 'kip8EaWvR7Y6eLN2c0t0L2z3oELs3hR0jeEDrAr6Ozm7EB',
    }

response = requests.get(url, headers=headers)
  <div id="output<random_number></random_number>" class="tab-pane fade" style="border: 1px solid #ccc; border-radius: 5px; padding: 0.7em;">
 1 {
 2     "code": 200,
 3     "message": "OK",
 4     "payload": [
 5         {
 6             "command_id": "aWvzB0ENZ23JO",
 7             "always_load": "1",
 8             "voice_cmd": "on",
 9             "cmd": "on",
10             "label": "On",
11             "machine_label": "on",
12             "description": "Sends an on command",
13             "public": 2,
14             "status": 1,
15             "created_at": 1482065387,
16             "updated_at": 1482065387
17         },
18         {
19             "command_id": "6qBJKkN6kw3nW",
20             "always_load": "1",
21             "voice_cmd": "off",
22             "cmd": "off",
23             "label": "Off",
24             "machine_label": "off",
25             "description": "Sends an off command",
26             "public": 2,
27             "status": 1,
28             "created_at": 1482065387,
29             "updated_at": 1482065387
30         },
31         {
32             "command_id": "4bxmNlRNlEXA2",
33             "always_load": "1",
34             "voice_cmd": "close",
35             "cmd": "close",
36             "label": "Close",
37             "machine_label": "close",
38             "description": "Sends a close command",
39             "public": 2,
40             "status": 1,
41             "created_at": 1482065387,
42             "updated_at": 1482065387
43         },
44         {
45             "command_id": "QaEAzkdQlRvV5",
46             "always_load": "1",
47             "voice_cmd": "open",
48             "cmd": "open",
49             "label": "Open",
50             "machine_label": "open",
51             "description": "Sends an open command",
52             "public": 2,
53             "status": 1,
54             "created_at": 1482065387,
55             "updated_at": 1482065387
56         },
57         {
58             "command_id": "adDnNk7WkLGrO",
59             "always_load": "1",
60             "voice_cmd": "dim",
61             "cmd": "dim",
62             "label": "Dim",
63             "machine_label": "dim",
64             "description": "Sends a dim command",
65             "public": 2,
66             "status": 1,
67             "created_at": 1482065387,
68             "updated_at": 1482065387
69         },
70         {
71             "command_id": "Rnpx5ZqYZbyzY",
72             "always_load": "1",
73             "voice_cmd": "brighten",
74             "cmd": "brighten",
75             "label": "Brighten",
76             "machine_label": "brighten",
77             "description": "Sends a brighten command",
78             "public": 2,
79             "status": 1,
80             "created_at": 1482065387,
81             "updated_at": 1482065387
82         },
83         {
84             "command_id": "pvYA2Z4Rlje9m",
85             "always_load": "1",
86             "voice_cmd": "set brightness",
87             "cmd": "set_brightness",
88             "label": "Set Brightness",
89             "machine_label": "set_brightness",
90             "description": "Set brightness to a specified level. Include either 'set_percent' or 'set_level' with the command.",
91             "public": 2,
92             "status": 1,
93             "created_at": 1482065387,
94             "updated_at": 1482065387
95         }
96     ]
97 }
This page was last edited on 15 September 2018.