buy
Create Domain

Description

You can use this Add domain  API to add Parked domain, Subdomain and Addon domain to your Webuzo panel

Parked Domain

Parameters

curl --insecure -d "add=1" -d "domain_type=parked" -d "domain=domain_name" -d "wildcard=0" -d "issue_lecert=1" -u "username:password" -X POST "https://Server Ip or Hostname:2003/index.php?api=json&act=domainadd"
<?php
	$user = 'Username';
	$pass = 'password';
	$host = 'Server IP or Hostname';
	 
	$url = 'https://'.rawurlencode($user).':'.rawurlencode($pass).'@'.$host.':2003/index.php?api=json&act=domainadd'; 

	$post = array('add' => '1',
              'domain_type' => 'parked',
              'domain' => 'Domain.com',
              'wildcard' => 0,
              'issue_lecert' => 1,
	);

	// Set the curl parameters 
	$ch = curl_init(); 
	curl_setopt($ch, CURLOPT_URL, $url);
	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
	curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
	curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5); 
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 

	if(!empty($post)){
		curl_setopt($ch, CURLOPT_POST, 1);
		curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
	}

	// Get response from the server. 
	$resp = curl_exec($ch);
	if(!empty(curl_error($ch))){
		echo curl_error($ch); die();
	}

	// The response will hold a string as per the API response method. 
	$res = json_decode($resp, true);
	// Done ?
	if(!empty($res['done'])){
		echo "<pre>";
		print_r($res['done']['msg']);
		echo "</pre>";
	}else{
		print_r($res['error']);
	}
?>

Output

The Domain was added successfully.

Subdomain

Parameters

curl --insecure -d "add=1" -d "domain_type=subdomain" -d "domain=domain name" -d "wildcard=0" -d "issue_lecert=1" -d "domainpath=public_html/subdomain_name" -d "subdomain=subdomain_name" -u "username:password" -X POST "https://Server Ip or Hostname:2003/index.php?api=json&act=domainadd"
<?php
	$user = 'Username';
	$pass = 'password';
	$host = 'Server IP or Hostname';
	 
	$url = 'https://'.rawurlencode($user).':'.rawurlencode($pass).'@'.$host.':2003/index.php?api=json&act=domainadd'; 

	$post = array('add' => '1',
              'domain_type' => 'subdomain',
              'domain' => 'Domain.com',
              'domainpath' => 'public_html/subdomain_name'
              'wildcard' => 0,
              'issue_lecert' => 1,
'             'subdomain' => 'subdomain',
	);

	// Set the curl parameters 
	$ch = curl_init(); 
	curl_setopt($ch, CURLOPT_URL, $url);
	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
	curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
	curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5); 
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 

	if(!empty($post)){
		curl_setopt($ch, CURLOPT_POST, 1);
		curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
	}

	// Get response from the server. 
	$resp = curl_exec($ch);
	if(!empty(curl_error($ch))){
		echo curl_error($ch); die();
	}

	// The response will hold a string as per the API response method. 
	$res = json_decode($resp, true);
	// Done ?
	if(!empty($res['done'])){
		echo "<pre>";
		print_r($res['done']['msg']);
		echo "</pre>";
	}else{
		print_r($res['error']);
	}
?>

Output

The Domain was added successfully.

Addon Domain

Parameters

curl --insecure -d "add=1" -d "domain_type=addon" -d "domain=domain name" -d "wildcard=0" -d "issue_lecert=1" -d "domainpath=public_html/addon_domain_name" -u "username:password" -X POST "https://Server Ip or Hostname:2003/index.php?api=json&act=domainadd"
<?php
	$user = 'Username';
	$pass = 'password';
	$host = 'Server IP or Hostname';
	 
	$url = 'https://'.rawurlencode($user).':'.rawurlencode($pass).'@'.$host.':2003/index.php?api=json&act=domainadd'; 

	$post = array('add' => '1',
              'domain_type' => 'addon',
              'domain' => 'Domain.com',
              'domainpath' => 'public_html/addon_name'
              'wildcard' => 0,
              'issue_lecert' => 1,
	);

	// Set the curl parameters 
	$ch = curl_init(); 
	curl_setopt($ch, CURLOPT_URL, $url);
	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
	curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
	curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5); 
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 

	if(!empty($post)){
		curl_setopt($ch, CURLOPT_POST, 1);
		curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
	}

	// Get response from the server. 
	$resp = curl_exec($ch);
	if(!empty(curl_error($ch))){
		echo curl_error($ch); die();
	}

	// The response will hold a string as per the API response method. 
	$res = json_decode($resp, true);
	// Done ?
	if(!empty($res['done'])){
		echo "<pre>";
		print_r($res['done']['msg']);
		echo "</pre>";
	}else{
		print_r($res['error']);
	}
?>

Output

The Domain was added successfully.
    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list