API: Gateways

From Yombo
Jump to: navigation, search

Summary

Gateways are the core of the automation system. They run the Yombo automation software. The API allows nearly full control over gateways, including adding, disabling, and deleting gateways.

GET - All gateways

Retrieve all gateways available to the current user.

Filters

List of available filters:

  • machine_label
  • label
  • description
  • status
  • created_at
  • updated_at

Request URLs

  • GET https://api.yombo.net/api/v1/gateway

Parameters

None

Example

  <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-api-key: abc123xyz789" \
-H "authorization: Bearer Waro7g0Mwl4YBJ..." \
https://api.yombo.net/api/v1/gateway?_pagelimit=2
  <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 = 'https://api.yombo.net/api/v1/gateway?_pagelimit=2'
headers = {
    'x-api-key': 'abc123xyz789',
    'authorization': 'Waro7g0Mwl4YBJ...',
    }
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     "response": {
 3         "uri": "/api/v1/gateway?_pagelimit=2",
 4         "uri_description": "List of gateways.",
 5         "doc_uri": "https://yombo.net/API:Gateways",
 6         "gateway": [
 7             {
 8                 "id": "JrlPM5XdgQG68ylW",
 9                 "machine_label": "tester_gateway",
10                 "label": "tester gateway",
11                 "description": "Tester gateway that doesn't survive long.",
12                 "mqtt_auth": "K6OKVOcoV9A51HiZs8ICZZggGwx3GLQV",
13                 "mqtt_auth_next": "I5Q5Mx5S7v9qZNnud10t8sNG1o0xGR5v",
14                 "mqtt_auth_last_rotate": 1511833220,
15                 "internal_ipv4": "192.168.1.179",
16                 "external_ipv4": "167.136.36.31",
17                 "internal_ipv6": null,
18                 "external_ipv6": null,
19                 "internal_port": 8080,
20                 "external_port": 8080,
21                 "internal_secure_port": 8443,
22                 "external_secure_port": 8443,
23                 "internal_mqtt": 1883,
24                 "internal_mqtt_le": 1885,
25                 "internal_mqtt_ss": 1884,
26                 "internal_mqtt_ws": 8081,
27                 "internal_mqtt_ws_le": 8445,
28                 "internal_mqtt_ws_ss": 8444,
29                 "external_mqtt": 1883,
30                 "external_mqtt_le": 1885,
31                 "external_mqtt_ss": 1884,
32                 "external_mqtt_ws": 8081,
33                 "external_mqtt_ws_le": 8445,
34                 "external_mqtt_ws_ss": 8444,
35                 "is_master": 1,
36                 "master_gateway": "JrlPM5XdgQG68ylW",
37                 "last_connect": null,
38                 "status": 0,
39                 "created_at": 1511833037,
40                 "updated_at": 1511833220,
41                 "fqdn": "yombotester1a.example.com"
42             },
43             {
44                 "id": "BuJv8VWJKwJUpngz",
45                 "machine_label": "garage_rpi_zero_w",
46                 "label": "Garage Raspberry PI Zero",
47                 "description": "",
48                 "mqtt_auth": "Z3E1KckZUemW6r76PGWVrkoftiEPECHW",
49                 "mqtt_auth_next": "u547jeotRNl7kI7I2XuvtcFuCUfTst0S",
50                 "mqtt_auth_last_rotate": 1508870680,
51                 "internal_ipv4": "192.168.1.32",
52                 "external_ipv4": "167.136.36.31",
53                 "internal_ipv6": null,
54                 "external_ipv6": null,
55                 "internal_port": 8080,
56                 "external_port": 8080,
57                 "internal_secure_port": 8443,
58                 "external_secure_port": 8443,
59                 "internal_mqtt": 1883,
60                 "internal_mqtt_le": 1885,
61                 "internal_mqtt_ss": 1884,
62                 "internal_mqtt_ws": 8081,
63                 "internal_mqtt_ws_le": 8445,
64                 "internal_mqtt_ws_ss": 8444,
65                 "external_mqtt": 1883,
66                 "external_mqtt_le": 1885,
67                 "external_mqtt_ss": 1884,
68                 "external_mqtt_ws": 8081,
69                 "external_mqtt_ws_le": 8445,
70                 "external_mqtt_ws_ss": 8444,
71                 "is_master": 0,
72                 "master_gateway": "km8M7lRv0E31ebmx",
73                 "last_connect": null,
74                 "status": 1,
75                 "created_at": 1502153449,
76                 "updated_at": 1507561179,
77                 "fqdn": "garagepi.example.com"
78             }
79         ],
80         "locator": "gateway",
81         "locator_type": "objects"
82     },
83     "code": 200,
84     "warnings": [],
85     "pages": {
86         "total_items": 7,
87         "page_limit": 2,
88         "total_pages": 4,
89         "page_start": 1
90     },
91     "message": "OK",
92     "html_message": "OK"
93 }

GET - Specific gateway

Retrieve a specific gateway id.

Request URLs

  • GET https://api.yombo.net/api/v1/gateway/{gateway_id}

Parameters

None

Example

  <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-api-key: abc123xyz789" \
-H "authorization: Bearer Waro7g0Mwl4YBJ..." \
https://api.yombo.net/api/v1/gateway/km8M7lRv0E31ebmx
  <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 = 'https://api.yombo.net/api/v1/gateway/km8M7lRv0E31ebmx
headers = {
    'x-api-key': 'abc123xyz789',
    'authorization': 'Waro7g0Mwl4YBJ...',
    }
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     "response": {
 3         "uri": "/api/v1/gateway/BuJv8VWJKwJUpngz",
 4         "uri_description": "Detailed information for a single gateway.",
 5         "doc_uri": "https://yombo.net/API:Gateways",
 6         "gateway": {
 7             "id": "BuJv8VWJKwJUpngz",
 8             "machine_label": "garage_rpi_zero_w",
 9             "label": "Garage Raspberry PI Zero",
10             "description": "",
11             "mqtt_auth": "Z3E1KckZUemW6r76PGWVrkoftiEPECHW",
12             "mqtt_auth_next": "u547jeotRNl7kI7I2XuvtcFuCUfTst0S",
13             "mqtt_auth_last_rotate": 1508870680,
14             "internal_ipv4": "192.168.1.32",
15             "external_ipv4": "167.136.36.31",
16             "internal_ipv6": null,
17             "external_ipv6": null,
18             "internal_port": 8080,
19             "external_port": 8080,
20             "internal_secure_port": 8443,
21             "external_secure_port": 8443,
22             "internal_mqtt": 1883,
23             "internal_mqtt_le": 1885,
24             "internal_mqtt_ss": 1884,
25             "internal_mqtt_ws": 8081,
26             "internal_mqtt_ws_le": 8445,
27             "internal_mqtt_ws_ss": 8444,
28             "external_mqtt": 1883,
29             "external_mqtt_le": 1885,
30             "external_mqtt_ss": 1884,
31             "external_mqtt_ws": 8081,
32             "external_mqtt_ws_le": 8445,
33             "external_mqtt_ws_ss": 8444,
34             "is_master": 0,
35             "master_gateway": "km8M7lRv0E31ebmx",
36             "last_connect": null,
37             "status": 1,
38             "created_at": 1502153449,
39             "updated_at": 1507561179,
40             "fqdn": "garagepi.example.com"
41         },
42         "locator": "gateway",
43         "locator_type": "object"
44     },
45     "code": 200,
46     "warnings": [],
47     "message": "OK",
48     "html_message": "OK"
49 }

POST - Create new gateway

Creates a new gateway. Rules for status field apply.

The response for a new gateway differs from other gateway responses. This includes the gateway hash and UUID. The gateway hash is stored as a non-reversible hash and cannot be recovered over the API; however a new hash can be generated using the newhash endpoint.

Request URLs

  • POST https://api.yombo.net/api/v1/gateway

Parameters

Name Type Description
Required
machine_name string Machine name for this gateway. Once set, this cannot be changed. Can only contain: a-z and _ (underscore).
label string A short human friendly label for the gateway.
description string A great place to keep track of gateway notes, details, setup information, etc.
Optional
master_gateway string Default: Itself - The gateway id of the master gateway. Set this to another gateway to make this gateway a slave.
is_master string Default: 1 - 0 = Don't act like a master, 1 = act like a master. This used by other gateways to determine if another gataway is behaving as a master gateway.
status string Default: 1 - Status for the gateway.

Example

  <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-api-key: abc123xyz789" \
-H "authorization: Bearer Waro7g0Mwl4YBJ..." \
-X POST -d '{"label": "Master bedroom", "machine_name": "master_bedroom",
 "description": "Handles master bedroom bluetooth tracker and IR blaster."}' \
https://api.yombo.net/api/v1/gateway
  <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 = 'https://api.yombo.net/api/v1/gateway'
headers = {
    'x-api-key': 'abc123xyz789',
    'authorization': 'Waro7g0Mwl4YBJ...',
    }

payload = {
    "label": "Master bedroom",
    "machine_name": "master_bedroom",
    "description": "Handles master bedroom bluetooth tracker and IR blaster.",
    }

response = requests.post(url, headers=headers, json=payload)
  <div id="output<random_number></random_number>" class="tab-pane fade" style="border: 1px solid #ccc; border-radius: 5px; padding: 0.7em;">
 1 {
 2     "response": {
 3         "uri": "/api/v1/gateway",
 4         "uri_description": "Create new gateway.",
 5         "doc_uri": "https://yombo.net/API:Gateways",
 6         "gateway": {
 7             "label": "Master bedroom",
 8             "machine_label": "master_bedroom",
 9             "description": "Handles master bedroom bluetooth tracker and IR blaster.",
10             "mqtt_auth": "1XCxumFXMdYSBk8wuo8EC5ARTiHx6irI",
11             "mqtt_auth_next": "PY2oIhyI1d4YZ3jLi1FZpTaHsmgeDYbJ",
12             "updated_at": 1518638063,
13             "created_at": 1518638063,
14             "id": "2dx6Q9e3djkPBb4a",
15             "hash": "DhHvTND76QfAphXLrj6TBM2B62PPmoeAQs0pFjNt",
16             "uuid": "R8UERqhWKoTe8ugx"
17         },
18         "locator": "gateway",
19         "locator_type": "object"
20     },
21     "code": 201,
22     "warnings": [],
23     "message": "Created",
24     "html_message": "Created"
25 }

PUT / PATCH - Update a gateway

Update a gateway. When using PUT, all required parameters must be sent. When using PATCH, only send in desired changes.

Request URLs

  • PATCH https://api.yombo.net/api/v1/gateway/{gateway_id}
  • PUT https://api.yombo.net/api/v1/gateway/{gateway_id}

Parameters

See post new gateway parameters.

Example

  <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-api-key: abc123xyz789" \
-H "authorization: Bearer Waro7g0Mwl4YBJ..." \
-X PUT -d '{"description": "Handles bluetooth tracking."}' \
https://api.yombo.net/api/v1/gateway/WQ9akXabloyqb
  <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 = 'https://api.yombo.net/api/v1/gateway/WQ9akXabloyqb'
headers = {
    'x-api-key': 'abc123xyz789',
    'authorization': 'Waro7g0Mwl4YBJ...',
    }

payload = {
    "description": "Handles bluetooth tracking.",
    }

response = requests.put(url, headers=headers, json=payload)
  <div id="output<random_number></random_number>" class="tab-pane fade" style="border: 1px solid #ccc; border-radius: 5px; padding: 0.7em;">
 1 {
 2     "response": {
 3         "uri": "/api/v1/gateway/djkPBb4a2dx6Q9e3",
 4         "uri_description": "Update gateway.",
 5         "doc_uri": "https://yombo.net/API:Gateways",
 6         "gateway": {
 7             "id": "2dx6Q9e3djkPBb4a",
 8             "machine_label": "master_bedroom",
 9             "label": "Master bedroom",
10             "description": "Handles bluetooth tracking.",
11             "mqtt_auth": "1XCxumFXMdYSBk8wuo8EC5ARTiHx6irI",
12             "mqtt_auth_prev": "hyI1diNyMuygpsTPlPIN8fqD08JeKqQg",
13             "mqtt_auth_next": "PY2oIhyI1d4YZ3jLi1FZpTaHsmgeDYbJ",
14             "mqtt_auth_last_rotate": 1518638063,
15             "internal_ipv4": null,
16             "external_ipv4": null,
17             "internal_ipv6": null,
18             "external_ipv6": null,
19             "internal_port": 0,
20             "external_port": 0,
21             "internal_secure_port": 0,
22             "external_secure_port": 0,
23             "internal_mqtt": 0,
24             "internal_mqtt_le": 0,
25             "internal_mqtt_ss": 0,
26             "internal_mqtt_ws": 0,
27             "internal_mqtt_ws_le": 0,
28             "internal_mqtt_ws_ss": 0,
29             "external_mqtt": 0,
30             "external_mqtt_le": 0,
31             "external_mqtt_ss": 0,
32             "external_mqtt_ws": 0,
33             "external_mqtt_ws_le": 0,
34             "external_mqtt_ws_ss": 0,
35             "is_master": null,
36             "master_gateway": "",
37             "last_connect": null,
38             "status": 0,
39             "created_at": 1518638063,
40             "updated_at": 1518638382
41         },
42         "locator": "gateway",
43         "locator_type": "object"
44     },
45     "code": 200,
46     "warnings": [],
47     "message": "Updated",
48     "html_message": "Updated"
49 }

DELETE - Delete a gateway

Delete a gateway. This doesn't actually delete the gateway right away, but simply marks it for deletion later. This is the same as setting the status to 2. To undelete the gateway, simply change the status back to 1 using the PATCH method.

Request URLs

  • DELETE https://api.yombo.net/api/v1/gateway/{gateway_id}

Parameters

None

Example

  <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-api-key: abc123xyz789" \
-H "authorization: Bearer Waro7g0Mwl4YBJ..." \
-X DELETE https://api.yombo.net/api/v1/gateway/2dx6Q9e3djkPBb4a
  <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 = 'https://api.yombo.net/api/v1/gateway/2dx6Q9e3djkPBb4a'
headers = {
    'x-api-key': 'abc123xyz789',
    'authorization': 'Waro7g0Mwl4YBJ...',
    }

response = requests.put(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     "response": {
 3         "uri": "/api/v1/gateway/2dx6Q9e3djkPBb4a",
 4         "uri_description": "Gateway deleted",
 5         "doc_uri": "https://yombo.net/API:Gateways",
 6         "gateway": "Deleted",
 7         "locator": "gateway",
 8         "locator_type": "string"
 9     },
10     "code": 200,
11     "warnings": [],
12     "message": "Deleted",
13     "html_message": "Deleted"
14 }

GET - Generate new login

If a gateway needs to be re-installed and the user didn't perform a configuration backup, this URL allows a new gateway hash to be generated.

Request URLs

  • GET https://api.yombo.net/api/v1/gateway/{gateway_id}/new_hash

Parameters

None

Example

  <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-api-key: abc123xyz789" \
-H "authorization: Bearer Waro7g0Mwl4YBJ..." \
-X PUT -d '{"description": "Handles bluetooth tracking."}' \
https://api.yombo.net/api/v1/gateway/ZWemW63E1KVrpngz/new_hash
  <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 = 'https://api.yombo.net/api/v1/gateway/ZWemW63E1KVrpngz/new_hash'
headers = {
    'x-api-key': 'abc123xyz789',
    'authorization': 'Waro7g0Mwl4YBJ...',
    }

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     "response": {
 3         "uri": "/api/v1/gateway/ZWemW63E1KVrpngz/new_hash",
 4         "uri_description": "Gateway hash created, owner notified.",
 5         "doc_uri": "https://yombo.net/API:Gateways",
 6         "gateway": {
 7             "id": "ZWemW63E1KVrpngz",
 8             "machine_label": "garage_rpi_zero_w",
 9             "label": "Garage Raspberry PI Zero",
10             "description": "",
11             "mqtt_auth": "ckZU9pPEClZY9aD176PGWVrkoftiEnHW",
12             "mqtt_auth_next": "JKwJUe87I2XuvtcFuCUotRBuJvfTst0S",
13             "mqtt_auth_last_rotate": 1508870680,
14             "internal_ipv4": "10.133.144.32",
15             "external_ipv4": "23.114.217.31",
16             "internal_ipv6": null,
17             "external_ipv6": null,
18             "internal_port": 8080,
19             "external_port": 8080,
20             "internal_secure_port": 8443,
21             "external_secure_port": 8443,
22             "internal_mqtt": 1883,
23             "internal_mqtt_le": 1885,
24             "internal_mqtt_ss": 1884,
25             "internal_mqtt_ws": 8081,
26             "internal_mqtt_ws_le": 8445,
27             "internal_mqtt_ws_ss": 8444,
28             "external_mqtt": 1883,
29             "external_mqtt_le": 1885,
30             "external_mqtt_ss": 1884,
31             "external_mqtt_ws": 8081,
32             "external_mqtt_ws_le": 8445,
33             "external_mqtt_ws_ss": 8444,
34             "is_master": 0,
35             "master_gateway": "E31ebmxkm8M7lRv0",
36             "last_connect": null,
37             "status": 1,
38             "created_at": 1502153449,
39             "updated_at": 1518654031,
40             "hash": "O7bKUeVc13MqLyMc6vFhJ2P7uF3XCQRMMpCFmcch2UKFcXuBCg",
41             "uuid": "D2r3usBlA2WyJ7C0",
42             "api_auth": "LoEtdLeaUgBggszM07nCrXYpSvo0TEcjVdgDBWyC"
43         },
44         "locator": "gateway",
45         "locator_type": "object"
46     },
47     "code": 200,
48     "warnings": [],
49     "message": "Updated",
50     "html_message": "Updated"
51 }

GET - Gateway commands

A read only resource. Page limit and filtering is not available.

Get all possible commands for a gateway. This includes all commands for all gateways within a cluster. This takes into consideration modules installed onto the gateways and device types assigned to those modules.

Request URLs

  • GET https://api.yombo.net/api/v1/gateway/{gateway_id}/command

Parameters

None

Example

  <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-api-key: abc123xyz789" \
-H "authorization: Bearer Waro7g0Mwl4YBJ..." \
https://api.yombo.net/api/v1/gateway/PZywd7j0VLR4PzWz/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 = 'https://api.yombo.net/api/v1/gateway/PZywd7j0VLR4PzWz/command
headers = {
    'x-api-key': 'abc123xyz789',
    'authorization': 'Waro7g0Mwl4YBJ...',
    }
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     "response": {
 3         "uri": "/api/v1/gateway/PZywd7j0VLR4PzWz/command",
 4         "uri_description": "List of possible commands for a gateway.",
 5         "doc_uri": "https://yombo.net/API:Gateways",
 6         "gateway_command": [
 7             {
 8                 "id": "aWvzB0ENZ23JO",
 9                 "voice_cmd": "on",
10                 "machine_label": "on",
11                 "label": "On",
12                 "description": "Sends an on command",
13                 "public": 2,
14                 "status": 1,
15                 "created_at": 1482065387,
16                 "updated_at": 1518130546,
17                 "always_load": 1
18             },
19             {
20                 "id": "6qBJKkN6kw3nW",
21                 "voice_cmd": "off",
22                 "machine_label": "off",
23                 "label": "Off",
24                 "description": "Sends an off command",
25                 "public": 2,
26                 "status": 1,
27                 "created_at": 1482065387,
28                 "updated_at": 1482065387,
29                 "always_load": 1
30             }
31         ],
32         "locator": "gateway_command",
33         "locator_type": "objects"
34     },
35     "code": 200,
36     "warnings": [],
37     "message": "OK",
38     "html_message": "OK"
39 }

GET - Gateway device types

A read only resource. Page limit and filtering is not available.

Get all possible device types for a gateway. This includes all device types for all gateways within a cluster. This takes into consideration modules installed onto the gateways and device types assigned to those modules.

Request URLs

  • GET https://api.yombo.net/api/v1/gateway/{gateway_id}/device_type

Parameters

None

Example

  <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-api-key: abc123xyz789" \
-H "authorization: Bearer Waro7g0Mwl4YBJ..." \
https://api.yombo.net/api/v1/gateway/PZywd7j0VLR4PzWz/device_type
  <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 = 'https://api.yombo.net/api/v1/gateway/PZywd7j0VLR4PzWz/device_type'
headers = {
    'x-api-key': 'abc123xyz789',
    'authorization': 'Waro7g0Mwl4YBJ...',
    }
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     "response": {
 3         "uri": "/api/v1/gateway/PZywd7j0VLR4PzWz/device_type",
 4         "uri_description": "List of possible device types for a gateway.",
 5         "doc_uri": "https://yombo.net/API:Gateways",
 6         "gateway_device_type": [
 7             {
 8                 "id": "7BxzOXpb",
 9                 "category_id": "dD8X67zW",
10                 "machine_label": "x10_house",
11                 "label": "X10 House Code",
12                 "description": "Send an X10 housecode - A single letter A-P.",
13                 "platform": null,
14                 "public": 2,
15                 "status": 1,
16                 "created_at": 1482065387,
17                 "updated_at": 1482065387,
18                 "variable_groups": [],
19                 "variable_fields": [],
20                 "always_load": 1
21             },
22             {
23                 "id": "pyXnExEL",
24                 "category_id": "dD8X67zW",
25                 "machine_label": "x10_lamp",
26                 "label": "X10 Lamp",
27                 "description": "An X10 lamp module or device.",
28                 "platform": "x10_light,light",
29                 "public": 2,
30                 "status": 1,
31                 "created_at": 1482065387,
32                 "updated_at": 1482065387,
33                 "variable_groups": [
34                     {
35                         "id": "VnogrX2jXAzEJ",
36                         "relation_id": "pyXnExEL",
37                         "relation_type": "device_type",
38                         "group_machine_label": "x10_address",
39                         "group_label": "X10 Address 1",
40                         "group_description": "X10 Address information",
41                         "group_weight": 1,
42                         "status": 1,
43                         "created_at": 1482065388,
44                         "updated_at": 1482065388
45                     }
46                 ],
47                 "variable_fields": [
48                     {
49                         "id": "90MlzLxOo5XAr2",
50                         "group_id": "VnogrX2jXAzEJ",
51                         "field_machine_label": "house",
52                         "field_label": "House Code",
53                         "field_description": "House code A-P.",
54                         "field_weight": 0,
55                         "value_required": 0,
56                         "value_max": 0,
57                         "value_min": 0,
58                         "encryption": "nosuggestion",
59                         "value_casing": "none",
60                         "input_type_id": "gowWdDyk",
61                         "default_value": "",
62                         "field_help_text": "The house code of the X10 module, in the range between A and P.",
63                         "multiple": false,
64                         "created_at": 1482065388,
65                         "updated_at": 1482065389
66                     },
67                     {
68                         "id": "XJYae1q6oANlp0",
69                         "group_id": "VnogrX2jXAzEJ",
70                         "field_machine_label": "unit_code",
71                         "field_label": "Unit Code",
72                         "field_description": "X10 unit code, 1-16",
73                         "field_weight": 1,
74                         "value_required": 0,
75                         "value_max": 16,
76                         "value_min": 1,
77                         "encryption": "nosuggestion",
78                         "value_casing": "none",
79                         "input_type_id": "PLDAaDBX",
80                         "default_value": "",
81                         "field_help_text": "",
82                         "multiple": false,
83                         "created_at": 1482065388,
84                         "updated_at": 1499459267
85                     }
86                 ],
87                 "always_load": 1
88             }
89         ],
90         "locator": "gateway_device_type",
91         "locator_type": "objects"
92     },
93     "code": 200,
94     "warnings": [],
95     "message": "OK",
96     "html_message": "OK"
97 }

GET - Gateway device type commands

A read only resource. Page limit and filtering is not available.

Get all possible device type commands for a gateway. This includes all device type commands for all gateways within a cluster. This takes into consideration modules installed onto the gateways and device types assigned to those modules.

Request URLs

  • GET https://api.yombo.net/api/v1/gateway/{gateway_id}/device_type_command

Parameters

None

Example

{{API example | curl=curl \ -H "x-api-key: abc123xyz789" \ -H "authorization: Bearer Waro7g0Mwl4YBJ..." \ https://api.yombo.net/api/v1/gateway/PZywd7j0VLR4PzWz/device_type_command | python=import requests

url = 'https://api.yombo.net/api/v1/gateway/PZywd7j0VLR4PzWz/device_type_command' headers = {

   'x-api-key': 'abc123xyz789',
   'authorization': 'Waro7g0Mwl4YBJ...',
   }

response = requests.get(url, headers=headers) | json={{

   "response": {
       "uri": "/api/v1/gateway/PZywd7j0VLR4PzWz/device_type_command",
       "uri_description": "List of possible device type commands for a gateway.",
       "doc_uri": "https://yombo.net/API:Gateways",
       "gateway_device_type_command": [
           {
               "id": "g0aYKR4v",
               "device_type_id": "pyXnExEL",
               "command_id": "aWvzB0ENZ23JO",
               "created_at": 1482065387
           },
           {
               "id": "nJ3m4Na8",
               "device_type_id": "o6xaZXbQ",
               "command_id": "grEylYo2ZY1L3",
               "created_at": 1504771909
           }
       ],
       "locator": "gateway_device_type_command",
       "locator_type": "integer"
   },
   "code": 200,
   "warnings": [],
   "message": "OK",
   "html_message": "OK"

} }}

GET - Gateway DNS

Page limit and filtering is not available.

Retrieves domain name information for a gateway.

Request URLs

  • GET https://api.yombo.net/api/v1/gateway/{gateway_id}/dns_name

Parameters

None

Example

  <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-api-key: abc123xyz789" \
-H "authorization: Bearer Waro7g0Mwl4YBJ..." \
https://api.yombo.net/api/v1/gateway/PZywd7j0VLR4PzWz/dns_name
  <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 = 'https://api.yombo.net/api/v1/gateway/PZywd7j0VLR4PzWz/dns_name'
headers = {
    'x-api-key': 'abc123xyz789',
    'authorization': 'Waro7g0Mwl4YBJ...',
    }
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     "response": {
 3         "uri": "/api/v1/gateway/PZywd7j0VLR4PzWz/dns_name",
 4         "uri_description": "View gateway DNS Name information.",
 5         "doc_uri": "https://yombo.net/API:Gateways",
 6         "dns_name": {
 7             "gateway_id": "PZywd7j0VLR4PzWz",
 8             "dns_name": "zeros",
 9             "dns_domain_id": "zd49p5",
10             "dns_domain": "example.com",
11             "allow_change_at": 1504745551,
12             "fqdn": "zeros.example.com"
13         },
14         "locator": "dns_name",
15         "locator_type": "object"
16     },
17     "code": 200,
18     "warnings": [],
19     "message": "OK",
20     "html_message": "OK"
21 }

POST - New or update gateway DNS

This endpoint created or updates a DNS domain name. The http verbs PATCH and PUT mapped to the POST http verb for compatibility and all function the same.

Request URLs

  • POST https://api.yombo.net/api/v1/gateway/{gateway_id}/dns_name

Parameters

Name Type Description
Required
dns_domain_id string The domain ID, retrieved from DNS Domains.
dns_name string The desired 3rd level domain. Can only contain letters and numbers, must have at least one letter.

Example

  <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-api-key: abc123xyz789" \
-H "authorization: Bearer Waro7g0Mwl4YBJ..." \
-X POST -d '{"label": "Master bedroom", "machine_name": "master_bedroom",
 "description": "Handles master bedroom bluetooth tracker and IR blaster."}' \
https://api.yombo.net/api/v1/gateway/PZywd7j0VLR4PzWz/dns_name
  <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 = 'https://api.yombo.net/api/v1/gateway/PZywd7j0VLR4PzWz/dns_name'
headers = {
    'x-api-key': 'abc123xyz789',
    'authorization': 'Waro7g0Mwl4YBJ...',
    }

payload = {
    "label": "Master bedroom",
    "machine_name": "master_bedroom",
    "description": "Handles master bedroom bluetooth tracker and IR blaster.",
    }

response = requests.post(url, headers=headers, json=payload)
  <div id="output<random_number></random_number>" class="tab-pane fade" style="border: 1px solid #ccc; border-radius: 5px; padding: 0.7em;">
 1 {
 2     "response": {
 3         "uri": "/api/v1/gateway/PZywd7j0VLR4PzWz/dns_name",
 4         "uri_description": "Create new gateway dns name.",
 5         "doc_uri": "https://yombo.net/API:Gateways",
 6         "dns_name": {
 7             "gateway_id": "PZywd7j0VLR4PzWz",
 8             "dns_name": "example2",
 9             "dns_domain_id": "zd49p5",
10             "dns_domain": "yombo.me",
11             "allow_change_at": 1521250092,
12             "fqdn": "example2.yombo.me"
13         },
14         "locator": "dns_name",
15         "locator_type": "object"
16     },
17     "code": 201,
18     "warnings": [],
19     "message": "Created",
20     "html_message": "Created"
21 }

GET - Gateway input types

A read only resource. Page limit and filtering is not available.

Get all possible input types for a gateway. This includes all device type commands for all gateways within a cluster. This takes into consideration modules installed onto the gateways and device types assigned to those modules.

Request URLs

  • GET https://api.yombo.net/api/v1/gateway/{gateway_id}/input_type

Parameters

None

Example

  <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-api-key: abc123xyz789" \
-H "authorization: Bearer Waro7g0Mwl4YBJ..." \
https://api.yombo.net/api/v1/gateway/PZywd7j0VLR4PzWz/input_type
  <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 = 'https://api.yombo.net/api/v1/gateway/PZywd7j0VLR4PzWz/input_type'
headers = {
    'x-api-key': 'abc123xyz789',
    'authorization': 'Waro7g0Mwl4YBJ...',
    }
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     "response": {
 3         "uri": "/api/v1/gateway/PZywd7j0VLR4PzWz/input_type",
 4         "uri_description": "List of possible input types for a gateway.",
 5         "doc_uri": "https://yombo.net/API:Gateways",
 6         "gateway_input_type": [
 7             {
 8                 "id": "axQ9Ow0e",
 9                 "category_id": "3d7lwmZV",
10                 "machine_label": "yombo_command",
11                 "label": "Yombo Command",
12                 "description": "A command that is available to a Yombo gateway.",
13                 "input_regex": null,
14                 "public": 2,
15                 "status": 1,
16                 "created_at": 1494572707,
17                 "updated_at": 1494575956,
18                 "always_load": 1
19             },
20             {
21                 "id": "0KDGLxQl",
22                 "category_id": "3d7lwmZV",
23                 "machine_label": "checkbox",
24                 "label": "Checkbox",
25                 "description": "A simple yes/no, on/off checkbox.",
26                 "input_regex": null,
27                 "public": 2,
28                 "status": 1,
29                 "created_at": 1513904761,
30                 "updated_at": 1513904761,
31                 "always_load": 1
32             }
33         ],
34         "locator": "gateway_input_type",
35         "locator_type": "objects"
36     },
37     "code": 200,
38     "warnings": [],
39     "message": "OK",
40     "html_message": "OK"
41 }
This page was last edited on 15 September 2018.