Get Virtualizor

List Recipes

Use List Recipes API to get information about recipes on your server.

HTTP Request

https://hostname:4083/index.php?act=listrecipes&svs=vpsid

Parameters

NameTypeValueDescriptionRequired
vidPOSTIntThe vpsid whose recipes need to be listed. This will be passed as a POST ParameterYes
svsPOSTIntThe vps whose recipes needs to be listed. This will be passed to the URLYes
actGETlistrecipesThe action specified is used to retrieve dataYes

Sample Code

PHP

<?php
    require_once('/usr/local/virtualizor/sdk/enduser.php');

    $key =  '';
    $pass = '';
    $ip = '';
    $admin = new Virtualizor_Enduser_API($ip, $key, $pass);

    $output = $admin->listrecipes();

    print_r(json_encode($output));
?>

Curl

curl -k -X GET -L "https://hostname:4083/index.php?act=listrecipes& 
svs=3577&api=json&apikey=your_api_key& 
apipass=your_api_pass&do=1"

Output

{
    "uid": "321",
    "act": "listrecipes",
    "timezone": 1,
    "timenow": "September 23, 2016, 7:11 am",
    "vpsid": "3008",
    "username": "test@test.com",
    "user_type": "2",
    "preferences": {
        "fname": "test",
        "lname": "test",
        "language": "english",
        "theme": "default",
        "timezone": 1,
        "logo": ""
    },
    "url": "index.php?",
    "rdns": {
        "pdnsid": null
    },
    "support_link": "http://softaculous.com",
    "disable_login_logo": 1,
    "title": "Virtualizor",
    "recipes": {
        "9": {
            "rid": "9",
            "name": "test287",
            "code": "#!/bin/shnntouch /newtest",
            "desc": "Just testing yar",
            "logo": "",
            "status": "1"
        },
        "13": {
            "rid": "13",
            "name": "test",
            "code": "#!/bin/shnecho "Europe/Budapest" > /etc/localtime",
            "desc": "",
            "logo": "",
            "status": "1"
        },
        "16": {
            "rid": "16",
            "name": "test279",
            "code": "#!/bin/shnecho "recepi" > /test.txt",
            "desc": "Just testing yarrn<a>softaculous.com</a>",
            "logo": "https://hostname:4083/sessbpxbng7dzqjuykqr/themes/default/images/loginlogo.gif",
            "status": "1"
        },
        "17": {
            "rid": "17",
            "name": "Recipe01",
            "code": "#!/bin/shnecho `date` >> /root/test1.txtn",
            "desc": "",
            "logo": "",
            "status": "1"
        },
        "18": {
            "rid": "18",
            "name": "WinRecipe1",
            "code": "#!/bin/shnecho date c:test1.txt",
            "desc": "",
            "logo": "",
            "status": "1"
        },
        "19": {
            "rid": "19",
            "name": "test recipe",
            "code": "#!/bin/shnThis is your test recipe",
            "desc": "This is the description for test recipe",
            "logo": "",
            "status": "1"
        }
    },
    "page": {
        "start": 0,
        "len": 50,
        "maxNum": "6"
    },
    "time_taken": "0.100"
}
    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list