# With KBA Escalation

## IDMatch5.0.Escalate

<mark style="color:green;">`POST`</mark> `https://production.idresponse.com/process/escalate/gateway`

Make an **HTTPS POST** request with the following body parameters to find out if the target has provided valid identity attributes. You will receive a synchronous response in 1-3 seconds with a **result** object that includes **action, detail** and **issues**. This service differs from the base IDMatch5.0 in that it will return a KBA quiz conditionally. See the rule set below to find out when a quiz will be returned.

#### Request Body

| Name                                      | Type   | Description                                                        |
| ----------------------------------------- | ------ | ------------------------------------------------------------------ |
| user<mark style="color:red;">\*</mark>    | string | Your account's API username                                        |
| pass<mark style="color:red;">\*</mark>    | string | Your account's API password                                        |
| service<mark style="color:red;">\*</mark> | string | The service name (IDMatch5.0)                                      |
| reference                                 | string | A unique identifier for your customer                              |
| target                                    | object | The individual being sent for verification                         |
| fn<mark style="color:red;">\*</mark>      | string | The target's first name                                            |
| ln<mark style="color:red;">\*</mark>      | object | The target's last name                                             |
| addr<mark style="color:red;">\*</mark>    | string | The target's street address (line 1 and line 2)                    |
| city                                      | string | the target's city                                                  |
| state                                     | string | The target's state                                                 |
| zip<mark style="color:red;">\*</mark>     | string | The target's zip                                                   |
| dob                                       | string | The target's Date of Birth (YYYYMMDD format)                       |
| ssn                                       | string | The target's SSN (either 4 or 9)                                   |
| phone                                     | string | The target's phone number                                          |
| email                                     | string | The target's email address                                         |
| age                                       | string | The age to check (must be sent like "age+" i.e. "18+", "21+" etc.) |
| test\_key                                 | string | The test key value that you are using to test                      |

{% tabs %}
{% tab title="200 Transaction processed and result returned" %}

```javascript
//PASS - no quiz Returned 

{
  "meta": {
    "company": "Company, LLC",
    "confirmation": "21201890",
    "reference": "12345 {A UNIQUE ID}",
    "service": "IDMatch5.0.Escalate",
    "timestamp": "2017-08-08 17:56:14",
    "user": "user@company.com"
  },
  "result": {
    "action": "PASS",
    "detail": "ALL CHECKS PASSED",
    "issues": []
  }
}

//FAIL - no quiz returned 

{
  "meta": {
    "company": "Company, LLC",
    "confirmation": "21201890",
    "reference": "12345 {A UNIQUE ID}",
    "service": "IDMatch5.0.Escalate",
    "timestamp": "2017-08-08 17:56:14",
    "user": "user@company.com"
  },
  "result": {
    "action": "FAIL",
    "detail": "NO MATCH",
    "issues": []
  }
}

//PENDING - quiz returned 

{
    "output": {
        "questions": {
            "questions": [
                {
                    "prompt": "With which of the following states are you or have you been associated?",
                    "type": "state",
                    "id": "state2",
                    "answers": [
                        {
                            "text": "WISCONSIN"
                        },
                        {
                            "text": "WASHINGTON, D.C."
                        },
                        {
                            "text": "NEW YORK"
                        },
                        {
                            "text": "WEST VIRGINIA"
                        },
                        {
                            "text": "None of the above"
                        }
                    ]
                },
                {
                    "prompt": "With which of the following counties are you or have you been associated?",
                    "type": "county",
                    "id": "county0",
                    "answers": [
                        {
                            "text": "COCHRAN"
                        },
                        {
                            "text": "PLATTE"
                        },
                        {
                            "text": "DIVIDE"
                        },
                        {
                            "text": "ROSCOMMON"
                        },
                        {
                            "text": "None of the above"
                        }
                    ]
                },
                {
                    "prompt": "With which of the following zip codes are you or have you been associated?",
                    "type": "zip5",
                    "id": "zip53",
                    "answers": [
                        {
                            "text": "19465"
                        },
                        {
                            "text": "37356"
                        },
                        {
                            "text": "66375"
                        },
                        {
                            "text": "66401"
                        },
                        {
                            "text": "None of the above"
                        }
                    ]
                },
                {
                    "prompt": "With which of the following cities are you or have you been associated?",
                    "type": "city",
                    "id": "city1",
                    "answers": [
                        {
                            "text": "FILLMORE"
                        },
                        {
                            "text": "SCHENECTADY"
                        },
                        {
                            "text": "OKMULGEE"
                        },
                        {
                            "text": "BOCA RATON"
                        },
                        {
                            "text": "None of the above"
                        }
                    ]
                }
            ]
        }
    },
    "meta": {
        "confirmation": 94186314,
        "reference": "",
        "service": "IDMatch5.0.Escalate",
        "timestamp": "2020-06-04 11:31:35",
        "company": "Veratad Technologies, LLC",
        "user": "ws@veratad.com"
    },
    "result": {
        "action": "PENDING",
        "detail": "MORE INFORMATION IS REQUIRED",
        "issues": [
            "YOB CHECK FAILED",
            "DOB CHECK FAILED"
        ]
    },
    "continuations": {
        "questions": {
            "url": "/process/continue",
            "template": {
                "token": "p7lx6svy7s0dku6vxa9l8yemk1tnwlsj",
                "answers": {
                    "zip53": [],
                    "state2": [],
                    "city1": [],
                    "county0": []
                }
            },
            "instructions": "Add the text of the answers into the empty list for the appropriate question (case sensitive)."
        }
    }
}


```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Use the test\_key attribute to test the service. When the test\_key is provided the system will dynamically drop the live data sources and use the testing database. These transactions are free of charge. To access live data do not send this attribute. The below sample request is one of the available test cases. To access more click the link below.
{% endhint %}

{% content-ref url="../../testing-1/additional-test-cases" %}
[additional-test-cases](https://api.veratad.com/testing-1/additional-test-cases)
{% endcontent-ref %}

## Sample Request Body

```javascript
{
      "user": "USERNAME",
      "pass": "PASSWORD",
      "service": "IDMatch5.0.Escalate",
      "reference": "12345 {A UNIQUE ID}",
      "target":{
            "fn":"Barbara",
            "ln": "Miller",
            "addr": "123 Main St",
            "city": "Stratford",
            "state": "CT",
            "zip": "06614",
            "dob": "19740821",
            "ssn": "854125698",
            "phone": "2015106000",
            "email": "bmiller@veratad.com",
            "age": "21+",
            "test_key": "general_identity"
          }
  }
```

## Request with Quiz Answers

Once your user has answered the questions, send those answers back to the system for scoring and a final evaluation.

## Submit Answers

<mark style="color:green;">`POST`</mark> `https://production.idresponse.com/process/continue`

Sending a POST request with the below body will give you the final evaluation of the quiz and other identity attributes.

#### Request Body

| Name    | Type   | Description                                   |
| ------- | ------ | --------------------------------------------- |
| token   | string | The token returned during the initial request |
| answers | object | The answers the user selected during the quiz |

{% tabs %}
{% tab title="200 " %}

```
{
  "final": {
    "template": {
      "token": "euwd6q5a8b4c0vwc0zy0s6ms1mjh5p0s"
    },
    "url": "/process/status"
  },
  "output": {
    "answers": {
      "asked": 4,
      "correct": 0
    }
  },
  "result": {
    "action": "REVIEW",
    "detail": "TRANSACTION REQUIRES FURTHER ATTENTION",
    "issues": [
      "QUESTION CHECK FAILED"
    ]
  }
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**NOTE:** The token is only valid for 90 seconds by default. So, your user has 90 seconds to answer the quiz.
{% endhint %}

## Sample Request for Answer Scoring

```javascript
{
  "answers": {
    "state3": ["NEW YORK"],
    "mothers_maiden0": ["None of the above"],
    "phone1": ["(206) 393-4478"],
    "county2": ["FAIRFIELD"]
  },
  "token": "1bauxkpczhdiyy3vqm15ais8ue12u7zw"
}
```

## Action and Detail Responses

{% hint style="info" %}
The following are all values that will be returned in the result object of the response.
{% endhint %}

| Action  | Detail                                 | Description                                                                                                                                                                                                             |
| ------- | -------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| FAIL    | NO MATCH                               | No matching identity found in the data sources                                                                                                                                                                          |
| FAIL    | TARGET IS DECEASED                     | Target found as a deceased identity                                                                                                                                                                                     |
| REVIEW  | TRANSACTION REQUIRES FURTHER ATTENTION | Target found and not deceased, but at least one identity attribute provided does not match. This will also populate the "issues" object with a list of the identity attributes that did not match. See full list below. |
| PENDING | MORE INFORMATION IS REQUIRED           | Target is found and not deceased, but has provided some inaccurate identity attributes. This means that a quiz was returned and the transaction is waiting for the answers to be submitted.                             |
| PASS    | ALL CHECKS PASSED                      | Target was found, is not deceased and has passed all verification checks                                                                                                                                                |

## Issues Responses

{% hint style="info" %}
When a transaction returns as REVIEW or PENDING then there will be a list of issues. This list can include any of the below values.
{% endhint %}

| Issue                       | Description                                                 |
| --------------------------- | ----------------------------------------------------------- |
| ADDRESS CHECK FAILED        | The address provided does not match any on file             |
| DATE OF BIRTH CHECK FAILED  | The Date of Birth provided does not match any on file       |
| YEAR OF BIRTH CHECK FAILED  | The Year of Birth provided does not match any on file       |
| MONTH OF BIRTH CHECK FAILED | The Month of Birth provided does not match any on file      |
| DAY OF BIRTH CHECK FAILED   | The Day of Birth provided does not match any on file        |
| SSN CHECK FAILED            | The SSN provided does not match any on file                 |
| PHONE CHECK FAILED          | The phone number provided does not match any on file        |
| EMAIL CHECK FAILED          | The email address provided does not match any on file       |
| AGE CHECK FAILED            | The target does not meet the age attribute provided         |
| POSSIBLE MINOR              | The target is detected as a minor                           |
| QUESTION CHECK FAILED       | The target did not answer at least 3/4 questions correctly. |

## Rules

IDMatch5.0.Escalate will process with the default base ruleset:

{% hint style="success" %}
The base ruleset will return a PASS when:

* A match is found
* The target is not deceased
* The target has provided all valid identity attributes
* No quiz returned
  {% endhint %}

{% hint style="warning" %}
The base ruleset will return a REVIEW when:

* A match is found
* The target is not deceased
* The target's identity attributes do not all match or the quiz was answered incorrectly
* This action will only appear on the final result
* No quiz will be returned
  {% endhint %}

{% hint style="info" %}
The base ruleset will return a PENDING when:

* A match is found
* the target is not deceased
* The target's identity attributes do not all match
* A quiz will be returned
  {% endhint %}

{% hint style="danger" %}
The base ruleset will return a FAIL when:

* A match is not found
* The target is deceased
* A quiz will not be returned
  {% endhint %}
