Requests v0.1.0

API for your minecraft server
requests.png
This plugin is WIP, releases for pre 1.19.4 will be added soon. Check the github for more information on updates.

Requests - A REST API for Minecraft Servers

Requests is a PaperMC plugin that provides a RESTful API for Minecraft servers. With Requests, server admins can easily query and interact with their servers using simple REST semantics.

Features
  • RESTful API for Minecraft servers
  • Query server information such as player count and server status
  • Send commands to the server
  • Authenticate requests using API keys
  • Easy to use and integrate

Usage
Requests exposes a RESTful API that can be accessed using HTTP requests. The base URL for the API is http://localhost:5000[I][/I] and can be configured in config.toml.

Code:
[plugin]
salt = "change this"
prefix = "<light_purple>[requests]<reset> "


[database]
tokens = "tokens.db"
players = "players.db"


[api]
port = 5000
vault = false
luckperms = false

Authentication
Requests uses API keys to authenticate requests. To generate an master API key, use the following command in the server console:
/api generate-key <name>[I][/I]

The <name> parameter is optional and can be used to give the key a custom name. The generated API key will be displayed in the console.

To generate an player API key, use the following command in game:
/api token new

To authenticate a request, include the API key in the Authorization header of the HTTP request:
Authorization: Bearer <api_key>

API Endpoints
Requests provides the following API endpoints:

GET /server
Returns the status of the Minecraft server.

GET /players
Returns a list of online players on the Minecraft server.

GET /player/<uniqueId>
Returns the information of a player.

POST /command
Sends a command to the Minecraft server. This route can be used by admin token only, and is disabled by default.

Example Requests

Get server status
Bash:
GET /server HTTP/.1
Authorization: Bearer <api_key>
User-Agent: Example Agent/0.0.1

Get player profile
Bash:
GET /player/<uniqueId> HTTP/1.1
Authorization: Bearer <api_key>
User-Agent: Example Agent/0.0.1

Send command
Bash:
POST /command HTTP/1.1
Authorization: Bearer <api_key>
Content-Type: application/json; charset=utf-8
User-Agent: Example Agent/0.0.1
Content-Length: 31

{"command":"say Hello, World!"}

Build
To build Requests from source, follow these steps:

1. Clone the repository: git clone https://github.com/theMackabu/requests.git
2. Navigate to the cloned repository: cd requests
3. Build the plugin using Gradle: ./gradlew shadowJar
4. The built JAR file will be located at build/libs/requests-<version>-all.jar.

## License
Requests is licensed under the GPL-3 License
EULA: Standard EULA
290 Views
6 Downloads
May 9, 2023 Published
May 9, 2023 Updated
Not yet rated
18.8 MB File size
Type
  1. Staff
  2. Library
Supported software
  1. Paper
Supported versions
  1. 1.19
Creator
Struggling to cover the costs of your server? Set up your own webstore with Tebex in under 30 seconds.
Recommended for you
#1 BuiltByBit Plugin ~ Protects your server from crash packet exploits ~ Folia Support
5.00 star(s) 116 ratings
3,064 purchases
The ultimate chat formatting and filtering plugin. Can replace 200+ plugins. Customizable & fast.
5.00 star(s) 120 ratings
2,467 purchases
All-in-one dungeon creator. Create unlimited, timed dungeon experiences with your own builds
4.50 star(s) 63 ratings
2,291 purchases
High Performance | Customizable | Cross-Version | GeyserMC | Folia Support
5.00 star(s) 59 ratings
2,189 purchases
Protect your server from crash/dupe/packets exploits with the ultimate Spigot security fix plugin.
5.00 star(s) 24 ratings
1,682 purchases
290 Views
6 Downloads
May 9, 2023 Published
May 9, 2023 Updated
Not yet rated
18.8 MB File size
Type
  1. Staff
  2. Library
Supported software
  1. Paper
Supported versions
  1. 1.19
Creator
Struggling to cover the costs of your server? Set up your own webstore with Tebex in under 30 seconds.
Recommended for you
#1 BuiltByBit Plugin ~ Protects your server from crash packet exploits ~ Folia Support
5.00 star(s) 116 ratings
3,064 purchases
The ultimate chat formatting and filtering plugin. Can replace 200+ plugins. Customizable & fast.
5.00 star(s) 120 ratings
2,467 purchases
All-in-one dungeon creator. Create unlimited, timed dungeon experiences with your own builds
4.50 star(s) 63 ratings
2,291 purchases
High Performance | Customizable | Cross-Version | GeyserMC | Folia Support
5.00 star(s) 59 ratings
2,189 purchases
Protect your server from crash/dupe/packets exploits with the ultimate Spigot security fix plugin.
5.00 star(s) 24 ratings
1,682 purchases
Top