Smile Identity
Search…
⌃K

Utilities

Utilities Class
You may want to receive more information about a job. This is built into Web Api if you choose to set return_job_status as true in the options class. However, you also have the option to build the functionality yourself by using the Utilities class. Please note that if you are querying a job immediately after submitting it, you will need to poll it for the duration of the job.
import smile.identity.core.Utilities;
String job_status = new Utilities(<partner_id>, <the decoded-version of-your-api-key>, <sid_server>).get_job_status(<user_id>, <job_id>, <return_image_links> , <return_history>);
System.out.println(job_status);
This returns the job status as stringified json data.

Job Status

get_job_status method
Sometimes, you may want to get a particular job status at a later time. You may use the get_job_status function to do this:
You will already have your Web Api class initialised as follows:
WebApi connection = new WebApi(<String partner_id>, <String default_callback_url>, <String decoded_version_of_api_key>, <Integer 0 || 1>);
Thereafter, simply call get_job_status with the correct parameters using the classes we have provided:
// create the stringified json for the partner params using our class (i.e. user_id, job_id, and job_type that you would are querying)
PartnerParameters partnerParameters = new PartnerParameters(<String user_id>, <String job_id>, <Integer job_type>);
// create the options - whether you would like to return_history and return_image_links in the job status response
Options job_status_options = new Options(<Boolean return_history>, <Boolean return_image_links>);
response = connection.get_job_status(partnerParameters.get(), job_status_options.get());
Please note that if you do not need to pass through Options if you will not be using them, you may omit calling those class and send through null instead:
String response = connection.get_job_status(partnerParameters.get(), null);