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

# OpenSessionEx

> Open a connection to the FlexiCapture Application Server with the OpenSessionEx Web Services API method.

## What it does

Opens a connection to the Application Server. This method replaces the [OpenSession](/flexi-capture/api/methods/open-session) method from the previous versions of the Web Services API.

## Definition

```csharp theme={null}
int OpenSessionEx(int roleType, int stationType);
```

## Parameters

| Name          | Type  | Description                                                                                                                    |
| ------------- | ----- | ------------------------------------------------------------------------------------------------------------------------------ |
| `roleType`    | `int` | The type of role to be used for the connection. See [RoleType](/flexi-capture/api/structures/t-role-type) for possible values. |
| `stationType` | `int` | The type of connecting station. See [WorkstationType](/flexi-capture/api/structures/t-workstation-type) for possible values.   |

## Returned value

| Type  | Description                             |
| ----- | --------------------------------------- |
| `int` | The ID of the currently open connection |
