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

# OpenSession

> ABBYY FlexiCapture Web Services API の OpenSession メソッドは、有効なロールとステーション タイプに対して Application Server への接続を開き、セッション ID を返します。

<div id="what-it-does">
  ## 機能
</div>

Application Server への接続を開きます。

<Note>
  有効な roleType と stationType の組み合わせを指定する必要があります (つまり、あるロールに対して指定するステーションは、そのロールからアクセスできるものでなければなりません) 。そうしないと、セッションは開かれません。ロールとアクセス可能なステーションの詳細については、[ABBYY FlexiCapture のオペレーター](/ja/flexi-capture/brief/operator-overview) を参照してください。
</Note>

<div id="definition">
  ## 定義
</div>

```
int OpenSession( int roleType, int stationType );
```

<div id="parameters">
  ## パラメーター
</div>

| **名前**      | **型** | **説明**                                                                                                    |
| ----------- | ----- | --------------------------------------------------------------------------------------------------------- |
| roleType    | int   | Connection に使用するロールの型。指定可能な値については、[RoleType](/ja/flexi-capture/api/structures/t-role-type)を参照してください。      |
| stationType | int   | 接続するステーションの型。指定可能な値については、[WorkstationType](/ja/flexi-capture/api/structures/t-workstation-type)を参照してください。 |

<div id="returned-value">
  ## 戻り値
</div>

| **型** | **説明**   |
| ----- | -------- |
| int   | 開いた接続のID |
