# Create Token

## Create Token

<mark style="color:green;">`POST`</mark> `https://dcams.app/v3/stable/token/create`

This endpoint creates your token with associated settings to access a document iFrame session.

#### Request Body

| Name                      | Type   | Required | Description                                                                                                                                                                                                                             |
| ------------------------- | ------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| user                      | string | true     | Your Veratad API username                                                                                                                                                                                                               |
| pass                      | string | true     | Your Veratad API Password                                                                                                                                                                                                               |
| age                       | string | true     | The age you want to check.This needs to be sent with a "+" at the end like "21+". In that example you are checking that the user is 21 and above.                                                                                       |
| rules                     | string | false    | The DCAMS+ and DCAMS+Review data matching rules. See below for values.                                                                                                                                                                  |
| company\_name\_for\_email | string | false    | Use this to change the company name that appears in the email sent to the customer.                                                                                                                                                     |
| email\_logo\_link         | string | false    | Set a link to a logo image to be placed on the top of the email to the customer                                                                                                                                                         |
| email\_logo\_height       | string | false    | Set the logo height in px                                                                                                                                                                                                               |
| email\_logo\_width        | string | false    | Set the logo width in px                                                                                                                                                                                                                |
| store\_on                 | string | false    | <p>If DCAMS Storage is active in your account you can decide what DCAMS+ Scan result you want to store. Acceptable values are:<br><br>PASS<br>FAIL<br>ALL<br><br>If you do not specify this value the document will not be stored. </p> |
| redirect\_uri             | string | false    | The URL that you would like a user returned to in a redirect or handoff flow.                                                                                                                                                           |

{% tabs %}
{% tab title="200 Token successfully created." %}

```
{
    "result": "Success",
    "message": "Token created successfully",
    "token": "393d50f9-2703-4100-9e4b-dfd8e4fda493",
    "age": "21+",
    "rules": "DCAMS5_0_RuleSet_NAME_DOB",
    "store_on": "FAIL",
    "company_name_for_email": "Company ABC",
    "email_logo_link": "https://yourcompany.com/logo.png",
    "email_logo_height": "50",
    "email_logo_width": "80",
    "dcams_manual_rules": "DCAMS5_0_Manual_Review_RuleSet_NAME_DOB",
    "redirect_uri": "https://example.com/return?req=123"
}
```

{% endtab %}

{% tab title="400 Missing a required input" %}

```
{
    "result": "Error",
    "message": "Missing a required input",
    "token": ""
}

{
    "result": "Error",
    "message": "Invalid age submitted. Must conform to age+ like 21+",
    "token": ""
}

{
    "result": "Error",
    "message": "Invalid ruleset submitted. Please check the documentation",
    "token": ""
}

{
    "result": "Error",
    "message": "Invalid store_on value. Must be PASS, FAIL or ALL",
    "token": ""
}
```

{% endtab %}

{% tab title="401 Username or password is incorrect." %}

```
{
    "result": "Error",
    "message": "Either your username or password is incorrect",
    "token": ""
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**IMPORTANT:** The token is only good for 6 hours. It is recommended that you generate a new token on each iFrame request.
{% endhint %}

## Request Body

```javascript
{
    "user": "USERNAME",
    "pass": "PASSWORD",
    "age": "21+",
    "rules": "DCAMS5_0_RuleSet_NAME_DOB",
    "store_on": "FAIL",
    "company_name_for_email": "Company ABC",
    "email_logo_link": "https://yourcompany.com/logo.png",
    "email_logo_height": "50",
    "email_logo_width": "80",
    "dcams_manual_rules": "DCAMS5_0_Manual_Review_RuleSet_NAME_DOB",
    "redirect_uri": "https://example.com/return?req=123"
}
```

## DCAMS+ & DCAMS+REVIEW Matching Rules

When processing a scan or a manual review you can define what elements from your customer parameters must match the information found on the document provided.

{% hint style="info" %}
**EXAMPLE**

If you send `DCAMS5_0_RuleSet_NAME_DOB` this means that the Name and Date of Birth from your customer's parameters must match the Name and Date of Birth found on the document.
{% endhint %}

{% hint style="warning" %}
If you leave this value empty then **NO** matching rules will be used.
{% endhint %}

Here are the available DCAMS+ rule sets:

* DCAMS5\_0\_RuleSet\_NAME\_DOB
* DCAMS5\_0\_RuleSet\_NAME
* DCAMS5\_0\_RuleSet\_NAME\_ADDR
* DCAMS5\_0\_RuleSet\_NAME\_STATE
* DCAMS5\_0\_RuleSet\_NAME\_STATE\_DOB
* DCAMS5\_0\_RuleSet\_NAME\_ADDR\_DOB

Here are the available DCAMS+REVIEW rule sets:&#x20;

* DCAMS5\_0\_Manual\_Review\_RuleSet\_NAME\_DOB
* DCAMS5\_0\_Manual\_Review\_RuleSet\_NAME
