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
Name | Type | Value | Description | Required |
---|---|---|---|---|
act | GET | addusers | The action which will be performed to retrieve data | Yes |
adduser | POST | 1 | If set, then user will be added | Yes |
user_email | POST | user_email | The email id of the user that needs to be added | Yes |
user_password | POST | user_pass | The password of the user that will be required during login | Yes |
pid | POST | pid | This indicates if the user will be added under an existing user | No |
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"
}