Skip to content

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

post

/subscription/status/set

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

サブスクリプショングループの subscription_group_id にアクセスするには、サブスクリプショングループページに移動します。

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

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

前提条件

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

レート制限

このエンドポイントには、API レート制限に記載されているように、/subscription/status/set/v2/subscription/status/set エンドポイント間で共有される1分あたり5,000リクエストのレート制限があります。

リクエスト本文

1
2
Content-Type: application/json
Authorization: Bearer YOUR-REST-API-KEY
1
2
3
4
5
6
7
8
{
   "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),
   "use_double_opt_in_logic": (optional, boolean) defaults to `false`; when `subscription_state` is "subscribed", set to `true` to enter the user into the SMS double opt-in workflow,
   // SMS and RCS subscription group - you must include one of external_id or phone
 }

* SMS と RCS のサブスクリプショングループ: Braze は external_id または phone のみを受け付けます。

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

リクエストパラメーター

リクエスト例

メール

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 と RCS

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!