1. Go to this page and download the library: Download alaa-hany/contabo-api 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/ */
alaa-hany / contabo-api example snippets
// All API Calls made throw HTTPS
use Alaahany\ContaboApi\base\ContaboClient;
$client_id = "client_id"; // IP is preferred , we take care of get Domain
$client_secret = 'client_secret' ; // for example
$username = "username" ; //
$password = "password" ; //
$contaboClient = new ContaboClient($client_id , $client_secret , $username , $password);
var_dump($contaboClient->getComputeInstancesManagerInstance()->all());
var_dump($contaboClient->getComputeInstancesManagerInstance()->create('imageId' , \Alaahany\ContaboApi\operations\instances\Products::VPS_L ,\Alaahany\ContaboApi\operations\Regions::Germany , [
'license' => \Alaahany\ContaboApi\operations\instances\Licenses::cPanel5
] ));
var_dump($contaboClient->getComputeInstancesManagerInstance()->listHistory());
var_dump($contaboClient->getComputeInstancesManagerInstance()->listActionsHistory());
$instance = $contaboClient->getComputeInstancesManagerInstance()->getInstance('instanceId');
var_dump($instance->restart());
var_dump($instance->start());
var_dump($instance->shutdown());
var_dump($instance->stop());
var_dump($contaboClient->getPrivateNetworksManagerInstance()->all());
var_dump($contaboClient->getImagesManagerInstance()->listAvailable());
var_dump($contaboClient->getObjectStorageManagerInstance()->all());
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.