Use the Delete Media Group API to delete media group(s) present on the Virtualizor panel. The API response will contain "done" as array of deleted media group IDs.
HTTP Request
https://hostname:4085/index.php?act=mediagroups&delete=MGID
Parameters
Name | Method | Value | Description | Required |
---|---|---|---|---|
act | GET | mediagroups | The action will return the done as the array of deleted media group IDs | Yes |
delete | POST | Comma Separated Values | The media group IDs that needs to be deleted | 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);
$post = array();
$post['delete'] = 1;
$post['delete'] = '1,2'; // for deleting multiple values
$output = $admin->delete_mg($post);
print_r(json_encode($output));
?>
Output
{
"title": "Media Groups",
"done": [
1,
2
],
"mediagroups": null,
"timenow": 1536089821,
"time_taken": "0.289"
}