webapi/acapi/mcuuid.php

15 lines
422 B
PHP

<?php
$curl_h = curl_init('https://api.minetools.eu/uuid/' . $_GET["id"]);
curl_setopt($curl_h, CURLOPT_RETURNTRANSFER, true);
$json = json_decode(curl_exec($curl_h));
$obj = new stdClass();
if ($json->{'status'} == "OK") {
$obj->status = 200;
$obj->uuid = $json->{'id'};
$obj->name = $json->{'name'};
} else {
$obj->status = 404;
}
echo json_encode($obj);