Orchestrator API v1 (GET)
{server}/api/v1/
Description
Returns the port in use by the ScriptX.Services for Windows PC instance for the current user.
Applies to:
- Built-in ScriptX.Services for Windows PC (2.17.0 and later).
Response model
ServiceDescription {
HttpPort (integer)
}
ServiceDescription:
- HttpPort (integer)
- The port number being used by ScriptX.Services for Windows PC for the current user.
Please note the non-standard capitalisation of "HttpPort".
Although the endpoint is implemented by Orchestrator as a Service, it will always return an error.
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">
document.addEventListener("DOMContentLoaded", function() {
document.getElementById('btn_runcode').addEventListener('click', function() { callServer(); });
});
function callServer() {
document.getElementById('response-status').textContent = "(waiting)";
fetch("http://127.0.0.1:41190/api/v1/")
.then(response => {
if (!response.ok) {
throw new Error('Network response was not ok: ' + response.statusText);
}
document.getElementById('response-status').textContent =
'(status: ' + response.status + ' ' + response.statusText + ')';
response.json().then(data => {
document.getElementById('response').value = JSON.stringify(data, null, " ");
});
return response.headers;
})
.then(headers => {
let headersText = "";
for (let pair of headers.entries()) {
headersText += `${pair[0]}: ${pair[1]}\n`;
}
document.getElementById('headers').value = headersText;
})
.catch(error => {
document.getElementById('response-status').textContent = '(error: ' + error.message + ')';
document.getElementById('response').value = "Failed to fetch data.";
});
}
</script>