Get Virtualizor

Add User

Use Add User API to add new user on your server.

This function is for cloud user

HTTP Request

https://hostname:4083/index.phpact=addusers

Parameters

NameTypeValueDescriptionRequired
actGETaddusersThe action which will be performed to retrieve dataYes
adduserPOST1If set, then user will be addedYes
user_emailPOSTuser_emailThe email id of the user that needs to be addedYes
user_passwordPOSTuser_passThe password of the user that will be required during loginYes
pidPOSTpidThis indicates if the user will be added under an existing userNo

Sample Code

PHP

<?php
    require_once('/usr/local/virtualizor/sdk/enduser.php');

    $key =  '';
    $pass = '';
    $ip = '';
    $admin = new Virtualizor_Enduser_API($ip, $key, $pass);
    $post = array();
    $post['adduser'] = 1;
    $post['user_email'] = 'test@est.com';
    $post['user_password'] = 'xxxxx';
    $post['pid'] = 299;
    $output = $admin->adduser($post);
    print_r(json_encode($output));
?>

Curl

curl -k -X POST -d "adduser=1& 
user_email=test425@softa.com&user_password=test012" 
-L "http://hostname:4082/index.php?act=adduser&api=json& 
apikey=your_api_key&apipass=your_api_pass&do=1"

Output

{
    "uid": "321",
    "act": "adduser",
    "timezone": 1,
    "timenow": "September 23, 2016, 5:02 am",
    "vpsid": "3008",
    "username": "test@test.com",
    "user_type": "2",
    "preferences": {
        "fname": "test",
        "lname": "test",
        "theme": "default",
        "language": "english",
        "timezone": 1
    },
    "url": "index.php?",
    "rdns": {
        "pdnsid": null
    },
    "support_link": "http://softaculous.com",
    "disable_login_logo": 1,
    "title": "Add User",
    "done": {
        "msg": "User has been added",
        "goto": "act=users"
    },
    "time_taken": "0.090"
}
    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list