# Bitwarden .csvまたは.jsonを条件付けします。

この記事では、Bitwardenにインポートするために`.csv`または`.json`を手動で調整する際に使用すべきフォーマットを定義しています。このフォーマットは、`.csv`または`.json`ファイルと同じで、これらのファイルは[Bitwardenの保管庫をエクスポートすることで作成されます](https://bitwarden.com/ja-jp/help/export-your-data/)。

あなたが自分の保管庫にデータをインポートしているのか、組織の保管庫にインポートしているのかによって、正しい形式を使用していることを確認してください。

## .csvを条件付けする

> [!TIP] CSV vs. JSON for Import
> Bitwarden `.csv` ファイルはログインとセキュアメモのみを処理します。IDやカードもインポートまたはエクスポートする必要がある場合は、[JSONを使用してください](https://bitwarden.com/ja-jp/help/condition-bitwarden-import/#condition-a-json/)。

### あなたの個人用保管庫のために

次のヘッダーをファイルの最初の行として含むUTF-8エンコードのプレーンテキストファイルを作成します：

```
folder,favorite,type,name,notes,fields,reprompt,login_uri,login_username,login_password,login_totp
```

例えば：

```
folder,favorite,type,name,notes,fields,reprompt,login_uri,login_username,login_password,login_totp
Social,1,login,Twitter,,,0,twitter.com,me@example.com,password123,
,,login,EVGA,,,,https://www.evga.com/support/login.asp,hello@bitwarden.com,fakepassword,TOTPSEED123
,,login,My Bank,Bank PIN is 1234,"PIN: 1234",,https://www.wellsfargo.com/home.jhtml,john.smith,password123456,
,,note,My Note,"This is a secure note.",,,,,
```

このファイルをインポートするときは、ファイル形式として**Bitwarden (csv)**を選択してください。

⬇️ タイプ：アセット-ハイパーリンク ID：4j3wYIYVQYW2MZUBogVxM3 

### あなたの組織のために

次のヘッダーをファイルの最初の行として含むUTF-8エンコードのプレーンテキストファイルを作成します：

```
collections,type,name,notes,fields,reprompt,login_uri,login_username,login_password,login_totp
```

例えば、

```
collections,type,name,notes,fields,reprompt,login_uri,login_username,login_password,login_totp
"Social,Marketing",login,Twitter,,,0,twitter.com,me@example.com,password123,
"Finance",login,My Bank,"Bank PIN is 1234","PIN: 1234",0,https://www.wellsfargo.com/home.jhtml,john.smith,password123456,
"Finance",login,EVGA,,,0,https://www.evga.com/support/login.asp,hello@bitwarden.com,fakepassword,TOTPSEED123
"Finance",note,My Note,"This is a secure note.",,0,,,
```

このファイルをインポートするときは、ファイル形式として**Bitwarden (csv)**を選択してください。

⬇️ タイプ: アセット-ハイパーリンク id: YYnGrBJO8O5Xv2O0dFW9Z

### 最小必要値

上記の形式で表示されるすべての値に対してデータがあるわけではないかもしれませんが、ほとんどはオプションです。Bitwarden `.csv` インポーターが正しく機能するためには、任意のオブジェクトに対して次の値を持つだけで十分です：

```
folder,favorite,type,name,notes,fields,reprompt,login_uri,login_username,login_password,login_totp
,,login,Login Name,,,,,,
,,note,Secure Note Name,,,,,,
```

## .jsonを条件付けする

### あなたの個人的な保管庫のために

次の形式でUTF-8エンコードされたプレーンテキストファイルを作成します：

```
{
 "folders": [
 {
 "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
 "name": "Folder Name"
 },
 ],
 "items": [
 {
 "passwordHistory": [
 {
 "lastUsedDate": "YYYY-MM-00T00:00:00.000Z",
 "password": "passwordValue"
 }
 ],
 "id": "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy",
 "organizationId": null,
 "folderId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
 "type": 1,
 "reprompt": 0,
 "name": "My Gmail Login",
 "notes": "This is my gmail login for import.",
 "favorite": false,
 "fields": [
 {
 "name": "custom-field-1",
 "value": "custom-field-value",
 "type": 0
 },
 ],
 "login": {
 "uris": [
 {
 "match": null,
 "uri": "https://mail.google.com"
 }
 ],
 "username": "myaccount@gmail.com",
 "password": "myaccountpassword",
 "totp": "otpauth://totp/my-secret-key"
 },
 "collectionIds": null
 },
 ]
}
```

このファイルをインポートするときは、ファイル形式として**Bitwarden (json)**を選択してください。

⬇️ タイプ：アセット-ハイパーリンク ID：2iwtn9YFqooYJmw1JWwCXa

### あなたの組織のために

次の形式でUTF-8エンコードされたプレーンテキストファイルを作成します:

```
{
 "collections": [
 {
 "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
 "organizationId": "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy",
 "name": "My Collection",
 "externalId": null
 },
 ],
 "items": [
 {
 "passwordHistory": [
 {
 "lastUsedDate": "YYYY-MM-00T00:00:00.000Z",
 "password": "passwordValue"
 }
 ],
 "id": "vvvvvvvv-vvvv-vvvv-vvvv-vvvvvvvvvvvv",
 "organizationId": "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy",
 "folderId": "zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz",
 "type": 1,
 "reprompt": 1,
 "name": "Our Shared Login",
 "notes": "A login for sharing",
 "favorite": false,
 "fields": [
 {
 "name": "custom-field-1",
 "value": "custom-field-value",
 "type": 0
 },
 ],
 "login": {
 "uris": [
 {
 "match": null,
 "uri": "https://mail.google.com"
 }
 ],
 "username": "myaccount@gmail.com",
 "password": "myaccountpassword",
 "totp": "otpauth://totp/my-secret-key"
 },
 "collectionIds": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
 },
 ]
}
```

このファイルをインポートするときは、ファイル形式として**Bitwarden (json)**を選択してください。

⬇️ タイプ: アセット-ハイパーリンク id: 2Pui1E5uLs2FSw6GhO6pdU

### 既存のコレクションへのインポート

組織を調整することによって。 `json`ファイルを適切に編集すると、新しいログイン項目を既存の[コレクション](https://bitwarden.com/ja-jp/help/about-collections/)にインポートできます。

次の例は、既存のコレクションに単一のアイテムをインポートするための適切な形式を示しています。次のことにメモしてください：

- 組織とコレクションのIDを取得します。これらは、ウェブアプリのコレクションに移動し、アドレスバーから引き出すことで取得できます（例：`https://vault.bitwarden.com/#/organizations//保管庫?collectionId=`）。
- 上記を参照して、組織とコレクションのID、およびその名前を含む既存のコレクションのデータを含む`"コレクション": []`配列を定義します。これら3つのデータポイントが一致する限り、インポート時に新しいコレクションは作成されず、代わりにファイル内のアイテムが既存のコレクションにインポートされます。

```
{
 "encrypted": false,
 "collections": [
 {
 "id": "b8e6df17-5143-495e-92b2-aff700f48ecd",
 "organizationId": "55d8fa8c-32bb-47d7-a789-af8710f5eb99",
 "name": "My Existing Collection",
 "externalId": null
 }
 ],
 "folders": [],
 "items": [
 {
 "id": "2f27f8f8-c980-47f4-829a-aff801415845",
 "organizationId": "55d8fa8c-32bb-47d7-a789-af8710f5eb99",
 "folderId": null,
 "type": 1,
 "reprompt": 0,
 "name": "Item to Import",
 "notes": "A login item for sharing.",
 "favorite": false,
 "login": {
 "uris": [
 {
 "match": null,
 "uri": "https://mail.google.com"
 }
 ],
 "username": "my_username",
 "password": "my_password",
 "totp": null
 },
 "collectionIds": ["b8e6df17-5143-495e-92b2-aff700f48ecd"]
 }
 ]
}
```

### 最小限必要なキー・バリューペア

上記の形式で示されるキー値ペアすべてにデータがあるわけではないかもしれませんが、ほとんどはオプションです。Bitwarden `.json` インポーターが正しく機能するためには、各オブジェクトに対して次のキー値ペアを持つだけで十分です：

```
{
 "items": [
 {
 "type": 1,
 "name": "Login Item's Name",
 "login": {} 
 },
 {
 "type": 2,
 "name": "Secure Note Item's Name",
 "secureNote": {} 
 },
 {
 "type": 3,
 "name": "Card Item's Name",
 "card": {} 
 },
 {
 "type": 4,
 "name": "Identity Item's Name",
 "identity": {} 
 }
 ]
}
```

`"ログイン":`、`"secureNote":`、`"カード":`、そして`"ID":`のオブジェクトは空のオブジェクトとしてインポートすることができますが、可能な限り多くのデータでファイルを条件付けすることをお勧めします。