PHP code example of sandwave-io / acronis-php

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

    

sandwave-io / acronis-php example snippets




use JMS\Serializer\SerializerBuilder;
use SandwaveIo\Acronis\AcronisClient;
use SandwaveIo\Acronis\Client\RestClient;
use SandwaveIo\Acronis\RestClientFactory;

$factory = new RestClientFactory(
    'api-endpoint',
    'client-identifier',
    'client-secret'
);

$serializerBuilder = new SerializerBuilder();
$restClient = new RestClient(
    $factory->create(),
    $serializerBuilder->build()
);

$acronisClient = new AcronisClient($restClient);
$acronisClient->getTenantClient()->get('tenant-guid');