MinetopiaSDB-RESTAPI
Simple json rest api to use with the MinetopiaSDB Minecraft plugin. Beware that you need to have te
MinetopiaSDB plugin installed on your server.
Below you can see what a default response looks like.
Code (Text):
{
"success":true,
"timeDays":0,
"level":1,
"prefix":"Zwerver",
"luckyshards":"0.000",
"timeHours":0,
"uuid":"079d6194-3c53-42f8-aac9-8396933b5646",
"timeSeconds":0,
"graycoins":0,
"grayshards":"0.0",
"fitness":20,
"goldshards":"0.000",
"timeMinutes":0
}
NodeJS Example
Make sure you have node-fetch installed, or use
npm i node-fetch
Code (Text):
let url = "http://SERVERIP:PORT/api/player/PLAYERNAME";
let response;
try {
response = await fetch(url, { method: "Get" });
} catch (err) {
return console.log('The api server could not be reached.');
}
const json = await response.json();
// now you can use json.level or whatever you need from the api in nodejs!