SureFlap API is a simple, yet powerful RESTful API for products from Sure Petcare.
docker run -d -p 8080:3001 -e SUREFLAP_EMAIL='{YOUR_SUREFLAP_EMAIL}' -e SUREFLAP_PASSWORD='{YOUR_SUREFLAP_PASSWORD}' fabieu/sureflap-api:latest
For all available options take a look at the Configuration section.
Clone this repository to your system and move into the sureflap project subfolder:
git clone https://gitlab.com/sustineo/sureflap-api.git
This project utilizes Poetry, a tool for dependency management and packaging in Python. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you (https://python-poetry.org/).
Install poetry via pip:
pip install --user poetry
Installing required dependencies and move into the virtual environment created by Pipenv:
poetry install
Set at least the required environment variables:
export SUREFLAP_EMAIL={YOUR_SUREFLAP_EMAIL}
export SUREFLAP_PASSWORD={YOUR_SUREFLAP_PASSWORD}
Start the integrated webserver with the following command:
poetry run python .\sureflap_api\main.py
For all available options take a look at the Configuration section.
The configuration is done via environment variables. The following options are available:
Email of your Sure Petcare account. Make sure to use an account with control privileges if you want to use the full capabilities of this API. You can change the privileges on the official Sure Petcare website.
Password of the in SUREFLAP_EMAIL
specified Sure Petcare account.
Default: info
The SUREFLAP_LOGLEVEL
option controls the level of log output and can be changed to be more or less verbose, which might be useful when you are dealing with an unknown issue.
trace
: Show every detail, like all called internal functions.debug
: Shows detailed debug information.info
: Normal (usually) interesting events.warning
: Exceptional occurrences that are not errors.error
: Runtime errors that do not require immediate action.fatal
: Something went terribly wrong. Add-on becomes unusable.
Default: 3001
The port for the ASGI server. This is the same as the port used for API requests. Please make sure that the specified port isn't used by another application.
Default: None
Enables CORS (Cross-Origin Resource Sharing) for the specified domain names or ip adresses. Define a comma-seperated list of fully qualified domain names or ip adresses or *
to enable CORS for all domains. The latter is not recommended from a security perspective.
For details about all API endpoints and the corresponding request and response models take a look at the automatically generated OpenAPI documentation:
Here you will find everything you need to know about the available endpoints and how to call them.
If you have additional questions feel free to open an issue here on GitLab.
This repository keeps a changelog using GitLab's releases functionality.
Releases are based on Semantic Versioning, and use the format of MAJOR.MINOR.PATCH
. In short, the version will be incremented based on the following:
MAJOR
: Incompatible or major changes.MINOR
: Backwards-compatible new features and enhancements.PATCH
: Backwards-compatible bugfixes and package updates.
Thanks to alextoft and hdurdle for their GitHub projects and shared resources about the SureFlap API.
You can look at the projects following the links below:
Copyright 2020-2021 Fabian Eulitz
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.