Javascript

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.

ID Api Class

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 portal
sid_server = '0'; # Use '0' for the sandbox server, use '1' for production server
# Create required tracking parameters
partner_params = {
job_id: '<Your unique job ID here',
user_id: '<Your unique ID for the user here>',
job_type: 5
};
# Create ID info
id_info = {
first_name: '<name>',
last_name: '<surname>',
country: '<country code>',
id_type: '<id type>',
id_number: '<valid id number>',
phone_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":"PASSPORT",
"IDNumber":"A04150107",
"ExpirationDate":"2017-10-28",
"FullName":"ADEYEMI KEHINDE ADUNOLA",
"DOB":"1989-09-20",
"Photo":"SomeBase64Image",
"sec_key":"pjxsxEY69zEHjSPFvPEQTqu17vpZbw+z7j6ThRdpTwJRO2GjLXN5HHDB52NjAvKPyclSDANHrG1qb/tloO7x4bFJ7tKYE=|8faebe00b317654548f8b739dc631431b67d2d4e6ab65c6d53539aaad1600ac7",
"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