> For the complete documentation index, see [llms.txt](https://legacy-docs.usesmileid.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://legacy-docs.usesmileid.com/integration-options/server-to-server/python/utilities.md).

# Utilities

###

Required Class: **Utilities Class**

## Job Status

The job status endpoint lets you retrieve information about jobs you have ran previously. With the job status endpoint, you can get the job results, submitted selfie and liveness images, and the ID response (this is only available on the Enhanced KYC and Biometric KYC products).

{% hint style="info" %}
If you are querying job status for a job immediately after submitting it, you might need to keep polling job status till you get a result. We recommend you always submit your job with a callback.
{% endhint %}

To run job status for a job, you can edit the sample code below:

```ruby
from smile_id_core import Utilities, ServerError

# Initialize
partner_id = "<Put your partner ID here>"; #login to the Smile ID portal to view your partner id
api_key = "<Put your API key here>"; # copy your API key from the Smile ID portal
sid_server = <0 | 1>; # Use 0 for the sandbox server, use 1 for production server

connection = Utilities(partner_id,api_key,sid_server)

# Set the Partner Params
partner_params = {
    "user_id": "<put previously registered user's user_id here>",
    "job_id": "<put your unique job ID here>",
}

# Set options for the job status
options = {
  "return_job_status": True,
  "return_history": <True | False>, # Set to true to return results of all jobs you have ran for the user in addition to current job result. You must set return_job_status to true to use this flag.
  "return_images": <True | False>, # Set to true to receive selfie and liveness images you uploaded. You must set return_job_status to true to use this flag.
  "signature": True
}

# Get the job status
try:
    response = connection.get_job_status(partner_params,options)
except ValueError:
    # some of your params entered for a job are not valid or missing
    print("handle ValueError")
except ServerError:
    # Server returned an error
    print("handle ServerError")
except FileNotFoundError:
    # Sent a file which could not be found
    print("handle FileNotFoundError")
```

### Example Response

If you set both `return_history` and `return_images` to `True`, you will receive the JSON object containing the result like below:

```json
{
  "job_success": true,
  "result": {
    "ConfidenceValue": "99",
    "Actions": {
      "Verify_ID_Number": "Verified",
      "Return_Personal_Info": "Returned",
      "Human_Review_Update_Selfie": "Not Applicable",
      "Human_Review_Compare": "Not Applicable",
      "Update_Registered_Selfie_On_File": "Not Applicable",
      "Liveness_Check": "Not Applicable",
      "Register_Selfie": "Approved",
      "Human_Review_Liveness_Check": "Not Applicable",
      "Selfie_To_ID_Authority_Compare": "Completed",
      "Selfie_To_ID_Card_Compare": "Not Applicable",
      "Selfie_To_Registered_Selfie_Compare": "Not Applicable"
    },
    "ResultText": "Enroll User",
    "PartnerParams": {
      "job_type": "1",
      "optional_info": "Your additional tracking information",
      "user_id": "HBBBBBBH57g",
      "job_id": "HBBBBBBHg"
    },
    "Source": "WebAPI",
    "ResultCode": "0810",
    "SmileJobID": "0000001111"
  },
  "code": "2302",
  "job_complete": true,
  "signature": "...",
  "history": [
    {
      "ConfidenceValue": "99",
      "Actions": {
        "Verify_ID_Number": "Verified",
        "Return_Personal_Info": "Returned",
        "Human_Review_Update_Selfie": "Not Applicable",
        "Human_Review_Compare": "Not Applicable",
        "Update_Registered_Selfie_On_File": "Not Applicable",
        "Liveness_Check": "Not Applicable",
        "Register_Selfie": "Approved",
        "Human_Review_Liveness_Check": "Not Applicable",
        "Selfie_To_ID_Authority_Compare": "Completed",
        "Selfie_To_ID_Card_Compare": "Not Applicable",
        "Selfie_To_Registered_Selfie_Compare": "Not Applicable"
      },
      "ResultText": " Enroll User",
      "PartnerParams": {
        "job_type": "1",
        "optional_info": "we are one",
        "user_id": "HBBBBBBH57g",
        "job_id": "HBBBBBBHg"
      },
      "Source": "WebAPI",
      "ResultCode": "0810",
      "SmileJobID": "0000001111"
    }
  ],
  "image_links": {
    "selfie_image": "image_link"
  },
  "timestamp": "2019-10-10T12:32:04.622Z"
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://legacy-docs.usesmileid.com/integration-options/server-to-server/python/utilities.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
