Use Profile API to change details of your profile on server.
HTTP Request
https://hostname:4083/index.php?act=profile
Parameters
Name | Type | Value | Description | Required |
---|---|---|---|---|
act | GET | profile | The action specified to carry out the operation | Yes |
fname | POST | fname | The first name of the user | Yes |
lname | POST | lname | The last name of the user | Yes |
savedetails | POST | 1 | IF set then the user details will be saved | Yes |
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['savedetails'] = 1;
$post['fname'] = 'test';
$post['lname'] = 'test';
$output = $admin->profile($post);
print_r(json_encode($output));
?>
Curl
curl -k -X POST -d "savedetails=1&fname=test&lname=compiler"
-L "https://hostname:4083/index.php?act=profile&api=json&
apikey=your_api_key&apipass=your_api_pass&do=1"
Output
{
"uid": "321",
"act": "profile",
"timezone": 1,
"timenow": "September 23, 2016, 5:27 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": "User Profile",
"done": {
"msg": "Your changes have been saved successfully"
},
"time_taken": "0.097"
}