licensing/ping (GET)
{server}/api/v1/licensing/ping[?licenseGuid={guid}]
Description
Used to check if ScriptX.Services is available (the call will succeed whether or not the licenseGuid parameter is specified). If licenseGuid is specified and matches an installed license (ScriptX.Services for Windows PC) or valid subscription identifier (ScriptX.Services for Cloud) the options enabled for the license/subscription are returned.
No authorization header is required for this API call.
Applies to:
- ScriptX.Services for Cloud
- ScriptX.Services for On-Premise Devices (licenseGuid parameter is ignored)
- ScriptX.Services for Windows PC
Response model
LicenseOptions {
basicHtmlPrinting (boolean, optional),
advancedPrinting (boolean, optional),
enhancedFormatting (boolean, optional),
printPdf (boolean, optional),
printRaw (boolean, optional)
}
LicenseOptions:
- basicHtmlPrinting (boolean, optional)
- Indicates whether the license (as specified in the optional licenseGuid parameter) is valid for basic HTML printing.
- advancedPrinting (boolean, optional)
- Indicates whether the license (as specified in the optional licenseGuid parameter) is valid for advanced printing options.
- enhancedFormatting (boolean, optional)
- Indicates whether the license (as specified in the optional licenseGuid parameter) is valid for enhanced formatting options.
- printPdf (boolean, optional)
- Indicates whether the license (as specified in the optional licenseGuid parameter) is valid for printing PDF documents.
- printRaw (boolean, optional)
- Indicates whether the license (as specified in the optional licenseGuid parameter) is valid for direct (RAW) printing.
Example usage
Request
<h5>Response <span id="response-status"></span></h5>
<textarea id="response" readonly="readonly" rows="3" class="codefont"></textarea>
<h5>Response headers</h5>
<textarea id="headers" readonly="readonly" rows="3" class="codefont"></textarea>
$(function () {
$('#btn_runcode').click(function () { callServer(); });
});
function callServer() {
$('#response-status').text("(waiting)");
var settings = {
method: "GET",
dataType: "json",
jsonp: false,
cache: false
};
jQuery.ajax("/api/v1/licensing/ping", settings)
.done(function (data, textStatus, jqXHR) {
$('#response-status').text(('(status: ' + jqXHR.status + ' ' + jqXHR.statusText + ')'));
$('#response').val(JSON.stringify(data, null, " ")); // shows JSON response in textarea element
$('#headers').val(jqXHR.getAllResponseHeaders()); // shows response headers in textarea element
// do something with the license information
var isEnabledForAdvancedPrinting = data.advancedPrinting;
var isEnabledForEnhancedFormatting = data.enhancedFormatting;
})
.fail(function (jqXHR, textStatus, errorThrown) {
$('#response-status').text('(status: ' + jqXHR.status + ' ' + jqXHR.statusText + ')');
});
}