5 JScript/JSON Interface

_images/json.png

SquidNet provides a Jscipt/JSON interface that can be used to manage studio accounts from an external site. All requests are applied against the main Renderfarm studio account.

Hint

The sample code fragments below can he downloaded here.

5.1 Setup

The Jscript/JSON commands are routed through SquidNet’s web interface. There are 2 interface options available:

Make sure these ports are open on your firewall before attempting to use. You can check your ports WAN status using this port tester.

Caution

If using the Jscript/JSON Interface outside your local network, make sure to use the more secure HTTP-SSL portal (https://domain-name>:17389)

5.2 General Requests

The following table shows available JSON commands:

JSON Request Types
JSON Message Type Description Sample
STUDIO_ACCOUNT_CREATE Create new studio account Code example
STUDIO_ACCOUNT_UPDATE Update studio account Code example
STUDIO_ACCOUNT_GET Get studio account Code example
STUDIO_ACCOUNT_REMOVE Remove studio account Code example
LEASE_CREATE Create new studio lease Code example
LEASE_UPDATE Updatge studio lease Code example
LEASE_GET Get studio lease Code example
LEASE_REMOVE Remove studio lease Code example
RENDER_ACCOUNT_CREATE Create user account for specified studio Code example
RENDER_ACCOUNT_UPDATE Update user account for specified studio Code example
RENDER_ACCOUNT_GET Get user account for specified studio Code example
RENDER_ACCOUNT_REMOVE Remove user account from specified studio Code example
JOB_QUEUE_GET Retreive job queue information Code example
JOB_CREATE Enqueue new job Code example
JOB_CANCEL Cancel job Code example
POOL_LIST_GET Get pool information Code example
APP_PROFILE_GET Get application profile information Code example
SQL_SELECT Execute SQL query and return specified fields Code example
SQL_UPDATE Update SQL database record Code example
HISTORY_GET Using QID, retrieve job from history database Code example
HISTORY_SEARCH Search history database and return QID list Code example

5.2.1 Get Application Profile List

Retrieve a list of all configured application profiles:

<!DOCTYPE html>
<html>
<body>

<script>


    var xmlhttp;
    var value = JSON.stringify(
                            { "Request":"APP_PROFILE_GET","Properties":
                                {
                                    "AppName":"all"
                                }
                            });

    if (window.XMLHttpRequest)
        xmlhttp=new XMLHttpRequest();
    else
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

    var url = "https://squidnet.dyndns.org:17389/?username=Administrator&password=******&requestType=JsonAdminRequest&t=" + Math.random();

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 )
        {
            if ( xmlhttp.status == 200 )
                document.getElementById("div1").innerHTML = xmlhttp.responseText;
            else
                document.getElementById("div1").innerHTML = "HTTP Error: " + xmlhttp.status;
        }
    }

    xmlhttp.open("POST", url, true);
    xmlhttp.setRequestHeader('Accept', 'application/json');
    xmlhttp.setRequestHeader('Content-Length', value.length);
    xmlhttp.send( value );

</script>

<div id="div1">SQN SERVER RESPONSE</div>

</body>
</html>

5.3 Job Management Requests

5.3.1 Job Details

Get details on a specific job:

<!DOCTYPE html>
<html>
<body>

<script>


    var xmlhttp;
    var value = JSON.stringify(
        {
            "Request":"JOB_QUEUE_GET",
            "Properties":{
                "JobId":"SQN-4025409"
                }});

    if (window.XMLHttpRequest)
        xmlhttp=new XMLHttpRequest();
    else
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

    var url = "https://squidnet.dyndns.org:17389/?username=Administrator&password=******&requestType=JsonAdminRequest&t=" + Math.random();

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 )
        {
            if ( xmlhttp.status == 200 )
                document.getElementById("div1").innerHTML = xmlhttp.responseText;
            else
                document.getElementById("div1").innerHTML = "HTTP Error: " + xmlhttp.status;
        }
    }

    xmlhttp.open("POST", url, true);
    xmlhttp.setRequestHeader('Accept', 'application/json');
    xmlhttp.setRequestHeader('Content-Length', value.length);
    xmlhttp.send( value );

</script>

<div id="div1">SQN SERVER RESPONSE</div>

</body>
</html>

5.3.2 Job Cancel

Cancel a specific job:

<!DOCTYPE html>
<html>
<body>

<script>


    var xmlhttp;
    var value = JSON.stringify({"Request":"JOB_CANCEL","Properties":
                                {"JobId":"SQN-4025406"}
                               });

    if (window.XMLHttpRequest)
        xmlhttp=new XMLHttpRequest();
    else
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

    var url = "https://squidnet.dyndns.org:17389/?username=Administrator&password=******&requestType=JsonAdminRequest&t=" + Math.random();

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 )
        {
            if ( xmlhttp.status == 200 )
                document.getElementById("div1").innerHTML = xmlhttp.responseText;
            else
                document.getElementById("div1").innerHTML = "HTTP Error: " + xmlhttp.status;
        }
    }

    xmlhttp.open("POST", url, true);
    xmlhttp.setRequestHeader('Accept', 'application/json');
    xmlhttp.setRequestHeader('Content-Length', value.length);
    xmlhttp.send( value );

</script>

<div id="div1">SQN SERVER RESPONSE</div>

</body>
</html>

5.3.3 Job Queue Listing

Get a list of all queued jobs:

<!DOCTYPE html>
<html>
<body>

<script>


    var xmlhttp;
    var value = JSON.stringify({"Request":"JOB_QUEUE_GET","Properties":{"JobId":"all"}});

    if (window.XMLHttpRequest)
        xmlhttp=new XMLHttpRequest();
    else
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

    var url = "https://squidnet.dyndns.org:17389/?username=Administrator&password=******&requestType=JsonAdminRequest&t=" + Math.random();

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 )
        {
            if ( xmlhttp.status == 200 )
                document.getElementById("div1").innerHTML = xmlhttp.responseText;
            else
                document.getElementById("div1").innerHTML = "HTTP Error: " + xmlhttp.status;
        }
    }

    xmlhttp.open("POST", url, true);
    xmlhttp.setRequestHeader('Accept', 'application/json');
    xmlhttp.setRequestHeader('Content-Length', value.length);
    xmlhttp.send( value );

</script>

<div id="div1">SQN SERVER RESPONSE</div>

</body>
</html>

5.3.4 3dsmax Job Submission

Submit a 3dsmax job from inside the local network:

<!DOCTYPE html>
<html>
<body>

<script>


    var xmlhttp;
    var value = JSON.stringify({"Request":"JOB_CREATE","Properties":{
                                    "StudioName": "RenderFarm",
                                    "LeaseName": "RENDERFARM LEASE",
                                    "UserName": "Administrator",
                                    "templateId": "3dsmax",
                                    "JobId": "SQN-4025409",
                                    "UserProjectFolder": "W:/SquidNet/web-jobs/AdvancedLighting2",
                                    "ApplicationProfile": "3DSMAX-64BIT",
                                    "JobDescription": "",
                                    "scenefile": "radiosity.max",
                                    "renderqueue": "PREMIUM",
                                    "pool": "NETWORK",
                                    "framelist": "",
                                    "startframe": "1",
                                    "endframe": "25",
                                    "StepFrame": "1",
                                    "extraOptions": "",

                                    "imagePrefix": "test-",
                                    "imageFormat": "PNG Image File"
                                }});

    if (window.XMLHttpRequest)
        xmlhttp=new XMLHttpRequest();
    else
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

    var url = "https://squidnet.dyndns.org:17389/?username=Administrator&password=******&requestType=JsonAdminRequest&t=" + Math.random();

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 )
        {
            if ( xmlhttp.status == 200 )
                document.getElementById("div1").innerHTML = xmlhttp.responseText;
            else
                document.getElementById("div1").innerHTML = "HTTP Error: " + xmlhttp.status;
        }
    }

    xmlhttp.open("POST", url, true);
    xmlhttp.setRequestHeader('Accept', 'application/json');
    xmlhttp.setRequestHeader('Content-Length', value.length);
    xmlhttp.send( value );

</script>

<div id="div1">SQN SERVER RESPONSE</div>

</body>
</html>

5.3.5 After Effects Job Submission

Submit an After Effects job from inside the local network:

<!DOCTYPE html>
<html>
<body>

<script>


    var xmlhttp;
    var value = JSON.stringify({"Request":"JOB_CREATE","Properties":{
                                    "StudioName": "RenderFarm",
                                    "LeaseName": "RENDERFARM LEASE",
                                    "UserName": "Administrator",
                                    "templateId": "AfterEffects",
                                    "JobId": "SQN-4025409",
                                    "UserProjectFolder": "W:/SquidNet/web-jobs/ae-fire",
                                    "ApplicationProfile": "AFTER-EFFECTS",
                                    "JobDescription": "",
                                    "scenefile": "fire.aepx",
                                    "renderqueue": "PRIORITY 08",
                                    "pool": "NETWORK",
                                    "framelist": "",
                                    "startframe": "1",
                                    "endframe": "400",
                                    "StepFrame": "1",
                                    "extraOptions": "",

                                    "outputFilename": "fire[####].jpg",
                                    "compName": "BG FIRE Komp",
                                    "renderQueueIndex": "1"
                                }});

    if (window.XMLHttpRequest)
        xmlhttp=new XMLHttpRequest();
    else
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

    var url = "https://squidnet.dyndns.org:17389/?username=Administrator&password=******&requestType=JsonAdminRequest&t=" + Math.random();

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 )
        {
            if ( xmlhttp.status == 200 )
                document.getElementById("div1").innerHTML = xmlhttp.responseText;
            else
                document.getElementById("div1").innerHTML = "HTTP Error: " + xmlhttp.status;
        }
    }

    xmlhttp.open("POST", url, true);
    xmlhttp.setRequestHeader('Accept', 'application/json');
    xmlhttp.setRequestHeader('Content-Length', value.length);
    xmlhttp.send( value );

</script>

<div id="div1">SQN SERVER RESPONSE</div>

</body>
</html>

5.3.6 Blender Job Submission

Submit an Blender job from inside the local network:

<!DOCTYPE html>
<html>
<body>

<script>


    var xmlhttp;
    var value = JSON.stringify({"Request":"JOB_CREATE","Properties":{
                                    "StudioName": "RenderFarm",
                                    "LeaseName": "RENDERFARM LEASE",
                                    "UserName": "Administrator",
                                    "templateId": "Blender",
                                    "JobId": "SQN-4025406",
                                    "UserProjectFolder": "W:/SquidNet/web-jobs/dolphin",
                                    "ApplicationProfile": "BLENDER_272A",
                                    "JobDescription": "",
                                    "scenefile": "dolphin.blend",
                                    "renderqueue": "PREMIUM",
                                    "pool": "NETWORK",
                                    "framelist": "",
                                    "startframe": "1",
                                    "endframe": "25",
                                    "StepFrame": "1",
                                    "extraOptions": "",

                                    "renderEngine": "BLENDER_RENDER",
                                    "imagePrefix": "dolphin",
                                    "imageFormat": "JPEG"
                                }});

    if (window.XMLHttpRequest)
        xmlhttp=new XMLHttpRequest();
    else
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

    var url = "https://squidnet.dyndns.org:17389/?username=Administrator&password=******&requestType=JsonAdminRequest&t=" + Math.random();

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 )
        {
            if ( xmlhttp.status == 200 )
                document.getElementById("div1").innerHTML = xmlhttp.responseText;
            else
                document.getElementById("div1").innerHTML = "HTTP Error: " + xmlhttp.status;
        }
    }

    xmlhttp.open("POST", url, true);
    xmlhttp.setRequestHeader('Accept', 'application/json');
    xmlhttp.setRequestHeader('Content-Length', value.length);
    xmlhttp.send( value );

</script>

<div id="div1">SQN SERVER RESPONSE</div>

</body>
</html>

5.3.7 Cinema4D Job Submission

Submit an Cinema4D job from inside the local network:

<!DOCTYPE html>
<html>
<body>

<script>


    var xmlhttp;
    var value = JSON.stringify({"Request":"JOB_CREATE","Properties":{
                                "StudioName": "RenderFarm",
                                "LeaseName": "RENDERFARM LEASE",
                                "UserName": "Administrator",
                                "templateId": "Cinema4D",
                                "JobId": "SQN-4025406",
                                "UserProjectFolder": "W:/SquidNet/RenderFarmServices/RenderStorm/renderstormscenes/renderstormscenes/cinema4d with vray/VRAYHOUSE-long render times",
                                "ApplicationProfile": "C4D-FAKE",
                                "JobDescription": "",
                                "scenefile": "VRAYHOUSE.c4d",
                                "renderqueue": "PREMIUM",
                                "pool": "NETWORK",
                                "framelist": "",
                                "startframe": "1",
                                "endframe": "25",
                                "StepFrame": "1",
                                "extraOptions": "",

                                "multiPass": "true",
                                "imagePrefix": "c4d-test",
                                "imageFormat": "png"
                                }});

    if (window.XMLHttpRequest)
        xmlhttp=new XMLHttpRequest();
    else
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

    var url = "https://squidnet.dyndns.org:17389/?username=Administrator&password=******&requestType=JsonAdminRequest&t=" + Math.random();

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 )
        {
            if ( xmlhttp.status == 200 )
                document.getElementById("div1").innerHTML = xmlhttp.responseText;
            else
                document.getElementById("div1").innerHTML = "HTTP Error: " + xmlhttp.status;
        }
    }

    xmlhttp.open("POST", url, true);
    xmlhttp.setRequestHeader('Accept', 'application/json');
    xmlhttp.setRequestHeader('Content-Length', value.length);
    xmlhttp.send( value );

</script>

<div id="div1">SQN SERVER RESPONSE</div>

</body>
</html>

5.3.8 Maya Submission

Submit an Maya job from inside the local network:

<!DOCTYPE html>
<html>
<body>

<script>


    var xmlhttp;
    var value = JSON.stringify({"Request":"JOB_CREATE","Properties":{
                                    "StudioName": "RenderFarm",
                                    "LeaseName": "RENDERFARM LEASE",
                                    "UserName": "Administrator",
                                    "templateId": "Maya",
                                    "JobId": "SQN-4025409",
                                    "UserProjectFolder": "W:/SquidNet/web-jobs/maya_ponce",
                                    "ApplicationProfile": "Maya",
                                    "JobDescription": "",
                                    "scenefile": "BFVS1403DAnimation_bakedSimulation_03.ma",
                                    "renderqueue": "PRIORITY 08",
                                    "pool": "NETWORK",
                                    "framelist": "",
                                    "startframe": "1",
                                    "endframe": "25",
                                    "StepFrame": "1",
                                    "extraOptions": "",

                                    "filenameFormat": "name#.ext",
                                    "renderEngine": "MentalRay",
                                    "imagePrefix": "test-",
                                    "imageFormat": "png"
                                }});

    if (window.XMLHttpRequest)
        xmlhttp=new XMLHttpRequest();
    else
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

    var url = "https://squidnet.dyndns.org:17389/?username=Administrator&password=******&requestType=JsonAdminRequest&t=" + Math.random();

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 )
        {
            if ( xmlhttp.status == 200 )
                document.getElementById("div1").innerHTML = xmlhttp.responseText;
            else
                document.getElementById("div1").innerHTML = "HTTP Error: " + xmlhttp.status;
        }
    }

    xmlhttp.open("POST", url, true);
    xmlhttp.setRequestHeader('Accept', 'application/json');
    xmlhttp.setRequestHeader('Content-Length', value.length);
    xmlhttp.send( value );

</script>

<div id="div1">SQN SERVER RESPONSE</div>

</body>
</html>

5.4 Studio Lease Management Requests

Specific options for “Flags” property:

  • waterMarkEnable: Enable watermarking of rendered images
  • waterMarkDisable: Disable watermarking of rendered images
  • waterMarkArchiveEnable: Enable watermarking of archived images
  • waterMarkArchiveDisable: Disable watermarking of archived images

5.4.1 OnDemand Lease Creation

Create a new OnDemand lease:

<!DOCTYPE html>
<html>
<body>

<script>


    var xmlhttp;
    var value = JSON.stringify({
        "Request":"LEASE_CREATE",
        "Properties":
        {
            "StudioName":"ABC Studios",
            "Title":"BASE LEASE",
            "Type":"OnDemand",
            "RenderPool":"TEST",
            "Flags":"waterMarkEnable",
            "Status":true,
            "RenderCredits":170,
            "maxFramesPerJob": 3,
            "MaxOnDemandQueuedJobs": 7,
            "OnDemandRenderQueues": "STANDARD",
            "CurrentRenderCredits":0
        }});

    if (window.XMLHttpRequest)
        xmlhttp=new XMLHttpRequest();
    else
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

    var url = "https://squidnet.dyndns.org:17389/?username=Administrator&password=******&requestType=JsonAdminRequest&t=" + Math.random();

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 )
        {
            if ( xmlhttp.status == 200 )
                document.getElementById("div1").innerHTML = xmlhttp.responseText;
            else
                document.getElementById("div1").innerHTML = "HTTP Error: " + xmlhttp.status;
        }
    }

    xmlhttp.open("POST", url, true);
    xmlhttp.setRequestHeader('Accept', 'application/json');
    xmlhttp.setRequestHeader('Content-Length', value.length);
    xmlhttp.send( value );

</script>

<div id="div1">SQN SERVER RESPONSE</div>

</body>
</html>

5.4.2 Reserved Lease Creation

Create a new Reserved lease:

<!DOCTYPE html>
<html>
<body>

<script>


    var xmlhttp;
    var value = JSON.stringify({
        "Request":"LEASE_CREATE",
        "Properties":
        {
            "StudioName": "ABC Studios",
            "Title": "RESERVED LEASE",
            "Type": "Reserved",
            "RenderPool": "NETWORK",
            "Status": true,
            "RenderCredits": 1000000,
            "CurrentRenderCredits": 20000,
            "ReserveSchedule": " 12/10/2015, 12/20/2015, 10/11/2015, 10/13/2015-10/15/2015, 10/31/2015, 11/01/2015, 11/12/2015-11/13/2015",
            "NumReservedNodes": 9
        }});

    if (window.XMLHttpRequest)
        xmlhttp=new XMLHttpRequest();
    else
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

    var url = "https://squidnet.dyndns.org:17389/?username=Administrator&password=******&requestType=JsonAdminRequest&t=" + Math.random();

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 )
        {
            if ( xmlhttp.status == 200 )
                document.getElementById("div1").innerHTML = xmlhttp.responseText;
            else
                document.getElementById("div1").innerHTML = "HTTP Error: " + xmlhttp.status;
        }
    }

    xmlhttp.open("POST", url, true);
    xmlhttp.setRequestHeader('Accept', 'application/json');
    xmlhttp.setRequestHeader('Content-Length', value.length);
    xmlhttp.send( value );

</script>

<div id="div1">SQN SERVER RESPONSE</div>

</body>
</html>

5.4.3 Add Render Credits to Lease

Add some credits to an existing lease:

<!DOCTYPE html>
<html>
<body>

<script>


    var xmlhttp;
    var value = JSON.stringify({"Request":"LEASE_UPDATE","Properties":{
                                    "StudioName":"ABC Studios",
                                    "Title": "BASE LEASE",
                                    "AdjRenderCredits":"1000",
                                    "AdjDescription":"Adding more credits",
                                    "AdjOperation":"add"
                                    }});

    if (window.XMLHttpRequest)
        xmlhttp=new XMLHttpRequest();
    else
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

    var url = "https://squidnet.dyndns.org:17389/?username=Administrator&password=******&requestType=JsonAdminRequest&t=" + Math.random();

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 )
        {
            if ( xmlhttp.status == 200 )
                document.getElementById("div1").innerHTML = xmlhttp.responseText;
            else
                document.getElementById("div1").innerHTML = "HTTP Error: " + xmlhttp.status;
        }
    }

    xmlhttp.open("POST", url, true);
    xmlhttp.setRequestHeader('Accept', 'application/json');
    xmlhttp.setRequestHeader('Content-Length', value.length);
    xmlhttp.send( value );

</script>

<div id="div1">SQN SERVER RESPONSE</div>

</body>
</html>

5.4.4 Subtract Render Credits from Lease

Subtract some credits from an existing lease:

<!DOCTYPE html>
<html>
<body>

<script>


    var xmlhttp;
    var value = JSON.stringify({"Request":"LEASE_UPDATE","Properties":{
                                    "StudioName":"ABC Studios",
                                    "Title": "BASE LEASE",
                                    "AdjRenderCredits":"500",
                                    "AdjDescription":"Remove more credits",
                                    "AdjOperation":"subtract"
                                    }});

    if (window.XMLHttpRequest)
        xmlhttp=new XMLHttpRequest();
    else
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

    var url = "https://squidnet.dyndns.org:17389/?username=Administrator&password=******&requestType=JsonAdminRequest&t=" + Math.random();

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 )
        {
            if ( xmlhttp.status == 200 )
                document.getElementById("div1").innerHTML = xmlhttp.responseText;
            else
                document.getElementById("div1").innerHTML = "HTTP Error: " + xmlhttp.status;
        }
    }

    xmlhttp.open("POST", url, true);
    xmlhttp.setRequestHeader('Accept', 'application/json');
    xmlhttp.setRequestHeader('Content-Length', value.length);
    xmlhttp.send( value );

</script>

<div id="div1">SQN SERVER RESPONSE</div>

</body>
</html>

5.4.5 Get Lease Details

Get lease details:

<!DOCTYPE html>
<html>
<body>

<script>


    var xmlhttp;
    var value = JSON.stringify({"Request":"LEASE_GET","Properties":{"StudioName":"ABC Studios","Title":"BASE LEASE"}});

    if (window.XMLHttpRequest)
        xmlhttp=new XMLHttpRequest();
    else
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

    var url = "https://squidnet.dyndns.org:17389/?username=Administrator&password=******&requestType=JsonAdminRequest&t=" + Math.random();

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 )
        {
            if ( xmlhttp.status == 200 )
                document.getElementById("div1").innerHTML = xmlhttp.responseText;
            else
                document.getElementById("div1").innerHTML = "HTTP Error: " + xmlhttp.status;
        }
    }

    xmlhttp.open("POST", url, true);
    xmlhttp.setRequestHeader('Accept', 'application/json');
    xmlhttp.setRequestHeader('Content-Length', value.length);
    xmlhttp.send( value );

</script>

<div id="div1">SQN SERVER RESPONSE</div>

</body>
</html>

5.4.6 Get All Studio Leases

Get all leases from specified studio account:

<!DOCTYPE html>
<html>
<body>

<script>


    var xmlhttp;
    var value = JSON.stringify({"Request":"LEASE_GET","Properties":{"StudioName":"ABC Studios","Title":"All"}});

    if (window.XMLHttpRequest)
        xmlhttp=new XMLHttpRequest();
    else
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

    var url = "https://squidnet.dyndns.org:17389/?username=Administrator&password=******&requestType=JsonAdminRequest&t=" + Math.random();

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 )
        {
            if ( xmlhttp.status == 200 )
                document.getElementById("div1").innerHTML = xmlhttp.responseText;
            else
                document.getElementById("div1").innerHTML = "HTTP Error: " + xmlhttp.status;
        }
    }

    xmlhttp.open("POST", url, true);
    xmlhttp.setRequestHeader('Accept', 'application/json');
    xmlhttp.setRequestHeader('Content-Length', value.length);
    xmlhttp.send( value );

</script>

<div id="div1">SQN SERVER RESPONSE</div>

</body>
</html>

5.4.7 Get All Leases

Get all leases from all accounts:

<!DOCTYPE html>
<html>
<body>

<script>


    var xmlhttp;
    var value = JSON.stringify({"Request":"LEASE_GET","Properties":{"StudioName":"All"}});

    if (window.XMLHttpRequest)
        xmlhttp=new XMLHttpRequest();
    else
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

    var url = "https://squidnet.dyndns.org:17389/?username=Administrator&password=******&requestType=JsonAdminRequest&t=" + Math.random();

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 )
        {
            if ( xmlhttp.status == 200 )
                document.getElementById("div1").innerHTML = xmlhttp.responseText;
            else
                document.getElementById("div1").innerHTML = "HTTP Error: " + xmlhttp.status;
        }
    }

    xmlhttp.open("POST", url, true);
    xmlhttp.setRequestHeader('Accept', 'application/json');
    xmlhttp.setRequestHeader('Content-Length', value.length);
    xmlhttp.send( value );

</script>

<div id="div1">SQN SERVER RESPONSE</div>

</body>
</html>

5.4.8 Update Reserved Lease

Update specified Reserved lease:

<!DOCTYPE html>
<html>
<body>

<script>


    var xmlhttp;
    var value = JSON.stringify({
        "Request":"LEASE_UPDATE",
        "Properties":
        {
            "StudioName": "ABC Studios",
            "Title": "RESERVED LEASE",
            "Type": "Reserved",
            "RenderPool": "NETWORK",
            "Status": true,
            "RenderCredits": 1000000,
            "CurrentRenderCredits": 20000,
            "ReserveSchedule": "11/12/2015-11/13/2015, 12/13/2015, 04/02/2016-04/13/2016",
            "NumReservedNodes": 12
        }});

    if (window.XMLHttpRequest)
        xmlhttp=new XMLHttpRequest();
    else
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

    var url = "https://squidnet.dyndns.org:17389/?username=Administrator&password=******&requestType=JsonAdminRequest&t=" + Math.random();

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 )
        {
            if ( xmlhttp.status == 200 )
                document.getElementById("div1").innerHTML = xmlhttp.responseText;
            else
                document.getElementById("div1").innerHTML = "HTTP Error: " + xmlhttp.status;
        }
    }

    xmlhttp.open("POST", url, true);
    xmlhttp.setRequestHeader('Accept', 'application/json');
    xmlhttp.setRequestHeader('Content-Length', value.length);
    xmlhttp.send( value );

</script>

<div id="div1">SQN SERVER RESPONSE</div>

</body>
</html>

5.4.9 Update OnDemand Lease

Update specified OnDemand lease:

<!DOCTYPE html>
<html>
<body>

<script>


    var xmlhttp;
    var value = JSON.stringify({
        "Request":"LEASE_UPDATE",
        "Properties":
        {
            "StudioName":"ABC Studios",
            "Title":"BASE LEASE",
            "Type":"OnDemand",
            "RenderPool":"NETWORK",
            "Flags":"waterMarkEnable",
            "Status":true,
            "RenderCredits":10000,
            "maxFramesPerJob": 10,
            "OnDemandRenderQueues": "STANDARD",
            "CurrentRenderCredits": 23000
        }});

    if (window.XMLHttpRequest)
        xmlhttp=new XMLHttpRequest();
    else
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

    var url = "https://squidnet.dyndns.org:17389/?username=Administrator&password=******&requestType=JsonAdminRequest&t=" + Math.random();

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 )
        {
            if ( xmlhttp.status == 200 )
                document.getElementById("div1").innerHTML = xmlhttp.responseText;
            else
                document.getElementById("div1").innerHTML = "HTTP Error: " + xmlhttp.status;
        }
    }

    xmlhttp.open("POST", url, true);
    xmlhttp.setRequestHeader('Accept', 'application/json');
    xmlhttp.setRequestHeader('Content-Length', value.length);
    xmlhttp.send( value );

</script>

<div id="div1">SQN SERVER RESPONSE</div>

</body>
</html>

5.4.10 Remove Lease

Remove specified lease:

<!DOCTYPE html>
<html>
<body>

<script>


    var xmlhttp;
    var value = JSON.stringify({"Request":"LEASE_REMOVE","Properties":{"StudioName":"ABC Studios","Title":"BASE LEASE"}});

    if (window.XMLHttpRequest)
        xmlhttp=new XMLHttpRequest();
    else
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

    var url = "https://squidnet.dyndns.org:17389/?username=Administrator&password=********&requestType=JsonAdminRequest&t=" + Math.random();

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 )
        {
            if ( xmlhttp.status == 200 )
                document.getElementById("div1").innerHTML = xmlhttp.responseText;
            else
                document.getElementById("div1").innerHTML = "HTTP Error: " + xmlhttp.status;
        }
    }

    xmlhttp.open("POST", url, true);
    xmlhttp.setRequestHeader('Accept', 'application/json');
    xmlhttp.setRequestHeader('Content-Length', value.length);
    xmlhttp.send( value );

</script>

<div id="div1">SQN SERVER RESPONSE</div>

</body>
</html>

5.5 Render Account Management

5.5.1 Create Render Account

Create studio render account:

<!DOCTYPE html>
<html>
<body>

<script>
    var xmlhttp;
    var value = JSON.stringify({"Request":"RENDER_ACCOUNT_CREATE",
                "Properties":{  "StudioName":"ABC Studios",
                                "FullName": "Barney Rubble",
                                "UserName": "brubble",
                                "Email": "brubble@abcstudions.com",
                                "Status": true,
                                "IsAdmin": true,
                                "Md5Password": "123412341234123412341234123412341234",
                                "AssignedLease": "TEST_LEASE",
                                "MaxJobSubmit": 100
                                }});

    if (window.XMLHttpRequest)
        xmlhttp=new XMLHttpRequest();
    else
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

    var url = "https://squidnet.dyndns.org:17389/?username=Administrator&password=******&requestType=JsonAdminRequest&t=" + Math.random();

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 )
        {
            if ( xmlhttp.status == 200 )
                document.getElementById("div1").innerHTML = xmlhttp.responseText;
            else
                document.getElementById("div1").innerHTML = "HTTP Error: " + xmlhttp.status;
        }
    }

    xmlhttp.open("POST", url, true);
    xmlhttp.setRequestHeader('Accept', 'application/json');
    xmlhttp.setRequestHeader('Content-Length', value.length);
    xmlhttp.send( value );

</script>

<div id="div1">SQN SERVER RESPONSE</div>

</body>
</html>

5.5.2 Get Render Account

Retrieve studio render account:

<!DOCTYPE html>
<html>
<body>

<script>


    var xmlhttp;
    var value = JSON.stringify({"Request":"RENDER_ACCOUNT_GET",
                "Properties":{  "StudioName":"ABC Studios",
                                "UserName": "brubble"
                                }});

    if (window.XMLHttpRequest)
        xmlhttp=new XMLHttpRequest();
    else
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

    var url = "https://squidnet.dyndns.org:17389/?username=Administrator&password=******&requestType=JsonAdminRequest&t=" + Math.random();

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 )
        {
            if ( xmlhttp.status == 200 )
                document.getElementById("div1").innerHTML = xmlhttp.responseText;
            else
                document.getElementById("div1").innerHTML = "HTTP Error: " + xmlhttp.status;
        }
    }

    xmlhttp.open("POST", url, true);
    xmlhttp.setRequestHeader('Accept', 'application/json');
    xmlhttp.setRequestHeader('Content-Length', value.length);
    xmlhttp.send( value );

</script>

<div id="div1">SQN SERVER RESPONSE</div>

</body>
</html>

5.5.3 Get All Render Accounts

Retrieve all studio render account:

<!DOCTYPE html>
<html>
<body>

<script>


    var xmlhttp;
    var value = JSON.stringify({"Request":"RENDER_ACCOUNT_GET",
                "Properties":{  "StudioName":"ABC Studios",
                                "UserName": "all"
                                }});

    if (window.XMLHttpRequest)
        xmlhttp=new XMLHttpRequest();
    else
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

    var url = "https://squidnet.dyndns.org:17389/?username=Administrator&password=******&requestType=JsonAdminRequest&t=" + Math.random();

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 )
        {
            if ( xmlhttp.status == 200 )
                document.getElementById("div1").innerHTML = xmlhttp.responseText;
            else
                document.getElementById("div1").innerHTML = "HTTP Error: " + xmlhttp.status;
        }
    }

    xmlhttp.open("POST", url, true);
    xmlhttp.setRequestHeader('Accept', 'application/json');
    xmlhttp.setRequestHeader('Content-Length', value.length);
    xmlhttp.send( value );

</script>

<div id="div1">SQN SERVER RESPONSE</div>

</body>
</html>

5.5.4 Update Render Account

Update studio render account:

<!DOCTYPE html>
<html>
<body>

<script>


    var xmlhttp;
    var value = JSON.stringify({"Request":"RENDER_ACCOUNT_UPDATE",
                "Properties":{  "StudioName":"ABC Studios",
                                "UserName": "brubble",
                                "Md5Password": "2904827289489237829347874",
                                "MaxJobSubmit": 20
                                }});

    if (window.XMLHttpRequest)
        xmlhttp=new XMLHttpRequest();
    else
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

    var url = "https://squidnet.dyndns.org:17389/?username=Administrator&password=******&requestType=JsonAdminRequest&t=" + Math.random();

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 )
        {
            if ( xmlhttp.status == 200 )
                document.getElementById("div1").innerHTML = xmlhttp.responseText;
            else
                document.getElementById("div1").innerHTML = "HTTP Error: " + xmlhttp.status;
        }
    }

    xmlhttp.open("POST", url, true);
    xmlhttp.setRequestHeader('Accept', 'application/json');
    xmlhttp.setRequestHeader('Content-Length', value.length);
    xmlhttp.send( value );

</script>

<div id="div1">SQN SERVER RESPONSE</div>

</body>
</html>

5.5.5 Remove Render Account

Retrieve remove render account:

<!DOCTYPE html>
<html>
<body>

<script>


    var xmlhttp;
    var value = JSON.stringify({"Request":"RENDER_ACCOUNT_REMOVE",
                "Properties":{  "StudioName":"ABC Studios",
                                "UserName": "brubble"
                                }});

    if (window.XMLHttpRequest)
        xmlhttp=new XMLHttpRequest();
    else
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

    var url = "https://squidnet.dyndns.org:17389/?username=Administrator&password=******&requestType=JsonAdminRequest&t=" + Math.random();

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 )
        {
            if ( xmlhttp.status == 200 )
                document.getElementById("div1").innerHTML = xmlhttp.responseText;
            else
                document.getElementById("div1").innerHTML = "HTTP Error: " + xmlhttp.status;
        }
    }

    xmlhttp.open("POST", url, true);
    xmlhttp.setRequestHeader('Accept', 'application/json');
    xmlhttp.setRequestHeader('Content-Length', value.length);
    xmlhttp.send( value );

</script>

<div id="div1">SQN SERVER RESPONSE</div>

</body>
</html>

5.6 Studio Account Management

5.6.1 Get Studio Account List (SQL)

Retreive all studio accounts from SQL database:

<!DOCTYPE html>
<html>
<body>

<script>
    var xmlhttp;
    var value = JSON.stringify({"Request":"SQL_SELECT",
                "Properties":{
                        "statement": "select * from studio_table;",
                        "tableName": "studio_table"
                                }});

    if (window.XMLHttpRequest)
        xmlhttp=new XMLHttpRequest();
    else
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

    var url = "https://squidnet.dyndns.org:17389/?username=Administrator&password=******&requestType=JsonAdminRequest&t=" + Math.random();

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 )
        {
            if ( xmlhttp.status == 200 )
                document.getElementById("div1").innerHTML = xmlhttp.responseText;
            else
                document.getElementById("div1").innerHTML = "HTTP Error: " + xmlhttp.status;
        }
    }

    xmlhttp.open("POST", url, true);
    xmlhttp.setRequestHeader('Accept', 'application/json');
    xmlhttp.setRequestHeader('Content-Length', value.length);
    xmlhttp.send( value );

</script>

<div id="div1">SQN SERVER RESPONSE</div>

</body>
</html>

5.6.2 Get Studio Account (SQL)

Get specific Studio Account from SQL database:

<!DOCTYPE html>
<html>
<body>

<script>
    var xmlhttp;
    var value = JSON.stringify({"Request":"SQL_SELECT",
                "Properties":{
                        "statement": "select cid,studioname,contactemail from studio_table where studioname='Abc Studios';",
                        "tableName": "studio_table"
                                }});

    if (window.XMLHttpRequest)
        xmlhttp=new XMLHttpRequest();
    else
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

    var url = "https://squidnet.dyndns.org:17389/?username=Administrator&password=******&requestType=JsonAdminRequest&t=" + Math.random();

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 )
        {
            if ( xmlhttp.status == 200 )
                document.getElementById("div1").innerHTML = xmlhttp.responseText;
            else
                document.getElementById("div1").innerHTML = "HTTP Error: " + xmlhttp.status;
        }
    }

    xmlhttp.open("POST", url, true);
    xmlhttp.setRequestHeader('Accept', 'application/json');
    xmlhttp.setRequestHeader('Content-Length', value.length);
    xmlhttp.send( value );

</script>

<div id="div1">SQN SERVER RESPONSE</div>

</body>
</html>

5.6.3 Update Studio Account (SQL)

Update Studio Account in SQL database:

<!DOCTYPE html>
<html>
<body>

<script>
    var xmlhttp;
    var value = JSON.stringify({"Request":"SQL_UPDATE",
                "Properties":{
                        "statement": "update studio_table set ContactEmail='user@abcstudios.com' where studioname='ABC Studios';",
                        "tableName": "studio_table"
                                }});

    if (window.XMLHttpRequest)
        xmlhttp=new XMLHttpRequest();
    else
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

    var url = "https://squidnet.dyndns.org:17389/?username=Administrator&password=******&requestType=JsonAdminRequest&t=" + Math.random();

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 )
        {
            if ( xmlhttp.status == 200 )
                document.getElementById("div1").innerHTML = xmlhttp.responseText;
            else
                document.getElementById("div1").innerHTML = "HTTP Error: " + xmlhttp.status;
        }
    }

    xmlhttp.open("POST", url, true);
    xmlhttp.setRequestHeader('Accept', 'application/json');
    xmlhttp.setRequestHeader('Content-Length', value.length);
    xmlhttp.send( value );

</script>

<div id="div1">SQN SERVER RESPONSE</div>

</body>
</html>

5.6.4 Create Studio Account

Create Studio Account:

<!DOCTYPE html>
<html>
<body>

<script>

/*
    LeasePurchaseOption:
        0 : Default CUI button
        1 : Hide button
        2 : Open Browser to user website
*/

    var xmlhttp;
    var value = JSON.stringify({"Request":"STUDIO_ACCOUNT_CREATE",
                "Properties":{  "StudioName":"ABC Studios",
                                "Website":"joe@abcstudios.com",
                                "ContactEmail":"joe@sony.com,joe2@sony.com",
                                "Status":true,
                                "AppProfiles":"MAXWELL,C4D",
                                "MaxQueueJobs":100,
                                "ArchiveDays": 21,
                                "LeasePurchaseOption": 1,
                                "MaxQueueJobs": 100,
                                "ProjectCacheDays": 21,
                                "SyncStorageGBs":100
                                }});

    if (window.XMLHttpRequest)
        xmlhttp=new XMLHttpRequest();
    else
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

    var url = "https://squidnet.dyndns.org:17389/?username=Administrator&password=******&requestType=JsonAdminRequest&t=" + Math.random();

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 )
        {
            if ( xmlhttp.status == 200 )
                document.getElementById("div1").innerHTML = xmlhttp.responseText;
            else
                document.getElementById("div1").innerHTML = "HTTP Error: " + xmlhttp.status;
        }
    }

    xmlhttp.open("POST", url, true);
    xmlhttp.setRequestHeader('Accept', 'application/json');
    xmlhttp.setRequestHeader('Content-Length', value.length);
    xmlhttp.send( value );

</script>

<div id="div1">SQN SERVER RESPONSE</div>

</body>
</html>

5.6.5 Get Studio Account

Get Studio Account:

<!DOCTYPE html>
<html>
<body>

<script>


    var xmlhttp;
    var value = JSON.stringify({"Request":"STUDIO_ACCOUNT_GET","Properties":{"StudioName":"ABC Studios"}});

    if (window.XMLHttpRequest)
        xmlhttp=new XMLHttpRequest();
    else
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

    var url = "https://squidnet.dyndns.org:17389/?username=Administrator&password=******&requestType=JsonAdminRequest&t=" + Math.random();

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 )
        {
            if ( xmlhttp.status == 200 )
                document.getElementById("div1").innerHTML = xmlhttp.responseText;
            else
                document.getElementById("div1").innerHTML = "HTTP Error: " + xmlhttp.status;
        }
    }

    xmlhttp.open("POST", url, true);
    xmlhttp.setRequestHeader('Accept', 'application/json');
    xmlhttp.setRequestHeader('Content-Length', value.length);
    xmlhttp.send( value );

</script>

<div id="div1">SQN SERVER RESPONSE</div>

</body>
</html>

5.6.6 Get All Studio Accounts

Get All Studio Accounts:

<!DOCTYPE html>
<html>
<body>

<script>


    var xmlhttp;
    var value = JSON.stringify({"Request":"STUDIO_ACCOUNT_GET","Properties":{"StudioName":"all"}});

    if (window.XMLHttpRequest)
        xmlhttp=new XMLHttpRequest();
    else
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

    var url = "https://squidnet.dyndns.org:17389/?username=Administrator&password=******&requestType=JsonAdminRequest&t=" + Math.random();

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 )
        {
            if ( xmlhttp.status == 200 )
                document.getElementById("div1").innerHTML = xmlhttp.responseText;
            else
                document.getElementById("div1").innerHTML = "HTTP Error: " + xmlhttp.status;
        }
    }

    xmlhttp.open("POST", url, true);
    xmlhttp.setRequestHeader('Accept', 'application/json');
    xmlhttp.setRequestHeader('Content-Length', value.length);
    xmlhttp.send( value );

</script>

<div id="div1">SQN SERVER RESPONSE</div>

</body>
</html>

5.6.7 Update Studio Accounts

Update Studio Accounts:

<!DOCTYPE html>
<html>
<body>

<script>


/*
    LeasePurchaseOption:
        0 : Default CUI button
        1 : Hide button
        2 : Open Browser to user website
*/
    var xmlhttp;
    var value = JSON.stringify({"Request":"STUDIO_ACCOUNT_UPDATE",
                "Properties":{  "StudioName":"ABC Studios",
                                "AppProfiles":"MAXWELL",
                                "MaxQueueJobs":100,
                                "ArchiveDays": 21,
                                "MaxQueueJobs": 100,
                                "ProjectCacheDays": 9,
                                "LeasePurchaseOption": 2,
                                "UserIdleTimeout" : 24,
                                "SyncStorageGBs":100
                                }});

    if (window.XMLHttpRequest)
        xmlhttp=new XMLHttpRequest();
    else
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

    var url = "https://squidnet.dyndns.org:17389/?username=Administrator&password=******&requestType=JsonAdminRequest&t=" + Math.random();

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 )
        {
            if ( xmlhttp.status == 200 )
                document.getElementById("div1").innerHTML = xmlhttp.responseText;
            else
                document.getElementById("div1").innerHTML = "HTTP Error: " + xmlhttp.status;
        }
    }

    xmlhttp.open("POST", url, true);
    xmlhttp.setRequestHeader('Accept', 'application/json');
    xmlhttp.setRequestHeader('Content-Length', value.length);
    xmlhttp.send( value );

</script>

<div id="div1">SQN SERVER RESPONSE</div>

</body>
</html>

5.6.8 Remove Studio Accounts

Remove Studio Accounts:

<!DOCTYPE html>
<html>
<body>

<script>


    var xmlhttp;
    var value = JSON.stringify({"Request":"STUDIO_ACCOUNT_REMOVE","Properties":{"StudioName":"ABC Studios"}});

    if (window.XMLHttpRequest)
        xmlhttp=new XMLHttpRequest();
    else
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

    var url = "https://squidnet.dyndns.org:17389/?username=Administrator&password=******&requestType=JsonAdminRequest&t=" + Math.random();

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 )
        {
            if ( xmlhttp.status == 200 )
                document.getElementById("div1").innerHTML = xmlhttp.responseText;
            else
                document.getElementById("div1").innerHTML = "HTTP Error: " + xmlhttp.status;
        }
    }

    xmlhttp.open("POST", url, true);
    xmlhttp.setRequestHeader('Accept', 'application/json');
    xmlhttp.setRequestHeader('Content-Length', value.length);
    xmlhttp.send( value );

</script>

<div id="div1">SQN SERVER RESPONSE</div>

</body>
</html>

5.7 Render Farm Management

5.7.1 Get Pool List

Get pool list:

<!DOCTYPE html>
<html>
<body>

<script>


    var xmlhttp;
    var value = JSON.stringify(
                            { "Request":"POOL_LIST_GET","Properties":
                                {
                                    "PoolName":"all"
                                }
                            });

    if (window.XMLHttpRequest)
        xmlhttp=new XMLHttpRequest();
    else
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

    var url = "https://squidnet.dyndns.org:17389/?username=Administrator&password=******&requestType=JsonAdminRequest&t=" + Math.random();

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 )
        {
            if ( xmlhttp.status == 200 )
                document.getElementById("div1").innerHTML = xmlhttp.responseText;
            else
                document.getElementById("div1").innerHTML = "HTTP Error: " + xmlhttp.status;
        }
    }

    xmlhttp.open("POST", url, true);
    xmlhttp.setRequestHeader('Accept', 'application/json');
    xmlhttp.setRequestHeader('Content-Length', value.length);
    xmlhttp.send( value );

</script>

<div id="div1">SQN SERVER RESPONSE</div>

</body>
</html>

5.7.2 History Get Job

Use this request to retrieve a specific record from SquidNet’s history database. Optionally, you can obtain a list of QIDs (queue identifiers) by using the HISTORY_SEARCH JSON request.

Get Job from history database:

<!DOCTYPE html>
<html>
<body>

<script>


    var xmlhttp;
    var value = JSON.stringify(
        {"Request":"HISTORY_GET",
         "Properties":
         {
             "QID": "QID:RODIN-D8E025D40D-17132017-0F23D"
         }
        });

    if (window.XMLHttpRequest)
        xmlhttp=new XMLHttpRequest();
    else
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

    var url = "https://squidnet.dyndns.org:17389/?username=Administrator&password=******&requestType=JsonAdminRequest&t=" + Math.random();

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 )
        {
            if ( xmlhttp.status == 200 )
                document.getElementById("div1").innerHTML = xmlhttp.responseText;
            else
                document.getElementById("div1").innerHTML = "HTTP Error: " + xmlhttp.status;
        }
    }

    xmlhttp.open("POST", url, true);
    xmlhttp.setRequestHeader('Accept', 'application/json');
    xmlhttp.setRequestHeader('Content-Length', value.length);
    xmlhttp.send( value );

</script>

<div id="div1">SQN SERVER RESPONSE</div>

</body>
</html>