NAV Navbar
  • /auth/token
  • /session/<id>/verifai-result
  • /session/<id>
  • /auth/token

    import requests
    
    
    allowed_documents = ["P", "I"]
    handover_url = "<HANDOVER_URL>"
    
    backend_token = "<BACKEND_TOKEN>"
    endpoint = f'{WEB_SDK_URL}/v1/auth/token'
    
    
    data = {
        "document_type_whitelist": allowed_documents,
        "handover_base_url": handover_url,
        "locale": "en_US"
    }
    headers = {
        'Authorization': f'Bearer {backend_token}',
    }
    
    response = requests.post(endpoint, json=data, headers=headers)
    

    Supplies a One Time Password (OTP) for initializing the Frontend

    Endpoint Method Body
    v1/auth/token POST json

    Headers

    Header Value
    Authorization Bearer <BACKEND-TOKEN>

    Body

    Key Type Example
    document_type_whitelist array * ["P", "I"]
    country_choices_whitelist array ["NL", "DE"]
    country_choices_blacklist array ["BE", "AU"]
    handover_base_url str * "https://<YOUR_SITE>/handover"
    allow_edit_privacy_filters bool true
    locale str "en_US"
    enableViz bool false

    Document type whitelist

    The document_type_whitelist accepts the following values:

    Value
    Document
    P Passport
    I Identity Card
    D Drivers license
    RP Residence Permit
    R Refugee travel document

    Country lists

    The country_choices_whitelist and country_choices_blacklist accept all official two letter country codes from the following list: ISO 3166-1 alpha-2

    Handover URL

    The base url to the handover page.

    Example could be: https://<YOUR_SITE>/handover

    Make sure this page is available and serves the handover js

    More info on the handover:

    Supported locales:

    Name Code Flag
    English (American) "en_US" πŸ‡ΊπŸ‡Έ
    English (British) "en_GB" πŸ‡¬πŸ‡§
    German "de_DE" πŸ‡©πŸ‡ͺ
    Dutch "nl_NL" πŸ‡³πŸ‡±

    (BETA) Reading from the Visual Inspection Zone (VIZ):

    Indicate whether or not the text from the VIZ should be read.

    If enableViz is set to true, the Verifai Result object will contain a vizData object consisting of a set of key - value pairs, corresponding to the zone types on the document and their content. The complete list of possible zone keys can be found here.

    Note that this feature is still in the beta stage:

    Response

    {
        "token": "1234567890",
        "expire": "05/29/2017 09:30:12 PM",
        "used": true
    }
    
    HTTP Code data type
    201 json

    Response Data

    Key Type
    token str
    expire str
    used bool

    /session/<id>/verifai-result

    import requests
    
    session_id = "<SESSION_ID_FROM_FRONTEND>"
    internal_token = "<BACKEND_TOKEN>"
    
    endpoint = f'{WEB_SDK_URL}/v1/session/{session_id}/verifai-result'
    
    headers = {
        'Authorization': f'Bearer {internal_token}'
    }
    
    response = requests.get(endpoint, headers=headers)
    

    Gets the Verifai Result object after the flow is done.

    Endpoint Method Body
    v1/session/<session_id>/verifai-result GET -

    Parameters

    Headers

    Header Value
    Authorization Bearer <BACKEND-TOKEN>

    Response

    HTTP Code data type
    200 json

    Response Data

    Key Type Description
    backImage str base-64 encoded data string
    frontImage str base-64 encoded data string
    idModel object ID Model object
    mrzData object Mrz Data object
    barcodes array Array with Barcode objects

    ID Model object

    Key Type Description
    country str Two letter country code
    has_mrz bool Document type has a MRZ
    width_mm int Width of the Document in mm
    height_mm int Height of the Document in mm
    model str Document model name
    type str Document type
    sample_front str base-64 encoded image of the front
    uuid str Document uuid in Verifai backend
    zones array Array with Data Zone objects

    Data Zone object

    Key Type Description
    title str Title of the data zone
    block bool Whether or not the zone should be blocked
    side str The side of the data zone `(FRONT
    x float X coordinate (top-left) relative to the image origin
    y float Y coordinate (top-left) relative to the image origin
    height float Height relative to the image height
    width float Width relative to the image width

    MRZ Data object

    Key Type Description
    composite_check_digit int Check Digit
    country_code str Country (Authority) code of documents origin
    date_of_birth str YYMMDD Birth date of the document holder
    date_of_birth_check_digit int Check Digit
    date_of_expiry str YYMMDD Expiry of the document
    date_of_expiry_check_digit int Check Digit
    document_number str Document number
    document_number_check_digit int Check Digit
    document_sub_type str Secondary document type
    document_type str Primary document type
    format str The Mrz Format
    given_names str Given names of the document holder
    is_composite_valid bool Valid with Check Digit
    is_date_of_birth_valid bool Valid with Check Digit
    is_date_of_expiry_valid bool Valid with Check Digit
    is_date_of_issue_valid bool Valid with Check Digit
    is_document_code_valid bool Valid with Check Digit
    is_document_number_valid bool Valid with Check Digit
    is_line1_length_valid bool Valid with Check Digit
    is_line2_length_valid bool Valid with Check Digit
    is_line3_length_valid bool Valid with Check Digit
    is_nfc_key_valid bool Valid with Check Digit
    is_optional_data_valid bool Valid with Check Digit
    mrz_string str The full MRZ
    nationality str Nationality of document holder
    nfc_key str Key to access the NFC chip
    optional_data str Depends on document and document authority
    optional_data_check_digit int Check Digit
    optional_data_two str Depends on document and document authority
    sex str Sex of document holder
    surname str Surname of document holder

    Mrz Formats and contents:

    MRZ fromats

    Barcode object

    Key Type Description
    type int The code type
    side str The document side the code is on
    data str The data read from the code

    /session/<id>

    import requests
    
    session_id = "<SESSION_ID_FROM_FRONTEND>"
    internal_token = "<BACKEND_TOKEN>"
    
    endpoint = f'{WEB_SDK_URL}/v1/session/{session_id}'
    
    headers = {
        'Authorization': f'Bearer {internal_token}'
    }
    
    response = requests.delete(endpoint, headers=headers)
    

    Deletes a Session

    Endpoint Method Body
    v1/session/<session_id> DELETE json

    Parameters

    Headers

    Header Value
    Authorization Bearer <BACKEND-TOKEN>

    Response

    HTTP Code data type
    200 -