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).
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.
To run job status for a job, you can edit the sample code below:
<?phprequire'vendor/autoload.php';// Initialize$partner_id ="<Put your partner ID here>"; // login to the Smile ID portal to view your partner id$default_callback ="";$api_key ="<Put your API key here>"; // copy your API key from the Smile ID portal$sid_server ="<0 or 1>"; // Use '0' for the sandbox server, use '1' for production server$connection =newSmileIdentityCore( $partner_id, $default_callback, $api_key, $sid_server);//Set the job whose result you want to retrieve$partner_params =array('job_id'=>"<put the job_id of the job you want to retrieve its results>",'user_id'=>"<put the user_id of the user whose job(s) results you want to retrieve>");// Set options for the job status$options =array( "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_image_links" => <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// This method returns a json array$response = $connection->get_job_status($partner_params, $options);?>
Example Response
If you set both return_history and return_image_links to true, you will receive the JSON object containing the result like below: