1. Go to this page and download the library: Download exbil/reselling-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/ */
// Snapshot
$client->cloudServices()->backups()->create('a1b2c3d4-...', 'pre-update');
// Download locally (encrypted .tar.gz — keep as-is for re-upload)
$client->cloudServices()->backups()->download(
'a1b2c3d4-...',
'backup-uuid-here',
'/tmp/my-backup.tar.gz',
);
// Re-upload a backup you saved earlier
$client->cloudServices()->backups()->upload(
'a1b2c3d4-...',
'/tmp/my-backup.tar.gz',
);
// Restore. switch_template defaults to true — when the archive was
// taken on a different template the service is flipped over to that
// template before extracting. Pass force=true for operator recovery
// (skips both the cross-team and cross-template guards).
$client->cloudServices()->backups()->restore(
'a1b2c3d4-...',
'backup-uuid-here',
['switch_template' => true],
);
// Lock an archive against the retention sweep
$client->cloudServices()->backups()->toggleLock('a1b2c3d4-...', 'backup-uuid-here');
$status = $client->cloudServices()->network()->status('a1b2c3d4-...');
if ($status['enabled'] && ($status['healthcheck']['healthy'] ?? false)) {
$addr = $client->cloudServices()->network()->orderIpv6('a1b2c3d4-...');
echo $addr['data']['ipv6']; // e.g. 2a0e:97c0:440:105::abcd
}
// Pricing + available locations (datacenters with free capacity)
$pricing = $client->teamSpeak()->getPricing();
// Order a server (optionally in a specific datacenter)
$server = $client->teamSpeak()->order('My Server', 64);
$server = $client->teamSpeak()->order('My Server', 64, datacenterId: 2);
// List / show / delete
$servers = $client->teamSpeak()->getAll();
$server = $client->teamSpeak()->get(1);
$client->teamSpeak()->delete(1);
// Live view (info + channels + connected clients) and advanced data
$view = $client->teamSpeak()->view(1);
$extras = $client->teamSpeak()->extras(1); // groups, tokens, bans, complaints, log
// Power
$client->teamSpeak()->start(1);
$client->teamSpeak()->stop(1);
// Settings
$client->teamSpeak()->resize(1, 128); // subject to the host's free capacity
$client->teamSpeak()->updateSettings(1, ['name' => 'New name', 'password' => 'secret']);
$client->teamSpeak()->broadcast(1, 'Maintenance in 5 minutes');
// Download a base64 snapshot (returned under data.snapshot)
$snapshot = $client->teamSpeak()->backups()->download(1)['data']['snapshot'];
// Restore from a snapshot (overwrites channels, groups and permissions)
$client->teamSpeak()->backups()->restore(1, $snapshot);
use Exbil\ResellingAPI\Exceptions\ApiException;
use Exbil\ResellingAPI\Exceptions\AuthenticationException;
use Exbil\ResellingAPI\Exceptions\ForbiddenException;
use Exbil\ResellingAPI\Exceptions\NotFoundException;
use Exbil\ResellingAPI\Exceptions\ValidationException;
try {
$server = $client->rootServer()->get(99999);
} catch (AuthenticationException $e) {
// 401 - Invalid API key
echo "Authentication failed: " . $e->getMessage();
} catch (ForbiddenException $e) {
// 403 - No permission
echo "Access denied: " . $e->getMessage();
} catch (NotFoundException $e) {
// 404 - Resource not found
echo "Not found: " . $e->getMessage();
} catch (ValidationException $e) {
// 422 - Validation error
echo "Validation error: " . $e->getMessage();
print_r($e->getValidationErrors());
} catch (ApiException $e) {
// Other API errors
echo "API error: " . $e->getMessage();
echo "Status code: " . $e->getCode();
}