/nodeworx/siteworks add problem

I’m trying to create a new siteworx account using the add action. When I call the function with inputs that will deliberately fail (such as a duplicate account) I get a reasonable status (11) and payload (an error message) in the result. If I call the function with inputs that should succeed (such as the same settings after deleting the duplicate account) the function call dies, not raising any exceptions. However, the account does get created.

I’m doing this with PHP. I get the same results with both the XmlRpc and SoapClient methods of calling the API. The example below is with the XmlRpc library. Is there a problem with the data I’m passing in, or something else?

public function testInsertAccount()
{
$input = array(
‘domainname’ => ‘test4567.tpidev3.com’,
‘ipaddress’ => ‘208.69.123.23’,
‘database_server’ => ‘localhost’,
‘billing_day’ => 1,
‘uniqname’ => ‘test4567’,
‘nickname’ => ‘Test account 4567’,
‘email’ => ‘serversupport@thinktpi.com’,
‘password’ => ‘password’,
‘confirm_password’ => ‘password’,
‘language’ => ‘en-us’,
‘theme’ => ‘interworx’,
‘menu_stype’ => ‘small’,
‘OPT_STORAGE’ => 500,
‘OPT_BANDWIDTH’ => 1,
‘OPT_EMAIL_ALIASES’ => 1,
‘OPT_EMAIL_AUTORESPONDERS’ => 1,
‘OPT_EMAIL_BOXES’ => 1,
‘OPT_EMAIL_GROUPS’ => 1,
‘OPT_FTP_ACCOUNTS’ => 1,
‘OPT_MYSQL_DBS’ => 1,
‘OPT_MYSQL_DB_USERS’ => 1,
‘OPT_POINTER_DOMAINS’ => 1,
‘OPT_SLAVE_DOMAINS’ => 1,
‘OPT_SUBDOMAINS’ => 1,
‘OPT_BACKUP’ => 1,
‘OPT_CGI_ACCESS’ => 1,
‘OPT_CRONTAB’ => 1,
‘OPT_DNS_RECORDS’ => 1,
‘OPT_RESOLVE_XFERLOG_DNS’ => 1,
‘OPT_SSL’ => 1,
‘OPT_BURSTABLE’ => 1,
‘OPT_SAVE_XFER_LOGS’ => 1,
‘simplescripts’ => 1
);
$client = new Zend_XmlRpc_Client(‘https://’ . $this->server . ‘:2443/xmlrpc’);
$key = array(‘email’ => ‘email@example.cotm’, ‘password’ => ‘password’);
// the real email and password are for an account that has permission to
// create new siteworx accounts
$params = array(‘apikey’ => $key, ‘ctrl_name’ => ‘nodeworx/siteworx’, ‘action’ => ‘add’, ‘input’ => $input);
$result = $client->call(‘iworx.route’, $params);
return $result;
}

Can anyone help me with this issue?

David

Hi david,

sorry to respond to such an old issue, but I’ve been going through the forums today.

What do you see when you var_dump() the $result value that you get back from the API call? That is probably the best way to figure out what’s wrong.

Non-master FTP accounts can be deleted through the API. It works like ‘edit’, but the only value you pass is the account to delete.