PHP code example of jelix / gandi-v5

1. Go to this page and download the library: Download jelix/gandi-v5 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/ */

    

jelix / gandi-v5 example snippets



use Jelix\GandiApi\Configuration;

$configuration = new Configuration('my api key');




// List of organizations

use Jelix\GandiApi\ApiV5\Organizations;
$organizations = new Organizations($configuration);

$list = $organizations->getList();
foreach($list as $organization) {
    echo $organization->getName() . ", " . $organization->getType(). ", ".$organization->getId() . "\n" ;
}

// Create a zone Record
use Jelix\GandiApi\ApiV5\LiveDns\ZoneRecord;
$apiLiveDns = new \Jelix\GandiApi\ApiV5\LiveDns($configuration);

$record = new ZoneRecord(
    'myrecordname', // name
    'A', // type
    ['127.0.0.1'], // values
    10800 // ttl
);

$message = $apiLiveDns->createRecord('my.domain', $record);