A Minecraft Pi centralized API.
To use the API you need to have Python >= 3.7.x
installed on your pi.
To install the API server and client, download or clone the repository and install the Python 3.x module using pip
:
git clone https://github.com/MCPI-Devs/mcpi-central.git
cd mcpi-central
pip3 install .
The client API exposes the following methods through the APIClient
class:
Authentication required | Endpoint | Method | Query parameters |
---|---|---|---|
❌ | /auth | GET | code |
Listens to http://localhost/callback
, waits for a Discord OAuth callback and exchanges the code
for the token
. You can generate this callback by opening this link, logging-in and authorizing the app in a web browser.
Authentication required | Endpoint | Method | Query parameters |
---|---|---|---|
✔️ | /servers/new | GET | name , ip , port |
Adds a new server to the database. The server should not already exist, to update a server information, use update_server
.
Authentication required | Endpoint | Method | Query parameters |
---|---|---|---|
✔️ | /servers/update | GET | name , ip , port |
Updates an existing server in the database. The user requesting this action should be the owner of the server.
Authentication required | Endpoint | Method | Query parameters |
---|---|---|---|
❌ | /server | GET | name |
Returns the information of an existing server in the database.
Authentication required | Endpoint | Method | Query parameters |
---|---|---|---|
❌ | /servers | GET | None |
Returns the names of the first 50 servers in the database.
There is a test.py
in the src
folder. It contains a basic usage example.
Because some developers could want to use custom methods to open the authorization page, like WebViews.
All the code of this project is licensed under the GNU General Public License version 2.0 (GPL-2.0).
All the documentation of this project is licensed under the Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.