Deleting Domain Forwarding Record

Use the Delete Domain Forwarding Record API to delete domain forwarding record for the vps present on your server. The IDs of the records can be obtain from the list domain forwarding API. The API will return a message “Deleted entries successfuly” after the entries have been deleted successfully.

For more information you can refer this Manage VPS Domain Forwarding Guide.

HTTP Request

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

Parameters

NameMethodValueDescriptionRequired
actGEThaproxyThe action specified to carry out operation and return dataYes
idsPOSTIntThe ID of the domain forwarding records. For deleting multiple records pass in the IDs as comma separated valuesYes
actionPOSTtextThe action to be performed should be ‘delvdf’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['ids'] = 5;
    // $post['ids'] = '2,3'; // Comma Separated Values for deleting multiple vdf records
    $post['action'] = 'delvdf';

    $output = $admin->haproxy($post);

    print_r(json_encode($output));

?>

Output

{
    "title": "VPS Domain Forwarding",
    "done": {
        "msg": "Deleted entries successfuly"
    },
    "supported_protocols": [
        "HTTP",
        "HTTPS",
        "TCP"
    ],
    "server_haconfigs": [
        {
            "haproxy_src_ips": "202.168.147.144",
            "haproxy_reservedports": "",
            "haproxy_reservedports_http": "80,443",
            "haproxy_allowedports": ""
        }
    ],
    "vpsips": null,
    "timenow": 1535472146,
    "time_taken": "0.235"
}
Was this helpful to you?