View Full Version : Creating siteworx accounts automatically by a script
thetoolman
01-04-2007, 12:50 PM
Is it possible to script the creation of a siteworx account based on xml input from an external system (a shopping cart). When someone buys a package, they enter name/email/domain information, which we then need to have automatically trigger the creation of a new siteworx account with that information.
Has anyone done this, and are there command line scripts for account creation that can do this?
EverythingWeb
01-04-2007, 05:42 PM
Interworx has an API which you can use to create accounts.
May be worth looking at?
thetoolman
01-05-2007, 08:50 AM
That sounds like it might work. Is it documented anywhere?
IWorx-Tim
01-05-2007, 06:20 PM
That sounds like it might work. Is it documented anywhere?
PM your email address to me and I'll send you the API doc in PDF.
pascal
01-06-2007, 06:15 PM
We use this API for a while
here is a snapshot of our PHP code
<?
require_once( 'xmlrpc-request.php' );
$hostname ='my.hostname.com';
$access_key = "paste the key from nodeworx here";
$message = array(
'access_key' => $access_key,
'account_info' => array ($ai_pseudo,
$ai_email,
$ai_passwd,
$ai_domaine,
$ai_ip),
'features_list' => array ('LG_OPT_STORAGE' => $LG_OPT_STORAGE,
'LG_OPT_BANDWIDTH' => $LG_OPT_BANDWIDTH,
'LG_OPT_EMAIL_ALIASES' => $LG_OPT_EMAIL_ALIASES,
'LG_OPT_EMAIL_AUTORESPONDERS' => $LG_OPT_EMAIL_AUTORESPONDERS,
'LG_OPT_EMAIL_BOXES' => $LG_OPT_EMAIL_BOXES,
'LG_OPT_EMAIL_GROUPS' => $LG_OPT_EMAIL_GROUPS,
'LG_OPT_FTP_ACCOUNTS' => $LG_OPT_FTP_ACCOUNTS,
'LG_OPT_MYSQL_DBS' => $LG_OPT_MYSQL_DBS,
'LG_OPT_MYSQL_DB_USERS' => $LG_OPT_MYSQL_DB_USERS,
'LG_OPT_POINTER_DOMAINS' => $LG_OPT_POINTER_DOMAINS,
'LG_OPT_SUBDOMAINS' => $LG_OPT_SUBDOMAINS,
'LG_OPT_CGI_ACCESS' => $LG_OPT_CGI_ACCESS,
'LG_OPT_CRONTAB' => $LG_OPT_CRONTAB,
'LG_OPT_RESOLVE_XFERLOG_DNS' => $LG_OPT_RESOLVE_XFERLOG_DNS,
'LG_OPT_SSL' => $LG_OPT_SSL,
'LG_OPT_BURSTABLE' => $LG_OPT_BURSTABLE,
'LG_OPT_SAVE_XFER_LOGS' => $LG_OPT_SAVE_XFER_LOGS)
);
$result = xmlrpc_request( $hostname, '2443', 'https', 'iworx.createaccount', $message, 0 );
if ($result == "SUCCESS" ) {
// email user and do the stuff
}
else
{
// email the error code $result to staff
}
For the variables name, see the PDF
Hope this help
Pascal
pascal
01-06-2007, 06:19 PM
ps
We read all the data from a database, because the data of the session is lost when calling this pgm
We don't show you how, but the idea is simple. Save all the data in a tmp database, then read it here in this program and update ythe statut of the account (created, to create, etc)
Pascal
vBulletin® v3.7.2, Copyright ©2000-2008, Jelsoft Enterprises Ltd.