buy
Edit User

Description

Use the Edit User API to edit the User on your server.

The API response user edited.

Parameters

Sample Code


curl --insecure -d "edit_user=1" -d "user_name=curluser" -d "user=curluser" -d "domain=dummy.co" -d "user_passwd=demo##1234" -d "cnf_user_passwd=demo##1234" -d "email=example123@dom.com" -d "plan=default" -u  "username:password" -X POST "https://hostname:2005/index.php?api=json&act=add_user"
<?php
$user = 'username';
$pass = 'password';
 
$url = 'https://'.rawurlencode($user).':'.rawurlencode($pass).'@domain.com:2005/index.php?api=json&act=add_user';  

$post = array('edit_user' => 1, 
              'user' => 'curaaaluser',
              'user_name' => 'curluser',
              'user_passwd' => 'test#@#123',
              'cnf_user_passwd' => 'test#@#123',
              'domain' => 'dummy.com',
              'email' => 'test@exddddample.com',
              'plan' => 'plan_name'
);


// 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);

// 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']);
    echo "</pre>";
}else{
	print_r($res['error']);
}
<?php
include_once('webuzo_sdk_v2.php');
$user = 'user';
$pass = 'password';
$host = 'hostname';

$webuzo = new Webuzo_Admin_SDK($user, $pass, $host);

$username = 'sdk_user';
$domain = "sdkdom.coma";
$user_passwd = "sdk@123";
$email = "example@dom.com";
$plan = "default";
$res = $webuzo->edit_user($username, $domain, $user_passwd, $email, $plan = '', $pData = []);

// Done/Error
if(!empty($res['error'])){
	print_r($res['error']);
}else{
	print_r($res['done']['msg']);
}

?>
    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list