> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Verification

> Open the FlexiCapture Cloud REST API verification UI for WaitForAction tasks, embed it via an iframe, and handle verification completion events.

Any characters recognized with an insufficient degree of confidence are submitted for verification by human operators. Verification operators either confirm or correct low-confidence characters.

## Verification URLs

For tasks created in the REST API, verification is configured in projects. For detailed instructions, see [Adapt the sample project for use with the ABBYY FlexiCapture Cloud REST API](/flexi-capture/rest-api-sampleproject).

You can integrate the verification UI into third-party systems via an `<iframe>` element, eliminating the need for additional tenant authentication. To direct verification operators to the data to be verified, unique URLs are used.

<Note>
  A verification URL can only be opened once in one browser window; that is, documents from one task can only be verified by one user at a time. The total number of tasks that users can open in the verification UI is determined by the licensing restrictions of a tenant (see [License parameters](/flexi-capture/license-manager/license-param) for details).
</Note>

The verification UI offers the same functionality as the Web Verification Station.

## Open the verification UI

To open the verification UI for a REST API task:

<Steps>
  <Step title="Create a task">
    Using the REST API, create a document processing task.
  </Step>

  <Step title="Track the task status">
    Track the task status. The verification UI can only be opened for tasks with the **WaitForAction** status. For more information about task statuses, see [ABBYY FlexiCapture Cloud REST API task status](/flexi-capture/rest-api-taskstatus).
  </Step>

  <Step title="Create a verification URL">
    Get the `verification_id` from the task object, and then use it to build a URL in the following format:

    ```text theme={null}
    https://{api-portal-host}/verification/{verification_id}
    ```

    Here, `{api-portal-host}` is your region host and `{verification_id}` is the verification identifier. For example:

    ```text theme={null}
    https://cloud-us.flexicapture.com/verification/7bfb534eb05217799deb93d524cd8257
    ```
  </Step>

  <Step title="Open the URL">
    Open the verification URL in a browser or via an `<iframe>` element.

    <Note>
      No additional authentication is required to open verification URLs.
    </Note>
  </Step>

  <Step title="Wait for the completion message">
    Wait for the `FC_Verification_TaskClosed` message from the `<iframe>` element. This message signals that the verification has been completed (see [iframe element events](#iframeevents) below for details).
  </Step>

  <Step title="Download the results">
    Track the task status. You can download the files after the processing is completed.
  </Step>
</Steps>

For instructions on viewing the event log and identifying tasks that have been processed with errors, see [Processing error diagnostics](/flexi-capture/rest-api-tasks).

The following sample shows how to open the verification UI using a verification ID:

```html theme={null}
<html style="min-height: 100%; height: 100%;">
<head>
  <script>
    var form;
    var verId;
    var btn;
    window.addEventListener("DOMContentLoaded", init, false);
    function init() {
      verId = document.getElementById("verificationId");
      btnFrm = document.getElementById("verifyFrame");
      btnWnd = document.getElementById("verifyWindow");
      btnFrm.addEventListener("click", verifyFrame, false);
      btnWnd.addEventListener("click", verifyWindow, false);
      window.addEventListener("message", receiveMessage, false);
    }
    function receiveMessage(event) {
      console.log(event.data);
      alert("isError: " + event.data.isError + "\nEvent: " + event.data.eventName);
    }
    function getUrl(id) {
      return "https://cloud-us.flexicapture.com/verification/" + verId.value;
    }
    function verifyWindow(evt) {
      evt.preventDefault();
      if (!verId.value) return alert("Verification id must be provided!");
      window.open(getUrl(), '_blank')
    }
    function verifyFrame(evt) {
      evt.preventDefault();
      if (!verId.value) return alert("Verification id must be provided!");
      var iframe = document.createElement("iframe");
      iframe.src = getUrl();
      iframe.style.width = "100%";
      iframe.style.height = "95%";
      try {
        document.getElementById("main").removeChild(document.querySelector("iframe"));
      } catch (e) { }
      document.getElementById("main").appendChild(iframe);
    }
  </script>
</head>
<body
  style="background-color: #999999; min-height: 100%; height: 100%; position: relative; margin: 0; padding: 0; background: linear-gradient(to bottom right, #4380bc, #5ba484);">
  <div id="main"
    style="height: 100%; position: relative; padding:20px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;">
    <form id="verifyForm">
      <input id="verificationId" placeholder="verification id" style="width: 250px;" />
      <button id="verifyFrame">Verify in frame</button>
      <button id="verifyWindow">Verify in window</button>
    </form>
  </div>
</body>
</html>
```

<a id="iframeevents" />

## `<iframe>` element events

The table below lists the possible `<iframe>` events:

| Event                                   | Description                                                                                                                      |
| --------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `FC_Verification_TaskClosed`            | Verification completed. The REST API task status changes to "InProgress" for exporting data, or to "Done" for downloading files. |
| `FC_Verification_TaskRejected`          | Task rejected and returned to the queue.                                                                                         |
| `FC_Verification_TaskPostponed`         | Task postponed and returned to the queue.                                                                                        |
| `FC_Verification_TaskSentToException`   | Task sent to the Exceptions folder due to an error.                                                                              |
| `FC_Verification_TaskSentToRecognition` | Task sent to the re-recognition stage.                                                                                           |
| `FC_Verification_TaskSentToStage`       | Task sent to another stage.                                                                                                      |
| `FC_Verification_TaskSentToRescan`      | Task sent to the re-scanning stage.                                                                                              |

Once a message has been received from the `<iframe>` element, the verification UI can be closed and the user can be returned to the third-party system.
