Use the Unlock VPS API to unlock VPS present on your server by passing the VPS ID to the API. The API response contains "done" as "true" on successful unlocking of the VPS (Since 3.0.8+).
HTTP Request
https://hostname:4085/index.php?act=vs&action=unlock&vpsid=VPSID
Parameters
Name | Method | Value | Description | Required |
---|---|---|---|---|
act | GET | vs | The action specified to retrieve data after vps is unlocked | Yes |
vpsid | GET | Int | The ID of the vps which needs to be unlocked. | Yes |
action | GET | text | The value of the action should be "unlock" for unlocking the VPS | Yes |
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);
$vid = 3582;
$output = $admin->unlock($vid);
print_r(json_encode($output));
?>
Output
{
"title": "Virtual Servers",
"done": true,
"done_msg": "VPS Unlocked",
"vsop": {
"action": "unlock",
"id": 3582,
"serid": "0",
"status": {
"3582": 1
}
},
"timenow": 1535125750,
"time_taken": "4.432"
}