iFrame

With this iFrame guide, we’ve tried to make it as easy as possible to get up and running with DCAMS. The iFrame is built to allow you to scan, review and store identity documents.

What are the steps for getting set up?

1. Create Token

In order for the document scan/upload process to work you must submit a token within the parameters of the veratadModal.

veratadModal = new veratad.modal({
token: "8dfe0180-5389-46d4-a28c-b74061d8e7c3",
});

To get a token you must make an API call with your Veratad username and password. See link below for more details.

Tokens are only valid for 6 hours. It is recommended that you get a new token on each iFrame build.

2. Include CSS, JS and iFrame

<head>
<link rel="stylesheet" href="https://dcams.app/v3/stable/style.css">
</head>

3. Set-up a Webhook URL

Use the admin to set your endpoint, authentication and see IP addresses..

Full Example

This example includes all parameters, functions and methods.

<head>
<link rel="stylesheet" href="https://dcams.app/v3/stable/style.css">
</head>
<body>
<iframe allow="camera" style="display:none;" id="veratad-frame" scrolling="no"></iframe>
<script src="https://code.jquery.com/jquery-3.3.1.js" integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60=" crossorigin="anonymous"></script>
<script>
$( document ).ready(function() {
  $.get( "token.php", function( data ) {
      var token = data.token;
      var veratadModal;
          $(function(){
            veratadModal = new veratad.modal({
              fn: "John", 
              ln: "Smith", 
              addr: "123 Main St", 
              city: "Stratford", 
              state: "CT", 
              zip: "12345", 
              dob: "19880212", 
              phone: "5555555555",
              email: "test51598@veratad.com",
              reference: "tery745f",
              token: token,
              styleToken: "token ID",
              language: "en",
              desktopToMobileHandoff: {
                isActive: true, 
                continueIsAnOption: false
              },
              resultMessages: {
                success:{
                    verificationSuccessTitle: "Enter Text",
                    verificationSuccessSubTitle: "Enter Text",
                  },
                failure: {
                   verificationFailureTitle: "Enter Text",
                   verificationFailureSubTitle: "Enter Text",
                 },
                error: {
                   verificationErrorTokenTitle: "Enter Text",
                   verificationErrorTokenSubTitle: "Enter Text",
                   verificationErrorAlreadyVerifiedTitle: "Enter Text",
                   verificationErrorAlreadyVerifiedSubTitle: "Enter Text",
                   verificationErrorPendingTitle: "Enter Text",
                   verificationErrorPendingSubTitle: "Enter Text",
                   verificationErrorVelocityTitle: "Enter Text",
                   verificationErrorVelocitySubTitle: "Enter Text",
                 }
              },
              additionalData: {
                value_1: "test1",
                value_2: "test2"
              },
              onOpen: function() {

              },
              onClose: function() {

              },
              onSuccess: function() {

              },
              onFailure: function() {

              },
              onEmail: function() {

              },
              onQr: function() {

              },
              onError: function() {

              },
              onErrorToken: function() {

              },
              onErrorAlreadyVerified: function() {

              },
              onErrorPending: function() {

              },
              onErrorVelocity: function() {

              },
            });
          veratadModal.open();
        });
      }, "json" );
  });
    </script>
  <script src="https://dcams.app/v3/stable/initialize.js"></script>
</body>

Functions

Methods

Parameters

resultMessages

These are the messages displayed to the end user in the iFrame.

NOTE: If you do not want the user to be messaged in the iFrame you can simply run the veratadModal.close() after one of the function callbacks.

That said, If you do not customize these messages then your users that get an email link sent to them will see the defaults on the page.

The user has passed verification or successfully uploaded if DCAMS+ is not active, but storage is active.

Webhook

Once a customer's status changes then the webhook will be invoked. The email additional_data or reference values can be used to associate the journey on Veratad's side to a customer/order on your side.

You should always use the backend webhook POST to get the official status of the customer/order. The frontend callback in the JS should only be used to message and route your customer on the frontend.

Example

POST {The URL you setup}

Body

{
    "fn": "John",
    "ln": "Smith",
    "addr": "123 Main St",
    "city": "Stratford",
    "state": "CT",
    "zip": "06614",
    "dob": "19880521",
    "email": "test@veratad.com",
    "reference": "12345-test",
    "status": "PENDING",
    "additionalData": {
        "value_1": "test1",
        "value_2": "test2"
    },
    "dcams_plus": {
        "document_data": {
            "FirstName": "LOUISA",
            "LastName": "SAMPLE",
            "MiddleName": "ANNA",
            "FullAddress": "109 S FOSTER RD, BATON ROUGE, LA, 70808-0000",
            "Address": "109 S FOSTER RD",
            "City": "BATON ROUGE",
            "State": "LA",
            "Zip": "70808-0000",
            "DateOfBirth": "19720629",
            "Height": "5-08",
            "Sex": "F",
            "EyeColor": "BRN",
            "DocumentNumber": "003009381",
            "IssueDate": "20140714",
            "ExpirationDate": "20300629",
            "CountryCode": "USA", // (ISO Alpha 2 or 3)
            "DocumentType": "DRIVERS LICENSE" // other values are PASSPORT, IDENTITY CARD and UNKNOWN
        },
        "confirmation": 92480850,
        "action": "REVIEW",
        "issues": ["DOB DOES NOT MATCH DOCUMENT", "FIRST NAME DOES NOT MATCH DOCUMENT"],
        "detail": "TRANSACTION REQUIRES FURTHER ATTENTION"
    },
    "storage": {
            "success": false
      }
}

Body (When Image Return is Active)

There is a setting when a company is not using the Veratad storage system to have the document images returned via the callback. If this setting is active then the callback body will be as follows.

{
    "fn": "John",
    "ln": "Smith",
    "addr": "123 Main St",
    "city": "Stratford",
    "state": "CT",
    "zip": "06614",
    "dob": "19880521",
    "email": "test@veratad.com",
    "reference": "12345-test",
    "status": "PENDING",
    "additionalData": {
        "value_1": "test1",
        "value_2": "test2"
    },
    "dcams_plus": {
        "document_data": {
            "FirstName": "LOUISA",
            "LastName": "SAMPLE",
            "MiddleName": "ANNA",
            "FullAddress": "109 S FOSTER RD, BATON ROUGE, LA, 70808-0000",
            "Address": "109 S FOSTER RD",
            "City": "BATON ROUGE",
            "State": "LA",
            "Zip": "70808-0000",
            "DateOfBirth": "19720629",
            "Height": "5-08",
            "Sex": "F",
            "EyeColor": "BRN",
            "DocumentNumber": "003009381",
            "IssueDate": "20140714",
            "ExpirationDate": "20300629",
            "CountryCode": "USA", // (ISO Alpha 2 or 3)
            "DocumentType": "DRIVERS LICENSE" // other values are PASSPORT, IDENTITY CARD and UNKNOWN
        },
        "confirmation": 92480850,
        "issues": ["DOB DOES NOT MATCH DOCUMENT", "FIRST NAME DOES NOT MATCH DOCUMENT"],
        "detail": "TRANSACTION REQUIRES FURTHER ATTENTION"
    },
    "storage": {
            "success": false
      },
    "documents": {
        "front": "BASE 64 Encoded Image String",
        "back": "BASE 64 Encoded Image String"
    }
}

Possible Status Values

Last updated