# Generate Link

## Generate Link

<mark style="color:green;">`POST`</mark> `https://dcams.appv3/stable/link/generate`

This endpoint allows you generate a direct link to an iFrame instance and send the user an email if desired.

#### Request Body

| Name        | Type    | Description                                              |
| ----------- | ------- | -------------------------------------------------------- |
| options     | object  | The object where you place certain options               |
| send\_email | boolean | Set to true if you want the link to be sent via an email |

{% tabs %}
{% tab title="200 Link successfully generated" %}

```javascript
{
    "action": "PASS",
    "detail": "Link Generated",
    "link": "https://frontend.dcams.app?request_id=c9c40f18-2c30-43ef-a879-5a82f1c4uf76",
    "email_sent": true,
    "error_message": "",
    "error_description": ""
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
The other body parameters can be found in the iFrame instructions. All of the fields below are the same fields that you would set when creating an iFrame instance via the JS code.
{% endhint %}

## Sample Request Body

{% hint style="info" %}
You must provide a valid token when making this API call. So, make sure you retrieve your token first and then set it here.
{% endhint %}

```javascript
{
    "additionalData": "{\"value_1\":\"test1\",\"value_2\":\"test2\"}",
    "addr": "123 Main Street",
    "city": "Stratford",
    "dob": "19880621",
    "email": "test@veratad.com",
    "language": "es",
    "fn": "Steve",
    "ln": "Smith",
    "reference": "12345-test",
    "international": "false",
    "state": "CT",
    "styleToken": "",
    "token": "e55da960-29cd-4f6c-8546-239f0c9a5456",
    "verificationErrorAlreadyVerifiedSubTitle": "",
    "verificationErrorAlreadyVerifiedTitle": "",
    "verificationErrorPendingSubTitle": "",
    "verificationErrorPendingTitle": "",
    "verificationErrorTokenSubTitle": "",
    "verificationErrorTokenTitle": "",
    "verificationErrorVelocitySubTitle": "",
    "verificationErrorVelocityTitle": "",
    "verificationFailureSubTitle": "",
    "verificationFailureTitle": "",
    "verificationSuccessSubTitle": "",
    "verificationSuccessTitle": "",
    "zip": "06614",
    "options": {
        "send_email": true
    }
}
```

## Responses

| Description        | Value                                                                                                        |
| ------------------ | ------------------------------------------------------------------------------------------------------------ |
| action             | <p>PASS - the link was generated</p><p>ERROR - the link was not generated (see below for all error types</p> |
| detail             | A description of the action result                                                                           |
| link               | The URL value to provide the end user                                                                        |
| email\_sent        | Will be set to true or false                                                                                 |
| error\_message     | The overall error message                                                                                    |
| error\_description | A description of the error that occurred                                                                     |
