REST API
No authentication
The endpoints described below are not authenticated and should only be used on a secure, private LAN.
GPIO Mocking
GPIO interaction is mocked when Endrpi is run on non-rpi systems for the purpose of testing.
Prerequisites#
Local documentation#
While Endrpi is running, access interactive REST documentation by navigating to http://localhost:5000/docs .
Examples#
Example requests for server platform information.
// Using a built-in library
fetch('http://localhost:5000/system/platform')
.then(response => response.json())
.then(data => console.log(data));
// Using the axios library
axios.get('http://localhost:5000/system/platform')
.then(data => console.log(data));
# Using a built-in library
import urllib.request
response = urllib.request.urlopen('http://localhost:5000/system/platform').read()
print(response)
# Using the requests library
import requests
response = requests.get('http://localhost:5000/system/platform')
print(response.json())
curl http://localhost:5000/system/platform