A brief tutorial on how to use the API to perform some frequently needed tasks.
Get the environment created by an Edge hub.
When a new Edge hub is initialized, an associated environment is created into which all connected devices will be placed. In order to get this environment via the API, the Edge ID of the hub must be known; the ID is generally the hub's MAC address. The Edge ID is added as a query parameter to the normal environment listing endpoint.
To list the environment associated with the Edge hub:
GET https://ioe.droplit.io/api/environments/?ecosystemId=C9ba0b90d2bcc7b87272bb3c2&edgeId=b6:2e:e2:59:0c:21 HTTP/1.1
authorization: AUTH_TOKEN
Get the devices connected to an Edge hub.
When a device connects to an Edge hub, the device is added to the environment associated with that hub. When querying the environment's devices for those connected to the hub, a filter containing the Edge ID of the hub, generally the hub's MAC address, may be used. This filter is applied as a query parameter to the normal device listing endpoint in addition to the required environment ID parameter.
To list the devices connected to an Edge hub:
GET https://ioe.droplit.io/api/devices/?environmentId=E59e347bc2a0c6199651d6da1&filter=eq(edgeId, "b6:2e:e2:59:0c:21") HTTP/1.1
authorization: AUTH_TOKEN