Profile

Use Profile API to change details of your profile on server.

HTTP Request

https://hostname:4083/index.php?act=profile

Parameters

NameTypeValueDescriptionRequired
actGETprofileThe action specified to carry out the operationYes
fnamePOSTfnameThe first name of the userYes
lnamePOSTlnameThe last name of the userYes
savedetailsPOST1IF set then the user details will be savedYes

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"
}
Was this helpful to you?