A sample client using Python requests and requests_oauthlib to retrieve a list of sensors from the Everactive Platform API
API Documentation: https://docs.api.everactive.com
To use this sample you must have a client_credentials grant_type client_id and client_secret provided by Everactive. These must be assigned to environment variables EVERACTIVE_CLIENT_ID and EVERACTIVE_CLIENT_SECRET, respectively. Additionally, environment variable EVERACTIVE_API_URL must be set to the Everactive API base url.
To install the dependencies run
pip install -r requirements.txtTo execute the Steamtrap example
EVERACTIVE_API_URL="https://api.data.everactive.com" \
EVERACTIVE_CLIENT_ID="YOUR CLIENT ID" \
EVERACTIVE_CLIENT_SECRET="YOUR CLIENT SECRET" \
python api_service.pyIn case you don't want to use a local Python environment, a Dockerfile is included that runs the application inside a container.
To Build:
docker build -t python_api/test .To Run:
docker run \
-it \
--rm \
--env EVERACTIVE_API_URL="https://api.data.everactive.com" \
--env EVERACTIVE_CLIENT_ID="YOUR CLIENT ID" \
--env EVERACTIVE_CLIENT_SECRET="YOUR CLIENT SECRET" \
python_api/test