PHP code example of register-ch / register-api
1. Go to this page and download the library: Download register-ch/register-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/ */
register-ch / register-api example snippets
nt = new \RegisterCh\Client(
[
'debug' => true,
'base_uri' => 'https://api.register.ch',
'registerch_api_key' => 'XXXX',
'registerch_api_secret' => 'YYYY'
]
);
$body = new \stdClass();
$body->domain_name = 'domain-name-to-register.eu';
// Register domain name
$response = $client->post('/v2/domains/registrations', ['json' => $body]);
// Dump location header with link to provisioning job
var_dump(
$response->getHeader('Location')
);