Time4VPS lib is a PHP library that makes easy to interact with Time4VPS UserAPI.
Use composer
package manager to install library:
composer install time4vps/lib
require_once __DIR__ . '/vendor/autoload.php';
// Auth details
$username = 'user';
$password = 'pass123';
Time4VPS\Base\Endpoint::Auth($username, $password);
// Get server details
$server_id = 748457;
$server = new Time4VPS\API\Server($server_id);
var_dump($server->details());
// Reboot server
try {
$server->reboot();
} catch (Time4VPS\Exceptions\APIException $e) {
die("Failed to reboot server: {$e->getMessage()}");
}