This documentation has moved

XML API documentation can now be found at developer.openprovider.com. This page will remain available until September 2026, but will no longer be updated.

The XML API itself is not changing. Your existing integration continues to work.

Bulk transferDomainRequest

From Openprovider API documentation

(Difference between revisions)
Jump to: navigation, search
Line 14: Line 14:
  foreach ($domains as $domain) {
  foreach ($domains as $domain) {
      
      
-
     $domainexploded = explode(",", $domain);
+
     $domainexploded = explode(",", $domain, 2);
      
      
     $request = new OP_Request;
     $request = new OP_Request;

Revision as of 13:22, 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, 2);
   
   $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