PHP code example of multiplayer-gratis / api-client
1. Go to this page and download the library: Download multiplayer-gratis/api-client library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
multiplayer-gratis / api-client example snippets
use MultiplayerGratis\Client;
$client = new Client(getenv('MULTIPLAYER_GRATIS_API_KEY'));
// Konto mit Coin-Guthaben
$account = $client->getAccount();
// Alle Server
$servers = $client->getServers();
// Details & Status eines Servers
$server = $client->getServer(123);
// Auslastung: CPU, RAM, Speicher, Laufzeit
$resources = $client->getServerResources(123);
// Power-Aktionen
$client->startServer(123);
$client->stopServer(123);
$client->restartServer(123);
$client->killServer(123); // sofort beenden
// oder generisch
use MultiplayerGratis\PowerSignal;
$client->sendPowerSignal(123, PowerSignal::Restart);
use MultiplayerGratis\Client;
use MultiplayerGratis\Http\CurlHttpClient;
$client = new Client($apiKey, http: new CurlHttpClient(timeout: 30, connectTimeout: 10));
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.