Configuration update via API
Last updated
Last updated
If your Gateway is password protected, you can configure the Gateway to allow you to update the configuration on it programmatically using bearer authentication.
On the "Access Settings" page, enable full access using bearer authentication and set the API-key:
If your Gateway is password protected and bearer authentication is not configured, you can still access the Gateway by using the 'RUUVISESSION' cookie from your browser. Open the configuration wizard in your browser and authenticate with the password, then open 'Developer Tools' in your browser, then open URL 'http://<RUUVI_GW_IP>/ruuvi.json'. In 'Developer Tools', open the 'Network' tab, select the 'Headers' sub-tab and locate the "RUUVISESSION" cookie:
Please note that you can only access the Gateway using the cookie from the same PC as the browser used for authentication.
In the following examples, the gateway configuration is stored in the 'ruuvi.json' file.
The Gateway is remotely configurable without a password:
The Gateway is remotely configurable using a bearer token:
Using a cookie from the browser to access the Gateway:
To upload the configuration from the "./ruuvi.json" file:
The Gateway is remotely configurable without a password:
The Gateway is remotely configurable using a bearer token:
Using a cookie from the browser to access the Gateway:
These examples show how to disable relaying data to the Ruuvi cloud, custom HTTP(S) server and MQTT.
The Gateway is remotely configurable without a password:
The Gateway is remotely configurable using a bearer token:
Using a cookie from the browser to access the Gateway:
Note: The network settings must be uploaded separately from the main Gateway configuration.
Example of "ruuvi.json" with the network settings (See Gateway configuration):
The network configuration must contain the use_eth key and the main Gateway configuration must not.