Get Virtualizor

User Unsuspension

A suspended user cannot access the Virtual Private Servers assigned to it. Use the User Unsuspension API to unsuspend the user, by passing the user's ID. The IDs can be obtained by the list users API. The API response will contain "done" as "true" on successful unsuspension of the user.

HTTP Request

https://hostname:4085/index.php?act=users

Parameters

NameMethodValueDescriptionRequired
actGETusersThe action will return done as true and the list of users after the specific user has been unsuspendedYes
unsuspendPOSTIntThe ID of the users to be unsuspended. For unsuspending multiple users, pass in the IDs as comma separated valuesYes

Sample Code

<?php

    require_once('/usr/local/virtualizor/sdk/admin.php');

    $key =  'your_api_key';
    $pass = 'your_api_pass';
    $ip = 'your_server_ip';
    $admin = new Virtualizor_Admin_API($ip, $key, $pass);

    $page = 0;
    $reslen = 0;
    $post = array();
    $post['unsuspend'] = 59;
    $post['unsuspend'] = '60,61'; // for unsuspending multiple users

    $output = $admin->users($page,$reslen,$post);

    print_r(json_encode($output));

?>

Output

{
    "title": "Users",
    "done": true,
    "users": {
        "3": {
            "uid": "3",
            "password": "",
            "email": "jevin@softaculous.com",
            "type": "0",
            "aclid": "0",
            "pid": "0",
            "num_vs": "0",
            "num_users": "0",
            "space": "0",
            "ram": "0",
            "burst": "0",
            "bandwidth": "0",
            "cpu": "0",
            "cores": "0",
            "cpu_percent": "0",
            "num_cores": "0",
            "num_ipv4": "0",
            "num_ipv6": "0",
            "num_ipv6_subnet": "0",
            "allowed_virts": "",
            "network_speed": "0",
            "upload_speed": "0",
            "openvz": "0",
            "xen": "0",
            "xenhvm": "0",
            "kvm": "0",
            "sg": null,
            "mg": null,
            "preferences": "a:2:{s:5:\"fname\";s:0:\"\";s:5:\"lname\";s:0:\"\";}",
            "dnsplid": "0",
            "date_created": "0",
            "service_period": "0",
            "band_suspend": "0",
            "suspended": null,
            "numvps": "2",
            "bw_used": "0.09"
        },
        "4": {
            "uid": "4",
            "password": "",
            "email": "test@test.com",
            "type": "0",
            "aclid": "0",
            "pid": "0",
            "num_vs": "0",
            "num_users": "0",
            "space": "0",
            "ram": "0",
            "burst": "0",
            "bandwidth": "0",
            "cpu": "0",
            "cores": "0",
            "cpu_percent": "0",
            "num_cores": "0",
            "num_ipv4": "0",
            "num_ipv6": "0",
            "num_ipv6_subnet": "0",
            "allowed_virts": "",
            "network_speed": "0",
            "upload_speed": "0",
            "openvz": "0",
            "xen": "0",
            "xenhvm": "0",
            "kvm": "0",
            "sg": "0",
            "mg": "",
            "preferences": "a:2:{s:5:\"fname\";s:4:\"test\";s:5:\"lname\";s:4:\"test\";}",
            "dnsplid": "0",
            "date_created": "0",
            "service_period": "1",
            "band_suspend": "0",
            "suspended": null,
            "numvps": "2",
            "bw_used": "0.01"
        },
        "5": {
            "uid": "5",
            "password": "",
            "email": "user_specified_email",
            "type": "2",
            "aclid": "0",
            "pid": "0",
            "num_vs": "100000",
            "num_users": "100000",
            "space": "100000",
            "ram": "6144",
            "burst": "10000000",
            "bandwidth": "1",
            "cpu": "1024",
            "cores": "8",
            "cpu_percent": "0",
            "num_cores": "0",
            "num_ipv4": "15",
            "num_ipv6": "0",
            "num_ipv6_subnet": "0",
            "allowed_virts": "xcp xcphvm",
            "network_speed": "0",
            "upload_speed": "0",
            "openvz": "0",
            "xen": "0",
            "xenhvm": "0",
            "kvm": "0",
            "sg": "0",
            "mg": "",
            "preferences": "a:2:{s:5:\"fname\";s:0:\"\";s:5:\"lname\";s:0:\"\";}",
            "dnsplid": "1",
            "date_created": "0",
            "service_period": "1",
            "band_suspend": "0",
            "suspended": null,
            "numvps": "2",
            "bw_used": "0.02"
        }
    },
    "timenow": "1480935808",
    "time_taken": "1.007"
}
    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list