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

# CreateUser

> ABBYY FlexiCapture ユーザー管理 API の CreateUser メソッドは、name、パスワード ハッシュ、email、tenant を基にユーザーを作成し、新しい user ID を返します。

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

新しいユーザーを作成します。

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

```
int CreateUser( string userName, string fullName, string password, string email, string tenantName );
```

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

| **Name**   | **型**  | **説明**          |
| ---------- | ------ | --------------- |
| userName   | string | ユーザー名           |
| fullName   | string | ユーザーのフルネーム      |
| password   | string | ユーザーのパスワード ハッシュ |
| email      | string | ユーザーのメールアドレス    |
| tenantName | string | テナント名           |

パスワード ハッシュを計算するコード例:

```
public static string GetPasswordHashWithSalt( string login, string password )
        {
            string salt = GetPasswordSha256Hash(login.ToUpper());
            return GetPasswordSha256Hash(password + salt);
        }
        private static string GetPasswordSha256Hash( string password )
        {
            Encoding enc = Encoding.GetEncoding("UTF-16");
            byte[] buffer = enc.GetBytes(password);
            var cryptoTransformSHA256 = new SHA256CryptoServiceProvider();
            string hash = BitConverter.ToString(cryptoTransformSHA256.ComputeHash(buffer)).Replace("-", "");
            return hash;
        }
```

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

| **型** | **説明**  |
| ----- | ------- |
| int   | user ID |

<Note>
  パスワードが正しく暗号化されているかを確認するための T-SQL コード:
</Note>

```
Select Convert( nvarchar(255), HASHBYTES( 'SHA2_256', N'myPassword' + Convert( nvarchar(64), HASHBYTES('SHA2_256', UPPER(name) ), 2) ), 2)
```
