Connect through the local network
To use the HTTP API, connect your computer to the uplink network of the gateway (Network interfaces & requirements) and find the gateway's IP address in the Gateway: Info page of the webapp.
The HTTP API can be reached on port 4000 of this IP address. Make sure to include the version, v1, in the URL.
From version 2020.3 on it is also possible to reach the api via the default HTTP port, port 80. You will need to include api and the version, v1, in the URL.
import requests try: response = requests.get('http://192.168.80.178/api/v1/alerts') response.raise_for_status() alerts = response.json().get('alerts') print(alerts) except requests.exceptions.HTTPError as errh: print(errh) except requests.exceptions.ConnectionError as errc: print(errc) except requests.exceptions.Timeout as errt: print(errt) except requests.exceptions.RequestException as err: print(err)
Connect through the cloud
The HTTP API is not available through the cloud.