PHP code example of hikingyo / php-ovh-api

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

    

hikingyo / php-ovh-api example snippets



$client = new Hikingyo\Ovh\Client();
$client->setEndpoint('ovh-eu');

$time = $client->auth()->time();

// Some endpoint need authentication
// See https://docs.ovh.com/gb/en/api/first-steps-with-ovh-api/ to get your consumer key and secret
$client->authenticate('<your_application_key>', '<your_application_secret>', '<your_consumer_key>');

$domains = $client->domain()->list()

$plugin = new Http\Client\Common\Plugin\HeaderSetPlugin([
    'User-Agent' => 'Foobar',
]);
$factory = new Hikingyo\Ovh\HttpClient\HttpClientFactory();
$factory->addPlugin($plugin);
$client = new Hikingyo\Ovh\Client($factory);