Installation
View the package on NPM and the open source code on Github.
$ npm install smile-identity-core
Require the package:
const smileIdentityCore = require("smile-identity-core");
and pull in the ID API class:
const IDApi = smileIdentityCore.IDApi;
Please note that the ID API class is available in versions >= 1.0.0.
submit_job method
const connection = new IDApi(partner_id, api_key, sid_server);const response = connection.submit_job(partner_params, id_info);
where:
partner_id = '<Your 3 digit partner ID>';api_key = '<Your base64 encoded API key>'; # Download your API key from the Smile Identity portalsid_server = '0'; # Use '0' for the sandbox server, use '1' for production server# Create required tracking parameterspartner_params = {job_id: '<Your unique job ID here',user_id: '<Your unique ID for the user here>',job_type: 5};# Create ID infoid_info = {first_name: '<name>',last_name: '<surname>',country: '<country code>',id_type: '<id type>',id_number: '<valid id number>',dob: '<date of birth>', // yyyy-mm-ddphone_number: '<phone number>'};
Response
Your response will return a promise with JSON containing the below:
{"JSONVersion":"1.0.0","SmileJobID":"0000001105","PartnerParams":{"user_id":"T6yzdOezucdsPrY0QG9LYNDGOrC","job_id":"FS1kd1dd15JUpd87gTBDapvFxv0","job_type":5},"ResultType":"ID Verification","ResultText":"ID Number Validated","ResultCode":"1012","IsFinalResult":"true","Actions":{"Verify_ID_Number":"Verified","Return_Personal_Info":"Returned"},"Country":"NG","IDType":"DRIVERS_LICENSE","IDNumber":"ABC000000000","ExpirationDate":"2017-10-28","FullName":"John Doe","DOB":"1900-09-20","Photo":"SomeBase64Image","sec_key":"pjxsx...","timestamp":1570698930193}
ID API Result Codes:
Code | Description |
1012 | Success |
1013 | Invalid ID |
1014 | Unsupported ID Type and/or Country |
1015 | Error - Queried Database Unavailable |
1016 | Product Activation Require |