BASIS ID provides a configurable web-and-mobile friendly widget to embed onto your platform with only 3 simple html-code blocks.
Embed the BASIS ID widget at the desired stage of your customer journey.
Insert widget code in <head> … </head> section of the page:
<script type="text/javascript" src="https://api.basisid.com/assets/js/widget.multi.js"></script>
Add widget location on your website after <body> tag:
<div id="bas-widget-container" style="min-height: 350px;"> BASIS ID loading...</div>
Add widget code on the bottom of your page before </body> tag:
<script type="text/javascript">
window.BAS.AS.initFrame({
key: "prod-FGOvXeHgIMPUDYKHihBtxWgpDDyfdiRM",
bas_gw: "https://api.basisid.com/",
container_id: "bas-widget-container",
ui: {
width: "100%",
height: "705px",
style: "",
mobile_height: “auto”
},
options: {
},
events:{
onLoad: function(){
console.log("BAS AS loaded");
},
onManualCheck: function(result) {
if (result.status === "ok"){
// User data sending success
// ... Add Your code here ...
}
},
}
});
Upon successful/unsuccessful end of the user registration via Widget, you will receive an object called “result”.
Possible values of the “result” object:
• status – request status;
• user_hash – unique string user ID;
If a user has successfully registered, result looks like:
{
status: 'ok',
user_hash: '27c5728a-7130-408d-b0a1-d55ed8ae7b2f'
}
In case if registration has been cancelled:
{status: 'canceled'}
Important
BASIS ID is using the callback method to transfer the statuses of the verification to the client’s platform.
There are various types of callbacks BASIS ID is able to send, each designed for a specific stage of the verification process. A client has to set up a callback URL from where their system will collect the statuses of the verification process.
An example of such a callback:
{
"user_id":20272,
"user_hash":"27c5728a-7130-408d-b0a1-d55ed8ae7b2f",
"status":11,
"signature":"7ca05937a0e5c42147be2aa23ffad87e80bd866e1ff7950ec6841d4d87d844fe",
"autocheck_bad_reasons":""
}
In response to a callback, you have to send back the status “200OK” with any text, for example, “OK”.
If a response has not been received or it did not contain “200OK”, the system stops sending requests for 3 minutes. After 3 attempts the system will delay the next attempt by an hour.
Every callback contains a signature that allows verifying that the callback is genuine and comes from the BASIS ID.
The signature is a sha256 concatenation of the values/text in all the fields of a callback and API Secret Key 2, available in the production and/or sandbox account of our CRM.
sha256(BASIS_API_SECRET2+user_id+user_hash+status+autocheck_bad_reasons)=signature
Java signature example:
String sign256hex =
org.apache.commons.codec.digest.DigestUtils.sha256Hex(BASIS_API_SECRET2 + user_id + user_hash + status + autocheck_bad_reasons);
if (sign256hex.equals(signature)) {
// Signed ...
}
PHP signature example:
$signature = hash('sha256', BASIS_API_SECRET2 . $inp['user_id'] . $inp['user_hash'] . $inp['status'] . $inp['autocheck_bad_reasons']);
if ($signature == $inp['signature']) {
}
The reasons for the profile to be automatically declined. You can have one reason or many comma separated reasons in “autocheck_bad_reasons” field:
The callback can be sent at various points of the verification process. Client selects which callbacks would they like to receive.
At what stage/s the callback may to be sent:
№ | Callback type | Status values |
---|---|---|
A | When a new user is registered in the system | 2 |
B | When the AML/Sanction screening is completed | 10/11 |
C | When the full verification is completed | 10/11 |
D | When a user is requested to provide additional data | 3 |
{
"user_id":1337,
"user_hash":"27c5728a-7130-408d-b0a1-d55ed8ae7b2f",
"status": 2,
"signature":"7ca05937a0e5c42147be2aa23ffad87e80bd866e1ff7950ec6841d4d87d844fe",
“autocheck_bad_reasons”:
“email“: “johndoe@mail.com“
}
{
"user_id":1337,
"user_hash":"27c5728a-7130-408d-b0a1-d55ed8ae7b2f",
"status":10,
"signature":"7ca05937a0e5c42147be2aa23ffad87e80bd866e1ff7950ec6841d4d87d844fe",
“autocheck_bad_reasons”:
}
{
"user_id":1337,
"user_hash":"27c5728a-7130-408d-b0a1-d55ed8ae7b2f",
"status":11,
"signature":"7ca05937a0e5c42147be2aa23ffad87e80bd866e1ff7950ec6841d4d87d844fe",
“autocheck_bad_reasons”:
}
{
"user_id": 1337,
"user_hash":"27c5728a-7130-408d-b0a1-d55ed8ae7b2f",
"status":10,
"signature":"7ca05937a0e5c42147be2aa23ffad87e80bd866e1ff7950ec6841d4d87d844fe",
"autocheck_bad_reasons":
}
{
"user_id": 1337,
"user_hash":"27c5728a-7130-408d-b0a1-d55ed8ae7b2f",
"status":11,
"signature":"7ca05937a0e5c42147be2aa23ffad87e80bd866e1ff7950ec6841d4d87d844fe",
"autocheck_bad_reasons":"mrz"
}
{
"callback_type": "request",
"user_id":2027,
"user_hash":"27c5728a-7130-408d-b0a1-d55ed8ae7b2f",
"status":3,
"signature":"7ca05937a0e5c42147be2aa23ffad87e80bd866e1ff7950ec6841d4d87d844fe",
"reason": "0,5",
"request": "1,2",
"message": "Request message",
}
"reasons" - list of reasons for requesting data, separated with ','
0 - No required data 1 - Data has mistakes 2 - Email not confirmed
3 - Bad photo quality 4 - No required photos 5 - No MRZ zone on document photos
6 - Bad video quality 7 - Bad utility bill photo
8 - Utility bill is old 9 - Social accounts are not relevant
10 - Bad quality of latest pay slip photo
11 - Pay slip is old 12 - Bad quality of proof of income photo 13 - Proof of income is old
"request" - list of requested data, separated with ','.
0 - Name 1 - Gender 2 - Birthday
3 - Country of Nationality 4 - Full Address 5 - Phone
6 - E-mail 7 - Passport/ID card photo 8 - Client photo
9 - Video 10 - Bank statement 11 - Social networks accounts
12 - Utility bill 13 - Proof of income