Skip to content

ユーザーのサブスクリプショングループのステータスを更新

post

/subscription/status/set

このエンドポイントを使用して、Braze ダッシュボードで最大 50 人のユーザーのサブスクリプション状態を一括更新します。

サブスクリプショングループページに移動すると、サブスクリプショングループにアクセスできますsubscription_group_id

メール購読グループの例を確認したり、このエンドポイントをテストしたりするには:

SMS サブスクリプショングループの例を確認したり、このエンドポイントをテストしたりするには:

前提条件

このエンドポイントを使用するには、subscription.status.set権限のある API キーが必要です

レート制限

For customers who onboarded with Braze on or after January 6, 2022, we apply a rate limit of 5,000 requests per minute shared across the /subscription/status/set and /v2/subscription/status/set endpoint as documented in API rate limits.

リクエスト本文

1
2
Content-Type: application/json
Authorization: Bearer YOUR-REST-API-KEY
1
2
3
4
5
6
7
{
   "subscription_group_id": (required, string) the id of your subscription group,
   "subscription_state": (required, string) available values are "unsubscribed" (not in subscription group) or "subscribed" (in subscription group),
   "external_id": (required*, array of strings) the external ID of the user or users, may include up to 50 IDs,
   "phone": (required*, array of strings in E.164 format) The phone number of the user (must include at least one phone number and at most 50 phone numbers),
   // SMS subscription group - one of external_id or phone is required
 }

SMS サブスクリプショングループexternal_idphoneまたはのみ受け付けます。

このプロパティは、ユーザーのプロファイル情報の更新には使用しないでください。/users/track代わりにプロパティを使用してください。

リクエストパラメーター

パラメーター 必須 データ型 説明
subscription_group_id 必須 文字列 id サブスクリプショングループの。
subscription_state 必須 文字列 使用可能な値は unsubscribed (サブスクリプショングループ以外) または subscribed (サブスクリプショングループ内)。
external_id 必須* 文字列の配列 1 external_id 人または複数のユーザーの、最大 50 id 秒まで含めることができます。
email Required* 文字列または文字列の配列 ユーザーの電子メールアドレスは、文字列の配列として渡すことができます。少なくとも 1 つの電子メールアドレス (最大 50) を含める必要があります。

同じワークスペースの複数のユーザー (external_id) が同じメールアドレスを共有している場合、そのメールアドレスを共有するすべてのユーザーは、サブスクリプショングループの変更に応じて更新されます。
phone 必須* E.164形式の文字列 ユーザーの電話番号は、文字列の配列として渡すことができます。少なくとも 1 つの電話番号 (最大 50) を含める必要があります。

リクエスト例

メール

1
2
3
4
5
6
7
8
9
10
curl --location --request POST 'https://rest.iad-01.braze.com/subscription/status/set' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR-REST-API-KEY' \
--data-raw '{
  "subscription_group_id": "subscription_group_identifier",
  "subscription_state": "unsubscribed",
  "external_id": "external_identifier",
  "email": ["[email protected]", "[email protected]"]
}
'

SMS

1
2
3
4
5
6
7
8
9
10
curl --location --request POST 'https://rest.iad-01.braze.com/subscription/status/set' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR-REST-API-KEY' \
--data-raw '{
  "subscription_group_id": "subscription_group_identifier",
  "subscription_state": "unsubscribed",
  "external_id": "external_identifier",
  "phone": ["+12223334444", "+11112223333"]
}
'

成功レスポンスの例

201ステータスコードは次のレスポンスボディを返す可能性があります。

1
2
3
{
    "message": "success"
}
「このページはどの程度役に立ちましたか?」
New Stuff!