Job Results and Status can be obtained through the /job end point. Since jobs are asynchronous the Tool Provider must call back into the Job Service to get the results prior to queing a job and receiving a Job ID.

The Job Results may be obtained by sending a GET request, secured through HTTP Basic Authentication, to the /job url:

REQUEST:
 - GET /job/d80eb2ec2c2e2cf8775cf36d0da7bca4
 - HEADER:
        Authorization: Basic WW91SGF2ZVRvb011Y2hGcmVlVGltZTpTdG9wUmV2ZXJzZUVuZ2luZWVyaW5nT3VyRG9jdW1lbnRhdGlvbiA6LSk=

RESPONSE:
 - BODY:
     {
         "job_status_message": "Job is still queued",
         "job_status_code": 1,
         "data": null,
         "error": 0,
         "message": null,
         "status": 200,
         "time": null
     }

Jobs will always return a 'Job Result Object' which is outlined in its minimal form above. When complete the 'jobStatusCode' will change to the completed status (4) and, in the case of Course and Roster Pull, will contain the requested data in the 'data' object.

Status

Jobs can have the following status codes:

  1. STATUS_WAITING - The Job is queued and will run as soon a a slot is available.
  2. STATUS_RUNNING - The Job is currently running.
  3. STATUS_FAILED - The Job failed, generally prior to being queued, most likely bad input data.
  4. STATUS_COMPLETE - The Job has finished (status is to be determined by the inner data object).

*** It is important to note that just because a job is complete that it may not be successful! Check the data object, which is specific to the job type, for information about the success of the actual job. ***

Once a job has completed and the data has been fetched the job is deleted from the server. This is done to save space and decrease look up time. This also means that once job data has been fetched it cannot be retrieved again.

   <a name="errors"></a>

Errors

In general the 'data' object will need to be parsed to determine the type of error dependant on the job. However there are some top level errors which are described below:

Unrecognized SSO Key

The provided 'tool_consumer_sso_key' is not valid or unknown:

{
    "error": 1,
    "data": [
        "Unrecognized SSO Key"
    ],
    "message": "Errors found during Roster Pull.",
    "status": 200,
    "time": 6.11,
    "job_status_message": "Job is complete",
    "job_status_code": 4
}

Unrecognized Username

The provided 'tool_consumer_username' is not valid or unknown:

{
    "error": 1,
    "data": [
        "Unrecognized Username"
    ],
    "message": "Errors found during Course Pull.",
    "status": 200,
    "time": 5.9,
    "job_status_message": "Job is complete",
    "job_status_code": 4
}

Invalid Tool Consumer URL

In the event that Gateway detects that the 'tool_consumer_url' is invalid the Job will fail immediately and not be queued:

{
    "error": 1,
    "data": null,
    "message": "Tool Consumer not found by URL",
    "status": 200,
    "time": null
}

For all other errors please see the relevant Job Service section based on the job being performed