<img src="" id="image" alt="Dynamically loaded image"/>
#image{
  margin-left:auto;
  margin-right:auto;
  display:block;
}
 var imageRequestData = {
        accountId: 4404, //replace with your own Client ID.
        sku: "DINING_CHAIR", // replace with the item SKU that you require
        country: "us", //replace with the country data
        lang: "eng", //replace with the country language
        features: ["Color", "Yellow"], //replace with the feature set you want for the item
        frame: 1, //replace this with the specific frame that you require
        size: 400, //replace this with the size (pixel size) that you require,
        ssl:1,
    }
 
    
    $.ajax({
        type: "GET",
        traditional: true,
        url: "https://viewer-services.cylindo.com/standard/Viewer/GetImageUrl",//originally http, changed to https
        async: true,
        data: imageRequestData,
        success: function (data) {
            console.log(data); 
            loadImage(data); //the result contains the path to the image that was request with the size parameters included. load this image as needed
        },
        error: function (xhr, text, error) {
            //log the error as you would normally do
        }
    });


    //requests image and loads it into specified DOM element
    function loadImage(imageURL) {
        $.ajax({
            headers: {
                'Authorization': "Basic ZjE5MTZlODAtMGMyNS00Njc1LThmNmYtOTIwMzVhYzZjYjRk"
            },
            async: true,
            type: "GET",
            url: imageURL, 
            success: function (result) { 
                if (imageURL != null) {
                    $("#image").attr('src', imageURL);
                }
            },
            error: function (xhr) {
                //log the error as you would normally do
                if (xhr.status == 429) {
                    console.log("request was throttled");
                }
            }
        });
    }

External CSS

  1. https://viewer.cylindo.com/3.x/v3.3.1/viewer.css

External JavaScript

  1. https://code.jquery.com/jquery-1.12.4.min.js