Page tree
Skip to end of metadata
Go to start of metadata

Overview

When you queue the transfer item, you add a package or account (transfer item) to the transfer list.

In these examples, the following statements are true:

  • You have two servers: remote.example.com and hostname.example.com
  • You logged in to the local server with the cpsess########## security token.
  • The example account owns example.com, and you want to transfer it from the remote server to the local server.
  • The example.com domain is 123,456,789 bytes.
  • You want to transfer the package1 package from the remote server to the local server.
  • The root password for the remote server is luggage12345  

Queue the transfer item

The function's structure depends on the transfer module into which that handles the transfer item. Use the enqueue_transfer_item function to add a transfer item to the transfer session, as in the following examples: 

https://hostname.example.com:2087/cpsess##########/json-api/enqueue_transfer_item?api.version=1&transfer_session_id=remoteexamplecopya20140211211719FxjU&module=AccountRemoteRoot&user=transferme&size=123456789&localuser=transferme&detected_remote_user=transferme&domain=transferme.com&replaceip=all&reseller=0&force=0&ip=0&skiphomedir=0&shared_mysql_server=0&skipres=1&skipacctdb=0&skipaccount=0&xferpoint=1

include_once '../xmlapi.php';

$ip = getenv('REMOTE_HOST');
$root_user = getenv('REMOTE_USER');
$root_pass = getenv('REMOTE_PASSWORD');

$xmlapi = new xmlapi($ip , $root_user , $root_pass);
$xmlapi->set_output('json');

$settings = array(
 'api.version'=>1, 
 'transfer_session_id' => 'remoteexamplecomnoroo20140501194105g7qG', 
 'module'=>'AccountRemoteRoot', 
 'user' => 'transferme', 
 'size' => '123456789', 
 'localuser' => 'transferme', 
 'detected_remote_user' => 'transferme', 
 'domain' => 'transferme.com', 
 'replaceip' => 'all', 
 'reseller' => '0', 
 'force' => '0', 
 'ip' => '0', 
 'skiphomedir' => '0', 
 'shared_mysql_server' => '0', 
 'skipres' => '1', 
 'skipacctdb' => '0', 
 'skipbwdata' => '0', 
 'skipaccount' => '0', 
 'xferpoint' => '1'
);
$_result = $xmlapi->xmlapi_query('enqueue_transfer_item' , $settings);

print $_result;

https://hostname.example.com:2087/cpsess##########/json-api/enqueue_transfer_item?api.version=1&user=transferme&transfer_session_id=remoteexamplecomnoroo20140501194105g7qG&module=AccountRemoteUser&localuser=transferme

include_once '../xmlapi.php';

$ip = getenv('REMOTE_HOST');
$root_user = getenv('REMOTE_USER');
$root_pass = getenv('REMOTE_PASSWORD');

$xmlapi = new xmlapi($ip , $root_user , $root_pass);
$xmlapi->set_output('json');

$settings = array(
 'api.version'=>1, 
 'transfer_session_id' => 'remoteexamplecomnoroo20140501194105g7qG', 
 'module'=>'AccountRemoteUser', 
 'user' => 'transferme', 
 'size' => '123456789', 
 'localuser' => 'transferme', 
 'detected_remote_user' => 'transferme', 
 'domain' => 'transferme.com', 
 'replaceip' => 'all', 
 'reseller' => '0', 
 'force' => '0', 
 'ip' => '0', 
 'skiphomedir' => '0', 
 'shared_mysql_server' => '0', 
 'skipres' => '1', 
 'skipacctdb' => '0', 
 'skipbwdata' => '0', 
 'skipaccount' => '0', 
 'xferpoint' => '1'
);
$_result = $xmlapi->xmlapi_query('enqueue_transfer_item' , $settings);

print $_result;

This function only returns the following metadata:

 Click to view...

{
  "metadata": {
    "version": 1,
    "reason": "OK",
    "result": "1",
    "command": "enqueue_transfer_item"
  }
}

For root transfers only, add the transfer of the package1 package to the queue with the following function call:

https://hostname.example.com:2087/cpsess##########/json-api/enqueue_transfer_item?api.version=1&transfer_session_id=remoteexamplecopya20140211211719FxjU&module=PackageRemoteRoot&package=package1

include_once '../xmlapi.php';

$ip = getenv('REMOTE_HOST');
$root_user = getenv('REMOTE_USER');
$root_pass = getenv('REMOTE_PASSWORD');

$xmlapi = new xmlapi($ip , $root_user , $root_pass);
$xmlapi->set_output('json');

$settings = array(
 'api.version' => '1', 
 'transfer_session_id' => "remoteexamplecopya20140211211719FxjU',
 'module' => 'PackageRemoteRoot',
 'package' => 'package1'
);
$_result = $xmlapi->xmlapi_query('enqueue_transfer_item' , $settings);

print $_result;