> ## 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.

# Integrating the scanning stage

> Embed the ABBYY FlexiCapture Web Scanning Station in a third-party system via an iframe to create, open, or rescan batches using Manage URL commands.

The instructions provided in this section assume that Windows authentication is used. Alternatively, you can use FlexiCapture or SAML authentication.

To load the Scanning Station GUI and functionality, use the `<iframe>` element.

The following scenarios are supported:

## Creating a batch

To create and open a new batch with certain registration parameters, set the `src` attribute to:

```
<stationUrl>/WinAuth/Manage/Create?projectId=[project ID]&batchTypeName=[batch type name]&batchName=[batch name]&regparam=[name:value]
```

where:

<table width="100%" style={{tableLayout:"fixed"}}><colgroup><col style={{width:"25%"}} /><col style={{width:"12%"}} /><col style={{width:"63%"}} /></colgroup><tbody><tr><td><p><strong>Name</strong></p></td><td><p><strong>Required</strong></p></td><td><p><strong>Description</strong></p></td></tr><tr><td><p><code>\<stationUrl></code></p></td><td><p>Yes</p></td><td><p>The address of the Scanning Station to be accessed by the third-party system. The default value is  <code>\<serverName>/FlexiCapture12/Scanning</code>.</p></td></tr><tr><td><p><code>WinAuth</code></p></td><td><p>Yes</p></td><td><p>Windows authentication parameter.</p></td></tr><tr><td><p><code>Create</code></p></td><td><p>Yes</p></td><td><p>The name of the command that creates a new batch.</p></td></tr><tr><td><p><code>projectId</code></p></td><td><p>Yes</p></td><td><p>The ID of the project where the batch is to be created.</p></td></tr><tr><td><p><code>batchTypeName</code></p></td><td><p>Yes</p></td><td><p>The type of the batch to be created.</p></td></tr><tr><td><p><code>batchName </code></p></td><td><p>No</p></td><td><p>A name for the new batch. If no name is specified, the program will select a name based on the settings of the selected batch type.</p></td></tr><tr><td><p><code>regparam </code></p></td><td><p>No</p></td><td><p>A registration parameter in the format <code>name:value</code>. The <code>regparam</code> registration parameter must be specified in the settings of the <code>batchTypeName</code> batch type on the web station. Otherwise, this parameter will be ignored.</p><p><strong>Note: </strong> You can pass more than one registration parameter by joining multiple parameters with the <code>&</code> symbol.</p></td></tr></tbody></table>

## Opening a batch

To open an existing batch with certain registration parameters, set the `src` attribute to:

```
<stationUrl>/WinAuth/Manage/Open?projectId=[project ID]&batchName=[new batch name]&regparam=[name:value]
```

where:

<table width="100%" style={{tableLayout:"fixed"}}><colgroup><col style={{width:"25%"}} /><col style={{width:"12%"}} /><col style={{width:"63%"}} /></colgroup><tbody><tr><td><p><strong>Name</strong></p></td><td><p><strong>Required</strong></p></td><td><p><strong>Description</strong></p></td></tr><tr><td><p><code>\<stationUrl></code></p></td><td><p>Yes</p></td><td><p>The address of the Scanning Station to be accessed by the third-party system. The default value is <code>\<serverName>/FlexiCapture12/Scanning</code>.</p></td></tr><tr><td><p><code>WinAuth</code></p></td><td><p>Yes</p></td><td><p>Windows authentication parameter.</p></td></tr><tr><td><p><code>Open</code></p></td><td><p>Yes</p></td><td><p>The name of the command that opens an existing batch.</p><p><strong>Important! </strong>  If there is more than one batch in the project, the alphabetically first batch will be taken.</p></td></tr><tr><td><p><code>projectId</code></p></td><td><p>Yes</p></td><td><p>The ID of the project that contains the batch to be opened.</p></td></tr><tr><td><p><code>batchName </code></p></td><td><p>No</p></td><td><p>A new name for the batch. Use this parameter if you want to rename the batch.</p></td></tr><tr><td><p><code>regparam </code></p></td><td><p>No</p></td><td><p>A registration parameter in the format <code>name:value</code>. The <code>regparam</code> registration parameter must be specified in the settings of the <code>batchTypeName</code> batch type on the web station. Otherwise, this parameter will be ignored.</p><p><strong>Note: </strong> You can pass more than one registration parameter by joining multiple parameters with the <code>&</code> symbol.</p></td></tr></tbody></table>

<Warning>
  You can only open a batch that has not yet been uploaded to the server.
</Warning>

## Opening or creating a batch

To open a requested batch and create a new batch if the requested batch does not exist, set the `src` attribute to:

```
<stationUrl>/WinAuth/Manage/OpenOrCreate?projectId=[Project ID]&batchTypeName=[batch type name]&batchName=[batch name]&regparam=[name:value]
```

where:

<table width="100%" style={{tableLayout:"fixed"}}><colgroup><col style={{width:"25%"}} /><col style={{width:"12%"}} /><col style={{width:"63%"}} /></colgroup><tbody><tr><td><p><strong>Name</strong></p></td><td><p><strong>Required</strong></p></td><td><p><strong>Description</strong></p></td></tr><tr><td><p><code>\<stationUrl></code></p></td><td><p>Yes</p></td><td><p>The address of the Scanning Station to be accessed by the third-party system. The default value is <code>\<serverName>/FlexiCapture12/Scanning</code>.</p></td></tr><tr><td><p><code>WinAuth</code></p></td><td><p>Yes</p></td><td><p>Windows authentication parameter.</p></td></tr><tr><td><p><code>OpenOrCreate</code></p></td><td><p>Yes</p></td><td><p>The name of the command that opens a requested batch or creates a new batch if the requested batch does not exist.</p></td></tr><tr><td><p><code>projectId</code></p></td><td><p>Yes</p></td><td><p>The ID of the project that contains the batch to be opened/created.</p></td></tr><tr><td><p><code>batchTypeName</code></p></td><td><p>Yes</p></td><td><p>The type of the batch to be opened/created.</p></td></tr><tr><td><p><code>batchName </code></p></td><td><p>No</p></td><td><p>A new name for the batch.</p><p>Use this parameter if you want to rename the existing batch or assign a name to a new batch.</p><p>If this parameter is not used while creating a new batch, the program will select a name based on the settings of the selected batch type.</p></td></tr><tr><td><p><code>regparam </code></p></td><td><p>No</p></td><td><p>A registration parameter in the format <code>name:value</code>. The <code>regparam</code> registration parameter must be specified in the settings of the <code>batchTypeName</code> batch type on the web station. Otherwise, this parameter will be ignored.</p><p><strong>Note: </strong> You can pass more than one registration parameter by joining multiple parameters with the <code>&</code> symbol.</p></td></tr></tbody></table>

<Warning>
  You can only open a batch that has not yet been uploaded to the server.
</Warning>

<h2 id="getting-a-rescanning-task">
  Getting a rescanning task
</h2>

To get a rescanning task, set the `src` attribute to:

```
<stationUrl>/WinAuth/Manage/GetRescan?projectId=[project ID]&batchName=[new batch name]&regparam=[name:value]
```

where:

<table width="100%" style={{tableLayout:"fixed"}}><colgroup><col style={{width:"25%"}} /><col style={{width:"12%"}} /><col style={{width:"63%"}} /></colgroup><tbody><tr><td><p><strong>Name</strong></p></td><td><p><strong>Required</strong></p></td><td><p><strong>Description</strong></p></td></tr><tr><td><p><code>\<stationUrl></code></p></td><td><p>Yes</p></td><td><p>The address of the Scanning Station to be accessed by the third-party system. The default value is <code>\<serverName>/FlexiCapture12/Scanning</code>.</p></td></tr><tr><td><p><code>WinAuth</code></p></td><td><p>Yes</p></td><td><p>Windows authentication parameter.</p></td></tr><tr><td><p><code>GetRescan</code></p></td><td><p>Yes</p></td><td><p>The name of the command that gets an existing rescanning task.</p><p><strong>Important! </strong>  If there is more than one task in the project, the alphabetically first task will be taken.</p></td></tr><tr><td><p><code>projectId</code></p></td><td><p>Yes</p></td><td><p>The ID of the project that contains the batch to be rescanned.</p></td></tr><tr><td><p><code>batchName </code></p></td><td><p>No</p></td><td><p>A new name for the batch. Use this parameter if you want to rename the batch to be rescanned.</p></td></tr><tr><td><p><code>regparam </code></p></td><td><p>No</p></td><td><p>A registration parameter in the format <code>name:value</code>. The <code>regparam</code> registration parameter must be specified in the settings of the <code>batchTypeName</code> batch type on the web station. Otherwise, this parameter will be ignored.</p><p><strong>Note: </strong>  You can pass more than one registration parameter by joining multiple parameters with the <code>&</code> symbol.</p></td></tr></tbody></table>

## Returning to the third-party system

When the user is finished working with the batch and exits the integrated Scanning Station, the `postMessage` method is used to pass the `FC_Scanning_TaskClosed` message to the parent element. The final page will open. The developer must direct the user from the final page back to the third-party system.

<Note>
  Use URL encoding if you need to pass non-English (e.g. Japanese) characters as parameter values in the URL.
</Note>
