PHP code example of mlackman / upcloud-php-api

1. Go to this page and download the library: Download mlackman/upcloud-php-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/ */

    

mlackman / upcloud-php-api example snippets


    


_instance = new Upcloud\ApiClient\Upcloud\AccountApi();
$config = $api_instance->getConfig();
$config->setUsername('YOUR UPCLOUD USERNAME');
$config->setPassword('YOUR UPCLOUD PASSWORD');

try {
    $result = $api_instance->getAccount();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AccountApi->getAccount: ', $e->getMessage(), PHP_EOL;
}


{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/upcloudltd/upcloud-php-api.git"
    }
  ],
  "