Orchestrator API v2 (GET)
{server}/api/v2/?key=[keyvalue]
Description
Returns the port in use by the ScriptX.Services for Windows PC instance registered with the keyvalue.
Applies to:
- Built-in ScriptX.Services for Windows PC (2.18.0 and later) - the key is ignored and the instance port is returned.
- Orchestrator as a Service (2.0.0 and later).
Response model
ServiceDescription {
HttpPort (integer)
}
ServiceDescription:
- HttpPort (integer)
- The port number being used by ScriptX.Services for Windows PC that registered with the matching key value.
Please note the non-standard capitalisation of "HttpPort".
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>
<script type="text/javascript">
$(function () {
$('#btn_runcode').click(function () { callServer(); });
});
function callServer() {
$('#response-status').text("(waiting)");
var settings = {
method: "GET",
dataType: "json",
jsonp: false,
cache: false
};
jQuery.ajax("http://127.0.0.1:41190/api/v1/", 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
})
.fail(function (jqXHR, textStatus, errorThrown) {
$('#response-status').text('(status: ' + jqXHR.status + ' ' + jqXHR.statusText + ')');
});
}
</script>
Key: