1. Go to this page and download the library: Download forxer/ovh-sdk 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/ */
forxer / ovh-sdk example snippets
use OvhSdk\Auth\ApplicationKeys;
use OvhSdk\Enums\RecordType;
use OvhSdk\Enums\Region;
use OvhSdk\Ovh;
$ovh = new Ovh(
region: Region::Eu,
credentials: new ApplicationKeys('application-key', 'application-secret', 'consumer-key'),
);
// Read every domain of the account
foreach ($ovh->domain()->list() as $domain) {
echo $domain->domain.' expires on '.$domain->expirationDate->format('Y-m-d').PHP_EOL;
}
// Create a DNS record, then publish the zone
$zone = $ovh->domain()->zone('example.com');
$zone->records()->create(type: RecordType::A, target: '203.0.113.10', subDomain: 'app', ttl: 3600);
$zone->refresh();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.