JostKYC API allows verification using a popup system while selecting your customized colour themes that conforms to your website colours. This allows you to verify your users without them leaving your website. It provides a unique system to make your users stay focused.
All successful and approved verification will return a callback response if provided. The callback response contains a preview link field to view user verification details. Check the preview sample section below for details. To use JostKYC API, you must sign up for an account. You will require your Connection ID from your "Connection Settings" area of your account.
For all successful verification request, an initial status indicating that verification was completed is sent to callback url (if provided). When the verification is reviewed and approved or suspended either by Merchant or Jostkyc, another status indicator is sent to the callback url.
All submitted verification, usually are reveiwed within 24 hours by our agents. During review, a verification may be approved if all details are valid or suspended if any details provided is invalid and merchant and/or user are/is notified depending on notification settings set by in merchant's account. The provided merchant request callback url is also notified. The callback notification should be handled by merchant in order to update user verification status on merchant platform.
You can read JostKYC Guide for guidance and requirements. Read below for more details on how to integrate. We also provide support for mobile integration. Check the mobile integration section for sample code
Notice to Merchants
JostKYC popup API allows you to integerate JostKYC with your website without leaving navigating away. It is easy and very handy to integrate. All that you require to integrate popup API is a reference to Jquery Library, a reference to our third-party Webcam Library and a reference to JostKYC Popup API It may also require bootstrap JS and bootstrap CSS libraries depending on your site architecture. Please, in your integration, ensure the JQuery library is also loaded on your site.
Check below for parameters, scripts and callbacks.
Note: parameters are all in lower cases.PARAMETER | VALUE OPTION | STATUS | DETAILS |
---|---|---|---|
request_id | XXXXXXXX | Required | Unique ID to identify request |
id | XXXXXXXXXXXXXXXX | Required | Connection ID |
mode | Live | Test | Optional | Default is Live |
type | Basic | Standard | Optional | Default is Standard |
emailrequest | Jostkyc | Remote | Optional | Default is Jostkyc. If set to Remote, then Jostkyc platform will send email verification code to merchant callback. Merchant must handle callback to send email code to user. If set to Jostkyc, email verification is sent directly to user from Jostkyc platform. The verification code is stored in field TOKEN |
callback | URL | Optional | Verification response will be sent to |
footerbackground | #083154 | Optional | Footer colour. Default is #083154 |
button | #083154 | Optional | Button colour. Default is #083154 |
country | Nigeria | Others | Optional | Default is Nigeria |
phone | 2348193837776 | Optional | User phone number |
uchesegun@gmail.com | Optional | User email | |
firstname | Uche | Optional | User firstname |
othernames | Audu | Optional | User other names |
lastname | Segun | Optional | User lastname |
delete_request | No|Yes | Optional | If Yes verification request record will be deleted after 24 hours and will no longer be available on our system |
Minimal requirement approach for JostKYC Popup API
<div id="jccontent"></div> <a href="#" class="jcverify" data-type="Standard" data-id="XXXXXXXXXXXXXXXXX" data-request_id="YOUR_UNIQUE_IDENTIFIER_FOR_THIS_USER" data-callback="https://jostkyc.com/api_test" >Click Here</a> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script src="https://jostkyc.com/asset/js/cam.min.js"></script> <script src="https://jostkyc.com/inline/jc.js"></script>
Full options approach for JostKYC Popup API
<div id="jccontent"></div><!-- use this when there is possibility of pop-up been blocked. You may have to check first before rendering --> <a href="#" class="jcverify" data-type="Standard" data-id="XXXXXXXXXXXXXXXXX" data-email="sample@yahoo.com" data-request_id="time()" data-callback="https://jostkyc.com/api_test" data-firstname="Firstname" data-lastname="Lastname" data-phone="23480XXXXXXXX" data-country="Nigeria" data-type="Standard" >Click Here</a> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script src="https://jostkyc.com/asset/js/cam.min.js"></script> <script src="https://jostkyc.com/inline/jc.js"></script>
You can monitor if a verification process has been completed by a user or not. An hidden field with class name 'jostkyc_is_completed' is always prevented at every view. The value of the field could be 'Yes','No' or ''. It is 'Yes' when verification process is completed and '' when verification process is still in progress. It is 'No' when verification process is terminated for any reason.
Using this field, you can know when user has completed verification and redirect to a success page. Check the sample code below.
//The hidden field is in the format and values may be "Yes", "No", "" //<input type="hidden" class="jostkyc_is_completed" name="jostkyc_is_completed" value="No"> <script> $(document).ready(function(){ setInterval(timer, 1000); }); function timer(){ var status= $(".jostkyc_is_completed").val(); if(status=="Yes"){ window.location = "https://mysite.com/success"; } } </script>
Below are the parameters that will be sent back in JostKYC Popup API to callback url if provided.
PARAMETER | VALUE OPTION | DETAILS |
---|---|---|
status | 0 | 1 | 2 | 3 | 4 | 0 for Pending, 1 for Completed, 2 for Suspended, 3 for Done, 4 for Email Verification Code |
request_id | XXXXXXXX | Unique ID to identify request |
message | Parameters are not set | Message is json of verification details when status is 1 or 3, email of verified user when status is 2 else text description. The json message for status 1 will contain key with value "COMPLETED" and status 3 will contain key with value "DONE" |
$status = $_POST["status:]; $request_id =$_POST["request_id"]; $message = $_POST["message"]; if($status=="1") { //Status Completed /**{"status":"1","request_id":"xxxxxxxx","message":"{"PHOTOCAPTURE":"https://jostkyc.com/captures/xxxxxxx_xxxx/face_xxxx.xxxx.jpeg", "IDCAPTURE":"https://jostkyc.com/captures/xxxxx_xxxxx/id_xxxx.xxxx.jpeg","STATUS":"COMPLETED","EMAIL":"sample@yahoo.com", "PREVIEW":"https://jostkyc.com/preview/xxxxxxx","DETAILS":"Verification successful"}"} **/ $json= json_decode($message,true); $email=$json["EMAIL"]; //Do other operations; } if($status=="4") { // Status Remote Email $json= json_decode($message,true); $email=$json["EMAIL"]; $firstname = $json["FIRSTNAME"]; $token = $json["TOKEN"]; //Create sample email $message = "Dear ".$firstname.",<br><br> Use <b>".$token."</b> as your KYC email verification token. Please disregard if you do not initiate any verification process<br>"; //Send email; //Do other operations } if($status=="2") { //Status Suspended $email=$message; //Create sample email $message = "Hello,<br><br> Your KYC has been rejected. You must login to your account to re-capture your KYC details. You must ensure that you provide accurate, clear and valid details only.<br>"; //Send email; //Do other operations }
Jostkyc mobile integration follows same method as explained above. All request and responses will come in the same format. However, we have customized scripts to ease your integration depending on the platform you are using to develop your mobile app.
Our mobile integration relies on the native browser of the IDE you are using. Whatever the IDE is, you may inject your values into the native browser and reference url 'https://jostkyc.com/inline/jcmobile.php'.
The reference url already loads Jquery Library, a reference to our third-party Webcam Library and a reference to a mobile version of JostKYC Popup API
Note: You are free to implement and/or customize your mobile application whichever way you want. As such it is not complusory you reference 'https://jostkyc.com/inline/jcmobile.php' as you may decide to reference your own customized private url. However, we advice that you reference the mobile version of JostKYC Popup API that will not load as a popup.
Check below for sample scripts for some platforms
val myWebView = WebView(activityContext) setContentView(myWebView)
<manifest> <uses-permission android:name="android.permission.INTERNET" /> </manifest>
WebView myWebView = (WebView) findViewById(R.id.webview); WebSettings webSettings = myWebView.getSettings(); webSettings.setJavaScriptEnabled(true); webSettings.setDomStorageEnabled(true); webSettings.setBuiltInZoomControls(true); webSettings.setAllowFileAccess(true); /** Allow camera access in webview webSettings.setWebChromeClient(new WebChromeClient() { @Override public void onPermissionRequest(final PermissionRequest request) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { request.grant(request.getResources()); } } });
/** Your url should be your local page or https://jostkyc.com/inline/jcmobile.php (if you are injecting directly) **/ myWebView.loadUrl("https://jostkyc.com/inline/jctest.php")
/** Your url should be your local page or https://jostkyc.com/inline/jcmobile.php (if you are injecting directly) **/ var ref = window.open("https://jostkyc.com/inline/jctest.php", "_self", "location=no,clearcache=yes,footer=yes,clearsessioncache=yes,closebuttoncaption=close"); ref.addEventListener("loadstop", function() {"values_to_inject"});
You can make a direct HTTP call to JostKYC server, to get the fullname of any of your verified customers, by supplying their email address.
Each successful namecheck costs 0.5 credits (₦5)
https://jostkyc.com/api_check_fullname
Input Field Name | Description | Example Value |
---|---|---|
connection_id | Your JostKYC connnection ID | 1505908679QDbzF5mwx4rUKjA |
private_key | Your private key as specified on your account-settings | Abcd1234- |
The valid email-address, for which you want to get the fullname. | sample@example.com |
https://jostkyc.com/api_check_fullname?connection_id=1505908679QDbzF5mwx4rUKjA&private_key=Abcd1234-&email=sample%40example.com
<?php $post_data=array( 'connection_id'=>'1505908679QDbzF5mwx4rUKjA', 'private_key'=>'Abcd1234-', 'email'=>'sample@example.com' ); $api_url='https://jostkyc.com/api_check_fullname'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $api_url); curl_setopt($ch, CURLOPT_POST, true); //curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); $response_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); if($response_code != 200)$response=curl_error($ch); curl_close($ch); if($response_code != 200)$msg="HTTP ERROR $response_code: $response"; else { $json=@json_decode($response,true); if($json===null)$msg="INVALID RESPONSE: $response"; elseif(!empty($json['error']))$msg=$json['error']; else { $msg="Fullname: ".$json['data']['fullname']; } } echo $msg; ?>
The response to a successful 'fullname' request will be a JSON Object, containing the requested information,
Below is a sample successful process's response.
{"data":{"fullname":"John Doe","firstname":"John","lastname":"Doe"}}Below is a sample response to a failed process, a JSON Object
{"error_type":"RECORD","error":"No verification record for sample@example.com"}
error_type
can be any of: BALANCE, RECORD (for missing or unverified record), or AUTH (for missing or invalid request parameters).