/job/get


GET https://api.sitehost.nz/1.5/job/get.json

Get information about a job, such as its status, creation time, and any relevant log messages.
Many of our API endpoints schedule jobs and return a job type and ID rather than block and perform the action immediately, so this endpoint provides a way to poll for the status of a job.

Query Parameters

ParameterTypeRequiredDescription
typestringYesThe job type as returned by an endpoint. The value should be either 'daemon' or 'scheduler'.Example: scheduler
idintegerYesThe job ID as returned by an endpoint.Example: 32563

Code Samples

JavaScript PHP Rails Python
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", "https://api.sitehost.nz/1.5/job/get.json?apikey=your_key_here&type=scheduler&id=32563", false);

xmlHttp.send();

var response = xmlHttp.responseText;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.sitehost.nz/1.5/job/get.json?apikey=your_key_here&type=scheduler&id=32563");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
require 'net/http'
require 'uri'

uri = URI.parse("https://api.sitehost.nz/1.5/job/get.json?apikey=your_key_here&type=scheduler&id=32563")
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Get.new(uri.request_uri)

response = http.request(request)
import requests

uri = 'https://api.sitehost.nz/1.5/job/get.json?apikey=your_key_here&type=scheduler&id=32563'

response = requests.get(uri)

Response

200:

application/json
{
  "return": {
    "state": "Completed",
    "created": "2025-02-17 10:42:58",
    "started": "2025-02-17 10:43:00",
    "completed": "2025-02-17 10:43:22",
    "logs": [
      {
        "date": "2025-02-17 10:43:00",
        "level": "3",
        "message": "[kvm-http] Preparing to provision"
      },
      {
        "date": "2025-02-17 10:43:00",
        "level": "3",
        "message": "[kvm-http] Installing operating system"
      },
      {
        "date": "2025-02-17 10:43:04",
        "level": "3",
        "message": "[kvm-http] Applying disk sizes"
      },
      {
        "date": "2025-02-17 10:43:06",
        "level": "3",
        "message": "[kvm-http] Configuring networking"
      },
      {
        "date": "2025-02-17 10:43:06",
        "level": "3",
        "message": "[kvm-http] Starting up"
      },
      {
        "date": "2025-02-17 10:43:22",
        "level": "3",
        "message": "[kvm-http] Finished provisioning"
      }
    ]
  },
  "msg": "Successful",
  "status": true
}