Application Programming Interface

Get Server Virtual Monitor URL


Description:

This function enables you to get virtual monitor URL of a server. We provide 2 URLs, primary NODE.ID URL and alternative URL for white label virtual monitor. The URL will expire in 5 minutes.

URLs:
  • Sandbox URL: https://node.co.id/api-sandbox/v1/get_server_virtual_monitor_url
  • Real API URL: https://node.co.id/api/v1/get_server_virtual_monitor_url
Request Parameters:
Parameter Required Type Max Length Description
server_id Yes String 50 characters The ID of server you want to get its virtual monitor URL.
monitor_mode No String 20 characters Available options:
  • view_only
  • full_access (default)
view_root_password No String 20 characters Available options:
  • no
  • yes (default)
branding_logo_url No String 100 characters Your website logo URL. It is good for reseller who want to get while label virtual monitor. It will be scaled to 40 pixels height. Please make sure your image size fits in the virtual monitor. If this parameter is not provided, no logo will be displayed. Example: https://mydomain.com/logo.png
home_url No String 100 characters The URL when user click the branding_logo_url. If this parameter is not provided, no link will be displayed. Example: https://mydomain.com/index.php
server_detail_url No String 100 characters The URL when user click "Back to Server Detail". If this parameter is not provided, no link will be displayed. Example: https://mydomain.com/serverdetail/12345
branding_background_color No String 10 characters The HTML hex color code. The color should be dark since text will be white. If this parameter is not provided, we will use our default color. Example: #006600
JSON Response:
    
        
{
    "code"    : "OK",
    "message" : "",
    "data"    : {
        "server_id"    : "12345",
        "virtual_monitor_url" : "https://node.co.id/virtualmonitor/12345/12312kjhsdshhsf878",
        "alternative_virtual_monitor_url" : "https://vm-001.garudabox.com/virtualmonitor/12345/12312kjhsdshhsf878"
    }
}
    
XML Response:
    
        
<?xml version="1.0" encoding="utf-8"?>
<code>OK</code>
<message>The server label has been changed.</message>
<data>
    <server_id>12345</server_id>
    <virtual_monitor_url>https://node.co.id/virtualmonitor/12345/12312kjhsdshhsf878</virtual_monitor_url>
    <alternative_virtual_monitor_url>https://vm-001.garudabox.com/virtualmonitor/12345/12312kjhsdshhsf878</alternative_virtual_monitor_url>
</data>
    
PHP Example:
    
        
<?php
$url      = "https://node.co.id/api-sandbox/v1/get_server_virtual_monitor_url";
//$url    = "https://node.co.id/api/v1/get_server_virtual_monitor_url";
$user_id  = "12312";
$API_key  = "hasdh6ghvhgFDa454565jasdbNBS";
$random   = rand(10000,99999).uniqid().rand(100000,999999);
$checksum = sha1(sha1(sha1($user_id.$API_key.$random)));
$data = array(
    "user_id"                   => $user_id,
    "random"                    => $random,
    "format"                    => "json",
    "checksum"                  => $checksum,
    "server_id"                 => "12345",
    "monitor_mode"              => "full_access",
    "branding_logo_url"         => "https://mydomain.com/logo.png",
    "home_url"                  => "https://mydomain.com/",
    "server_detail_url"         => "https://mydomain.com/serverdetail/12345",
    "branding_background_color" => "#ff0000"
);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
$output = curl_exec($ch);
$curl_error = curl_errno($ch);
curl_close($ch);
if ($curl_error){
    echo "Unable to connect to API Server.";
} else {
    $outputArray = json_decode($output,true);
    if (!$outputArray){
        echo "Invalid JSON Format";
    } else {
        if ($outputArray["code"] == "OK"){
            print_r($outputArray);
            // Do what you want to do here if OK
        } else {
            echo "Error Message: ".$outputArray["message"];
            // Do what you want to do here if not OK
        }
    }
}