Bulk transferDomainRequest
From Openprovider API documentation
(Difference between revisions)
(Created page with ' <?php require_once('API.php'); $api = new OP_API('https://api.openprovider.eu'); $username = '--'; $password = '--'; $domains = array('name1,tld,auth','name2,tld,auth',…') |
|||
| (2 intermediate revisions not shown) | |||
| Line 1: | Line 1: | ||
| + | Before using this script, please make sure to read [[API General Examples|API General Examples]] | ||
| + | |||
| + | Using this script is at your own risk! | ||
| + | |||
<?php | <?php | ||
require_once('API.php'); | require_once('API.php'); | ||
Current revision as of 13:23, 12 January 2016
Before using this script, please make sure to read API General Examples
Using this script is at your own risk!
<?php
require_once('API.php');
$api = new OP_API('https://api.openprovider.eu');
$username = '--';
$password = '--';
$domains = array('name1,tld,auth','name2,tld,auth','name3,tld,auth');
foreach ($domains as $domain) {
$domainexploded = explode(",", $domain);
$request = new OP_Request;
$request->setCommand('transferDomainRequest')->setAuth(array(
'username' => $username,
'password' => $password
))->setArgs(array(
'domain' => array(
'name' => $domainexploded[0],
'extension' => $domainexploded[1]
),
'authCode' => $domainexploded[2],
'period' => '1',
'ownerHandle' => '--',
'adminHandle' => '--',
'techHandle' => '--',
'nsGroup' => 'dns-openprovider',
'nsTemplateName' => 'Default'
)
));
echo "Starting transfer for: " . $domain . "\n";
$reply = $api->process($request);
echo "Result (0 means no error): " . $reply->getFaultString() . "\n";
}
?>