# JSONインポート

<figure><img src="https://859776093-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPL6k1aGsLiFiiJ3Y7zCl%2Fuploads%2Fon3e1QtWUuaOEQHpz3Nw%2Fimage.png?alt=media&#x26;token=3fac33f6-1060-437b-817b-03389ff6d5fb" alt=""><figcaption></figcaption></figure>

## JSONでのレコードのインポート

JSONインポートファイルには、レコード、フォルダ、サブフォルダ、共有フォルダ、デフォルトのフォルダ権限、ユーザー/チームの権限を含めることができます。KeeperPAMリソースの構成にJSONも使用できます。

以下は、2つのレコードを含むJSONインポートファイルです。最初のレコードが「My Websites\\\Online」というフォルダに追加されます。2番目のレコードが「Social Media」に追加され、「Shared Social」という共有フォルダにも追加されます。

以下のインポートファイルの例はレコードオブジェクトの配列で、これを使用して個人用フォルダや共有フォルダにデータをインポートできます。この例では、FacebookのレコードにはTOTPシードが含まれており、ボルトのユーザーインターフェースおよびコマンダーCLIで表示されます。

{% code overflow="wrap" lineNumbers="true" %}

```json
{
  "records": [{
    "title":"Google",
    "folders": [
      {
        "folder":"My Websites\\Online"
      }
    ],
    "login": "testing",
    "password": "lk4j139sk4j",
    "login_url": "https://google.com",
    "notes":"These are some notes.",
    "custom_fields": {"Favorite Food":"Cheetos"}
  },
  {
    "title":"Facebook",
    "folders": [
      {
        "folder":"Social Media"
      },
      {
        "shared_folder":"Shared Social",
        "can_edit": false,
        "can_share": false
      }
    ],
    "login": "me@gmail.com",
    "password":"123123123123",
    "login_url": "https://facebook.com",
    "notes":"This is our corporate shared record.",
    "custom_fields": {
      "Facebook Application ID":"ABC12345",
      "$oneTimeCode": "otpauth://totp/Amazon:me@company.com?secret=JBSWY3DPEHPK3PXP&issuer=Amazon&algorithm=SHA1&digits=6&period=30"}
  }]
}
```

{% endcode %}

以下の別の例では、まずユーザーとチームに共有される共有フォルダを作成し、その共有フォルダにレコードをインポートします。ファイルの形式は、以下のように少し異なり、共有フォルダオブジェクトとレコードの作成を分けることができます。

{% code overflow="wrap" lineNumbers="true" %}

```json
{
  "shared_folders": [
    {
      "path":"My Customer 1",
      "manage_users": true,
      "manage_records": true,
      "can_edit": true,
      "can_share": true,
      "permissions": [
        {
          "uid": "kVM96KGEoGxhskZoSTd_jw",
          "manage_users": true,
          "manage_records": true
        },
        {
          "name": "user@mycompany.com",
          "manage_users": true,
          "manage_records": true
        }
      ]
    },
    {
      "path":"Testing\\My Customer 2",
      "manage_users": true,
      "manage_records": true,
      "can_edit": true,
      "can_share": true,
      "permissions": [
        {
          "uid": "ih1CggiQ-3ENXcn4G0sl-g",
          "manage_users": true,
          "manage_records": true
        },
        {
          "name": "user@mycompany.com",
          "manage_users": true,
          "manage_records": true
        }
      ]
    }
  ],
  "records": [
    {
      "title":"Bank Account 1",
      "login": "customer1234",
      "password":"4813fJDHF4239fdk",
      "login_url": "https://chase.com",
      "notes":"These are some notes.",
      "custom_fields": {
        "Account Number":"123-456-789"
      },
      "folders": [
        {
          "folder":"Optional Private Folder 1"
        }
      ]
    },
    {
      "title":"Bank Account 2",
      "login": "mybankusername",
      "password": "w4k4k193f$^&@#*%2",
      "login_url": "https://amex.com",
      "notes":"Some great information here.",
      "custom_fields": {
        "Security Group":"Public",
        "IP Address":"12.45.67.8"
      },
      "folders": [
        {
          "folder":"Optional Private Folder 1"
        },
        {
          "shared_folder":"My Customer 1",
          "can_edit": true,
          "can_share": true
        }
      ]
    }
  ]
}
```

{% endcode %}

形式は厳密なJSON形式である必要があります。そうでない場合は解析に失敗します。このファイルをインポートするには以下を実行します。

```
import --format=json import.json
```

検出されたユーザーおよびチームの権限を適用するには、`--users` フラグを付けてコマンドをもう一度実行します。

```
import --format=json --users import.json
```

{% hint style="info" %}
`--users` フラグを指定すると、`apply-membership` コマンドと同様の方法で権限が適用されます。\
このフラグは、必要に応じて何度でも指定してコマンドを実行できます。
{% endhint %}

共有フォルダ、フォルダ権限、ユーザー権限、チーム権限をサポートする、より複雑なインポートファイルの例をsample\_data/フォルダにご用意しました。サンプルJSONファイルをボルトにインポートするには、以下のコマンドを入力します。

* 例1: [import.json.txt](https://github.com/Keeper-Security/Commander/blob/master/sample_data/import.json.txt)
* 例2: [import\_records\_existing\_folders.json.txt](https://github.com/Keeper-Security/Commander/blob/master/sample_data/import_records_existing_folders.json.txt)
* 例3: [import\_records\_into\_folders.json.txt](https://github.com/Keeper-Security/Commander/blob/master/sample_data/import_records_into_folders.json.txt)
* 例4: [import\_shared\_folders.json.txt](https://github.com/Keeper-Security/Commander/blob/master/sample_data/import_shared_folders.json.txt)
* 例5: [import\_shared\_folders\_and\_records.json.txt](https://github.com/Keeper-Security/Commander/blob/master/sample_data/import_shared_folders_and_records.json.txt)

```
import --format=json sample_data/import.json.txt
import --format=json --users sample_data/import.json.txt
```

サンプルファイルには、メールアドレスまたはチーム名が記載された「アクセス権限」オブジェクトが含まれています。Keeperエンタープライズアカウントにメールまたはチーム名が含まれる場合は、共有フォルダに追加されます。含まれない場合は、この情報は無視されます。

***

## JSON PAMリソースのインポート

Keeperコマンダーの `pam project import` 機能を使用すると、フォルダ、ゲートウェイ、マシン、ユーザー、接続、トンネル、さらに必要に応じてローテーションといったPAMリソースの作成を自動化できます。

詳しくは、[pam project importコマンド](https://github.com/Keeper-Security/gitbook-jp-secrets-manager/blob/main/commander-cli/keeperpam-commands/README.md#sub-command-project)をご参照ください。

### JSONインポートのドキュメント

サーバーホスト名の基本リストからWindowsサーバーをPAMリソースとしてインポートする手順については、[PAMリソースのインポート](/keeperpam/jp/privileged-access-manager/references/importing-pam-resources.md)のページをご覧ください。

`pam project import` テンプレートのより詳細な仕様については、こちらの[GitHub READMEページ](https://github.com/Keeper-Security/Commander/blob/master/keepercommander/commands/pam_import/README.md)をご覧ください。

ご不明な点がございましたら、Keeperコマンダーサポートチーム (<commander@keepersecurity.com>) までお問い合わせください。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.keeper.io/keeperpam/jp/commander-cli/command-reference/import-and-export-commands/json-import.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
