Bulk transferDomainRequest

From Openprovider API documentation

Jump to: navigation, search

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";
}

?>
Views
Personal tools