> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# ユーザーデータをMarketoにエクスポートする

> Auth0のユーザーデータをエクスポートして、Adobe Marketo Engageにインポートする方法を説明します。

この記事では、Auth0 のユーザーデータを CSV ファイルにエクスポートし、Marketo REST API の [Bulk Leads endpoint](https://developer.adobe.com/marketo-apis/api/mapi#tag/Bulk-Import-Leads) を使って Marketo にインポートする方法を説明します。

## ユーザーデータファイルを作成する

まず、Auth0 Dashboard の [Extensions](https://manage.auth0.com/#/extensions) セクションに移動し、**User Import / Export Extension** を開きます。Extension ページで、メニューから **Export** を選択します。

次に、**Export Format** を必要なファイル形式に設定します。Marketo は CSV 形式でのファイルのインポートに対応しているため、`Tab Separated Value file (*.csv)` オプションを選択します。

上部の **Fields** セクションで、エクスポートに含める各ユーザー属性に対して **User Field** と **Column Name** を指定します。例:

| User Field | Column Name |
| - | - |
| `email` | メールアドレス |
| `created_at` | 作成日時 |
| `given_name` | 名 |
| `family_name` | 姓 |

ユーザーフィールドを追加したら、**Export Users** ボタンをクリックしてエクスポートを開始します。エクスポートが完了したら、次のセクションで使用する CSV ファイルをダウンロードします。

### ユーザーデータファイルをインポートする

開始する前に、詳細については [Marketo Documentation: Bulk Lead Import](https://experienceleague.adobe.com/en/docs/marketo-developer/marketo/rest/bulk-import/bulk-lead-import) を参照してください。

ユーザーデータファイルを Marketo にインポートするには、[Bulk Leads endpoint](https://developer.adobe.com/marketo-apis/api/mapi#operation/importLeadUsingPOST) に対して POST リクエストを送信します。リクエストの content-type ヘッダーを `multipart/form-data` に設定し、エクスポートした CSV ファイルを含む `file` パラメータと、`csv` に設定した format パラメータを含めます。例:

レスポンスは次のようになります。

```json lines theme={null}
{
    "requestId": "e42b#14272d07d78",
    "success": true,
    "result": [{
        "batchId": 1234,
        "status": "Importing"
    }]
}
```

[Get Import Lead Status API](https://developer.adobe.com/marketo-apis/api/mapi#operation/getImportLeadStatusUsingGET) とインポート job の `batchId` を使用して、インポートのステータスを確認できます。例:

レスポンスは次のとおりです。

```json lines theme={null}
{
    "requestId": "8136#146daebc2ed",
    "success": true,
    "result": [{
        "batchId": 1234,
        "status": "Complete",
        "numOfLeadsProcessed": 123,
        "numOfRowsFailed": 0,
        "numOfRowsWithWarning": 0
    }]
}
```

これで完了です！Auth0 のユーザーを Marketo に正常にインポートできました。
