![](API%20Documentation%200a0238ed88c544ec979ee75eb48081ab/wiki-thin.png)
API Documentation
Owner | Kasun Wathsara Hapangama |
---|---|
Tags | Process |
Notion HTTP API Documentation
Introduction
This documentation provides an overview of the RESTful API endpoints and functionalities implemented by the SimpleWebsite plugin. The API allows interaction with the Minecraft Server through HTTP requests, providing various features like retrieving placeholders, server status, player information, and more.
The base URL for the API is your server Ip and website port. as an example http://120.55.22.44:8081
API Endpoints
1. Retrieve a Random Number
Endpoint
/api/random/
Method
GET
Description
Generates a random number and returns it in JSON format. you can use this for test the API
Response
{
"value": 478
}
2. Retrieve Placeholder Value
Endpoint
/api/placeholder/{id}
Method
GET
Description
Retrieves the value of a specific placeholder identified by {id}
and returns it in JSON format.
Parameters
id
(string): The placeholder ID. Eg : - server_online
Response
{
"value": "Placeholder Value"
}
3. Retrieve Values for Multiple Placeholders
Endpoint
/api/placeholders/{id1},{id2},...
Method
GET
Description
Retrieves values for multiple placeholders identified by a comma-separated list of {id}
and returns them in JSON format.
Parameters
id1, id2, ...
(string): Comma-separated placeholder IDs. Eg: server_online, server_ping
Response
{
"id1": "Value1",
"id2": "Value2",
...
}
4. Retrieve Player Information
Endpoint
/api/players/{type}/
Method
GET
Description
Retrieves player information (online or offline) and returns it in JSON format.
Parameters
type
(string): Specifies the type of players to retrieve. Can be "online" or "offline".
Response (Example for online players)
[
{
"name": "Player1",
"uuid": "12345678-90ab-cdef-1234-567890abcdef"
},
{
"name": "Player2",
"uuid": "98765432-10ab-fedc-5678-90abcdef3210"
}
]
5. Retrieve Number of Online Players
Endpoint
/api/online/
Method
GET
Description
Retrieves the number of online players and returns it in JSON format.
Response
{
"value": 10
}
6. Retrieve Maximum Players
Endpoint
/api/max/
Method
GET
Description
Retrieves the maximum number of players allowed on the server and returns it in JSON format.
Response
{
"value": 100
}
7. Retrieve Server Status
Endpoint
/api/status/
Method
GET
Description
Retrieves the server status and returns it in JSON format.
Response
{
"value": "Server is online"
}
8. Retrieve Server Version
Endpoint
/api/version/
Method
GET
Description
Retrieves the server version and returns it in JSON format.
Response
{
"value": "Spigot 1.17.1"
}
Conclusion
The SimpleWebsite HTTP API provides a simple and convenient way to fetch data from a Minecraft Server, allowing developers to access server-related information and retrieve data using standardized RESTful endpoints. By utilizing these endpoints, developers can integrate various functionalities into their applications or systems.