受信者オブジェクト
受信者オブジェクトを使用すると、エンドポイントで情報をリクエストしたり書き込んだりできます。
このオブジェクトには、external_user_id、user_alias、braze_id、または email のいずれかを含める必要があります。リクエストでは1つだけ指定してください。
受信者オブジェクトを使用すると、ユーザーエイリアスオブジェクト、トリガープロパティオブジェクト、キャンバスエントリプロパティオブジェクト、およびユーザー属性オブジェクトを組み合わせることができます。
オブジェクト本体
1
2
3
4
5
6
7
8
9
10
11
[{
"user_alias": (optional, User Alias Object) User alias of user to receive message,
"external_user_id": (optional, string) see External user ID,
"braze_id": (optional, string) see Braze ID,
"email": (optional, string) email address of user to receive message,
"prioritization": (optional, array) see Prioritization; required when using email,
"trigger_properties": (optional, object) personalization key-value pairs for this user when sending a campaign or message; see Trigger Properties,
"context": (optional, object) personalization key-value pairs for this user when triggering a Canvas; see Canvas context object,
"send_to_existing_only": (optional, boolean) defaults to true; cannot be used with user aliases; if set to `false`, an `attributes` object must also be included,
"attributes": (optional, object) fields in the attributes object create or update an attribute of that name with the given value on the specified user profile before the message is sent and existing values are overwritten
}]
send_to_existing_only が true の場合、Brazeは既存のユーザーにのみメッセージを送信します。ただし、このフラグをユーザーエイリアスと併用することはできません。
send_to_existing_only が false の場合、同じ受信者に attributes オブジェクトを含める必要があります。このフラグは attributes の代わりにはなりません。Brazeは attributes を使用して、送信前のプロファイル作成または更新を行います(例えば、メールや SMS 配信のために email や電話フィールドを追加したり、購読グループを更新したりします)。このオブジェクトがない場合、/campaigns/trigger/send や /canvas/trigger/send で新規ユーザーに対する意図した複合動作を得ることはできません。
Brazeが送信する前に、そのプロファイルはメッセージのオーディエンスおよびチャネルの適格性ルールを満たしている必要があります。
受信者オブジェクトの重複排除
受信者オブジェクトを使用してAPI呼び出しを行う場合、同じアドレス(つまり、メール、プッシュ)をターゲットとする重複した受信者が存在すると、Brazeはユーザーの重複を排除します。これは、Brazeが同一のユーザーを削除し、1人だけを残すことを意味します。
たとえば、同じexternal_user_idを使用した場合、そのユーザーはメッセージを1通のみ受信します。この動作の回避策が必要な場合は、複数のAPI呼び出しを行うことを検討してください。
同じexternal_user_idが受信者配列に複数回含まれている場合、Brazeはメッセージを1通のみ送信し、配列内の最後の出現のトリガープロパティを使用します。この動作は決定論的であり、配列の順序に基づいています。
以下の例では、userid1は"name": "Beth Test 2"を使用したメッセージを1通受信します。これは、そのエントリが配列の最後に記載されているためです。
1
2
3
4
{"campaign_id":"#####","recipients":[
{"external_user_id":"userid1","trigger_properties":{"name":"Beth Test 1"}},
{"external_user_id":"userid1","trigger_properties":{"name":"Beth Test 2"}}
]}