> 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/java/utilities.md).

# Utilities

## 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:

<pre class="language-java"><code class="lang-java">import smile.identity.core.Utilities;
import smile.identity.core.models.Options;
import smile.identity.core.models.JobStatusResponse;


// Initialize
<strong>String partnerId = "&#x3C;Put your partner ID here>"; // login to the Smile ID portal to view your partner id
</strong>String apiKey = "&#x3C;Put your API key here>"; // copy your API key from the Smile ID portal
String sidServer = "&#x3C;0 | 1>"; // Use '0' for the sandbox server, use '1' for production server

Utilities utilities = new Utilities();
// Set options for the job status
boolean returnJobStatus = false; // set to true if you want to get the job result in sync
boolean returnHistory = 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.
boolean returnImageLinks = false; // Set to true to receive selfie and liveness images you uploaded. You must set return_job_status to true to use this flag.
String callbackUrl = "&#x3C; optional callback url to use for this job only >";
Options options = new Options(returnHistory, returnImageLinks, returnJobStatus, callBackUrl);

// Get the job status
String userId = "&#x3C;put the user_id of the user whose job(s) results you want to retrieve>"; 
String jobId = "&#x3C;put the job_id of the job you want to retrieve its results>";

JobStatusResponse response = utilities.getJobStatus(userId, jobId, options);
</code></pre>

You can also poll for a job status using:

```java
int retryCount = 3; // number of retry attempts, default is 3
long initialDelay = 2000L; // how long between each try to wait for exponitial backoff, default 2000ms.
JobStatusResponse response = pollJobStatus(userId, jobId, options, retryCount, initialDelay);
```

###


---

# 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/java/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.
