VerifID Sessions (API)

Verification of Identity documents is essential for onboarding processes and KYC compliance. It allows you to confirm the identity of an individual, ensuring that they are who they claim to be. This is vital for preventing identity fraud and building trust with your customers.

As an administrator of the Datakeen platform you can generate a VerifID link that you can send to your end customers in order for them to drop their identity card and take a selfie.

1. Create a unique session URL

You can use the following API to create a unique session URL :

Connection

First you'll need to authenticate in order to retrieve your JWT which will be used later to sign your API calls.

curl --location --request POST 'https://app.datakeen.co/backend/auth/login' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'email=EMAIL' \
--data-urlencode 'password=PASSWORD'
var axios = require('axios');
var qs = require('qs');
var data = qs.stringify({
  'email': YOUR_EMAIL,
  'password': YOUR_PASSWORD 
});
var config = {
  method: 'post',
  url: 'https://app.datakeen.co/backend/auth/login',
  headers: { 
    'Content-Type': 'application/x-www-form-urlencoded'
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

import requests

url = "https://app.datakeen.co/backend/auth/login"

payload='email=YOUR_EMAIL&password=YOUR_PASSWORD'
headers = {
  'Content-Type': 'application/x-www-form-urlencoded'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

{
    "status": 200,
    "message": "Login Successfull",
    "data": {
        "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2M2RhNzU4NGVmNWViYTAwMTIzNDRjOTciLCJmdWxsTmFtZSI6IkFkbWluIE9ueSIsImVtYWlsIjoiYWRtaW5AZGF0YWtlZW4uY29tIiwicm9sZSI6ImFkbWluIiwiaWF0IjoxNjk4OTE0MTE5LCJleHAiOjE2OTkwMDA1MTl9.OYltjehM6xI5CYkMvE2dOuqs_eRuNK0F5WGW4fj1zDc",
        "userDetail": {
            "firstName": "Admin",
            "lastName": "Ony",
            "role": "admin",
            "groupId": "63da774644c30c0013a437ff",
        }
    }
}

Save the token token and the groupId for the next step.

Template

You should have setup a template beforehand with the magic link option checked. This call will list your different templates set.

Once you have created your unique session you can retrieve it's results by calling the session's URL with the unique session Id.

curl --location --request GET 'https://app.datakeen.co/backend/admin/analysis-templates-by-group/{GROUP_ID}' \
--header 'Authorization: Bearer {TOKEN}'
{
    "status": 200,
    "message": "All Templates of group 63da774644c30c0013a437ff",
    "data": [
        {
            "name": "ID card",
            "magicLink": true,
            "customerPhoto": true,
            "livenessCheck": false,
            "synchronousCall": true,
            "_id": "6492f2c055b3700015cbc16c",
						...
        },
        {
            "name": "Test template",
            "magicLink": true,
            "customerPhoto": false,
            "livenessCheck": false,
            "synchronousCall": true,
            "_id": "64391e123adbc2001396fae9",
						...
        }
    ]
}

Save the _id of the template you want to use to create a new session.

Generate link

To generate a new link you'll have to specify in the body the template ID, the success URL for which the user will be redirect if the analysis is successful and an error URL as an error redirect URL.

curl --location --request POST 'https://app.datakeen.co/backend/admin/generate-magic-link-authenticated' \
--header 'Authorization: Bearer {TOKEN}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'templateId={TEMPLATE_ID}' \
--data-urlencode 'successURL={SUCCESS_URL}' \
--data-urlencode 'errorURL={ERROR_URL}'
{
    "status": 200,
    "message": "Magic Link",
    "data": {
        "link": "https://app.datakeen.co/client/test?sessionId=65436874fb24890013e73ffe",
        "sessionId": "65436874fb24890013e73ffe"
    }
}

You'll get a link to redirect your user to and a unique session ID. The session ID will be use to retrieve the result once the user complete the identity verification

2. Get session status and results

Once the user has been redirected to the success or error URL, you can check the data from the completed session with the session ID.

curl --location --request GET 'https://app.datakeen.co/backend/admin/session?sessionId={SESSION_ID}' \
--header 'Authorization: Bearer {TOKEN'
{
    "message": "Success",
    "results": {
        "controls": {
            "matchNameInAllDocuments": {
                "confidence": 1,
                "value": true
            }
        },
        "documents": [
            {
                "cardSide": "front",
                "cardType": "biometric_passport_fr",
                "controls": {
                    "dateValidity": {
                        "confidence": 0.7588705443039458,
                        "value": true
                    },
                    "dateValidityDelivery": {
                        "confidence": 0.8570879098652,
                        "value": true
                    },
                    "globalStatus": {
                        "confidence": 1,
                        "score": 0.6,
                        "value": true
                    },
                    "hologramIsPresent": {
                        "bbox": {
                            "height": 0.1274961531162262,
                            "topleft": [
                                0.8533791787922382,
                                0.05069124698638916
                            ],
                            "width": 0.09851088374853134
                        },
                        "confidence": 0.2730010151863098,
                        "value": true
                    },
                    "matchFirstName": {
                        "confidence": 0.8,
                        "value": true
                    },
                    "matchLastName": {
                        "confidence": 0.8,
                        "value": true
                    },
                    "mrzConformity": {
                        "confidence": 0,
                        "value": false
                    },
                    "mrzValidity": {
                        "confidence": 0,
                        "value": false
                    },
                    "photoIsPresent": {
                        "bbox": {
                            "height": 0.49462366104125977,
                            "topleft": [
                                0.027491405606269836,
                                0.21966207027435303
                            ],
                            "width": 0.26918670535087585
                        },
                        "confidence": 0.9749985337257385,
                        "value": true
                    }
                },
                "encoded_file": "data:pdf/pdf...",
                "entities": [
                    "d6ca8b77-3ac7-47bd-bab7-33404fbed6ad"
                ],
                "extractedInformation": {
                    "address": {
                        "bbox": {
                            "confidence": null,
                            "height": 0.08648686102259229,
                            "page": {
                                "height": null,
                                "num": 0,
                                "width": null
                            },
                            "text": "",
                            "topleft": [
                                0.6174716780670976,
                                0.496451439216123
                            ],
                            "width": 0.2048678102746474
                        },
                        "confidence": 0.5596482234228333,
                        "value": "3 QUATER AVENUE BELLEFORIERE 78600 MAISONS-LAFFITTE FRANCE"
                    },
                     ...
                },
                "message": "",
                "origin": "Screenshot 2023-10-30 at 15.44.49.png",
                "pages": [
                    {
                        "num": 0,
                        "path": "Screenshot 2023-10-30 at 15.44.49.png",
                        "type": ""
                    },
                    {
                        "num": 0,
                        "path": "Screenshot 2023-10-30 at 15.44.55.png",
                        "type": ""
                    }
                ],
                "path": "PAUL DUPOND ID.pdf",
                "status": 200,
                "type": "id-card"
            }
        ],
        "entities": [
            {
                "firstName": "PAUL",
                "id": "d6ca8b77-3ac7-47bd-bab7-33404fbed6ad",
                "lastName": "DUPOND"
            }
        ],
        "report": null
    },
    "status": 200,
    "webhook": null
}