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

# Content API を使用したコンテンツのパーソナライズ

> MoEngage の Content API を使用して、各キャンペーンの送信時に商品レコメンデーション、クーポン、パーソナライズされたデータを動的に取得します。

# 概要

Content API を使用すると、レコメンデーション、クーポン、その他のパーソナライゼーション API に基づいてキャンペーン送信時にデータを動的に取得し、パーソナライズされたキャンペーンを作成できます。このようにターゲットを絞った、関連性の高いタイムリーなコミュニケーションは、一般的なメールキャンペーンよりも[エンゲージメントとコンバージョン率がはるかに高く](https://www.moengage.com/blog/power-of-push-notifications/ "https://www.moengage.com/blog/power-of-push-notifications/")なります。

> [!TIP]
>
> Content API の利用を開始する前に、MoEngage に Content API を追加する必要があります。詳細については、[Content API](https://moengage.com/docs/ja/user-guide/campaigns-and-channels/getting-started/campaign-content/content-apis.md) を参照してください。

MoEngage に API を追加した後は、コンテンツに API 呼び出しを埋め込んだ既存のコンテンツテンプレートを使用してキャンペーンを作成できます。これらのキャンペーンには、必要な書式、セグメンテーション、トリガースケジュールとともに、さまざまな SKU のプレースホルダーを含めることができます。

# Content API を使用したパーソナライゼーションをサポートするチャネル

次のチャネルを使用して送信されるキャンペーンに Content API を追加できます。

| チャネル | パーソナライゼーションのサポート |
| - | - |
| [Push(モバイルプッシュと Web プッシュ)](https://moengage.com/docs/ja/user-guide/campaigns-and-channels/mobile-push/create/personalize-push-campaigns.md) | Yes |
| [Email](https://moengage.com/docs/ja/user-guide/campaigns-and-channels/email/create/personalize-email-content.md) | Yes |
| [SMS](https://moengage.com/docs/ja/user-guide/campaigns-and-channels/sms-mms-and-rcs/sms/personalize-sms-campaign.md) | Yes |
| [In-app Messaging](https://moengage.com/docs/ja/user-guide/campaigns-and-channels/in-app-message/create/create-in-app-campaign.md) | Yes |
| [On-Site Messaging](https://moengage.com/docs/ja/user-guide/campaigns-and-channels/on-site-message/create/personalization-of-osm-content.md) | Yes |
| Cards | No |
| [WhatsApp](https://moengage.com/docs/ja/user-guide/campaigns-and-channels/whatsapp/create/personalize-whatsapp-campaign.md) | Yes |
| [Connectors](https://moengage.com/docs/ja/user-guide/campaigns-and-channels/connectors/create/create-a-connector-campaign.md) | Yes |
| Facebook Audience | No |
| Google Ads Audience | No |

> [!NOTE]
>
> ユーザープロパティを使用して Content API をパーソナライズできます。イベントが同じキャンペーンにリンクされている場合は、イベントプロパティを使用したパーソナライゼーションも可能です。

# Content API を使用したパーソナライズ

Content API を使用してコンテンツをパーソナライズするには、次の手順を実行する必要があります。

1. [MoEngage への Content API の追加](https://moengage.com/docs/ja/user-guide/campaigns-and-channels/getting-started/message-personalization/personalize-content-using-content-apis.md#add-content-api-to-moengage)
2. [Content API を使用したパーソナライズされたキャンペーンの作成](https://moengage.com/docs/ja/user-guide/campaigns-and-channels/getting-started/message-personalization/personalize-content-using-content-apis.md#create-a-personalized-campaign)

## MoEngage への Content API の追加

MoEngage キャンペーン用に Content API を設定するには、次の手順を実行します。

![Screenshot 2025-07-23 at 11.51.38 AM.png](https://mintcdn.com/moengage/VqQHPleQ9qk_ZsLR/images/moengage_52fce1.png?fit=max\&auto=format\&n=VqQHPleQ9qk_ZsLR\&q=85\&s=2cc0048ada724e3089f344afed426af0)

1. MoEngage で **Dashboard** > **Settings** > **APIs** に移動し、**Content API** タブをクリックします。
2. **Add** をクリックします。
3. **Add Content API** ページで、次の詳細を入力します。

   | フィールド | 説明 |
   | - | - |
   | **API Name** | Content API の名前を入力します |
   | **API Type** | タイプとして *Single* を選択します。 |
   | **API URL** | Content API の完全な URL を入力します。 |
   | **Header** | プラス記号をクリックし、Content API で使用するヘッダーのキーと値を入力します |
   | **Key Value Parameters** | プラス記号をクリックして、Content API で使用するパラメーターのキーと値を追加します。値フィールドで "@" を使用すると、定義済みのユーザープロパティのリストから選択できます。値フィールドでイベントプロパティを使用してパラメーターをパーソナライズすることはできません。 |
4. **Save** をクリックします。

## パーソナライズされたキャンペーンの作成

MoEngage に Content API を追加した後は、Content API を使用してパーソナライズされたキャンペーンを作成できます。

キャンペーン作成のステップ 2 の "Content" で、*ContentApi* 変数を使用して、設定済みのすべての Content API ソースにアクセスします。Content API は、コード内で *ContentApi* 変数を直接呼び出すか、パーソナライゼーションエディターから必要な Content API を選択することで使用できます。

1. キャンペーンのコンテンツエディターで *@* と入力します。
2. Personalization ダイアログボックスで、**Data personalization** タブをクリックします。
3. **Select attribute** リストで、作成した Content API をクリックします。

   ![Email\_ContentAPI.png](https://mintcdn.com/moengage/fUSb9kG75-iJ0JuL/images/moengage_e3d08d.png?fit=max\&auto=format\&n=fUSb9kG75-iJ0JuL\&q=85\&s=d87818731220c31a3acbe2ee7e0a5b8e)
4. **Done** をクリックします。Content API がメッセージに追加されます。\
   たとえば、次のスクリーンショットでは、Content API が指定されたユーザー ID のおすすめ商品を動的に取得しています。この機能を使用して、商品レコメンデーションでユーザーのエンゲージメントを高め、購入を促すことができます。value パラメーターには、動的パラメーター(@ と入力して Content API に渡すユーザープロパティを追加)または value セクションに入力できる静的パラメーターを指定できます。

   ![ContentAPI\_RecoPdt\_EmailPersonlizationUI.png](https://mintcdn.com/moengage/wIFGWsQFEjsz2j4v/images/moengage_e088b3.png?fit=max\&auto=format\&n=wIFGWsQFEjsz2j4v\&q=85\&s=3da41426652d55a6d80b504f06e72373)

   追加すると、Template editor に次のように表示されます。

   ![ContentAPI\_added\_in\_Email\_Editor.png](https://mintcdn.com/moengage/P9B7WlDoMUnquME5/images/moengage_0cb9aa.png?fit=max\&auto=format\&n=P9B7WlDoMUnquME5\&q=85\&s=704898c2ca354fb2ee6f8c26a706682e)
5. **Preview** をクリックして、ユーザーの受信トレイでどのように表示されるかを確認します。

### 例 1

次の JSON を持つ *cart* データソースがあるとします。

```json JSON wrap theme={null}
{
"date": "March 10, 2016",
"items": [
{
"name": "belt",
"image": "http://mydomain.com/images/1001.jpg",
"price": 11
}, {
"name": "shoes",
"image": "http://mydomain.com/images/1002.jpg",
"price": 12
}, {
"name": "hat",
"image": "http://mydomain.com/images/1003.jpg",
"price": 10
}
]
}
```

コンテンツ作成では、次のコードを使用します。

```text Code wrap theme={null}
{% for cart_item in ContentApi.cart().items %}

## {{ cart_item.name }}: ${{ cart_item.price|round(2) }}

__PROTECTED_6__

{% endfor %}
```

### 例 2

キャンペーンには、必要な書式、セグメンテーション、トリガースケジュールとともに、さまざまな SKU(この場合はホテル)のプレースホルダーが含まれています。

![SavedContentAPI.png](https://mintcdn.com/moengage/-uVFLyK4XoHTd5WE/images/moengage_1445a9.png?fit=max\&auto=format\&n=-uVFLyK4XoHTd5WE\&q=85\&s=33fa5cb0651c1e4ab6b1f60a5b61523d)

キャンペーンの送信時に、システムは次の処理を行います。

* Content API を呼び出し、目的地、チェックイン日とチェックアウト日、大人と子どもの人数などの検索パラメーターに基づいて、ユーザーにおすすめのホテルを取得します。
* 名前、評価、価格、画像、ランキングなどのおすすめホテルの詳細を、HTML 形式のパーソナライズされたメールでキャンペーンに入力します。
* 手動入力なしで、指定されたセグメントに属するすべてのユーザーに対してこれを動的に行います。

![DynamicContentExample.png](https://mintcdn.com/moengage/2CGhjk8ZDWEC5ocb/images/moengage_f751ff.png?fit=max\&auto=format\&n=2CGhjk8ZDWEC5ocb\&q=85\&s=4803462fc6106403a59e7c63e9e3a7e0)

パーソナライゼーション言語の詳細については、[テンプレート言語のドキュメント](https://moengage.com/docs/ja/user-guide/campaigns-and-channels/getting-started/message-personalization/jinja-templating-language.md "/user-guide/campaigns-and-channels/getting-started/message-personalization/jinja-templating-language")を参照してください。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.