Skip to content

사용자의 구독 그룹 상태 업데이트(V2)

post

/v2/subscription/status/set

이 엔드포인트를 사용하여 Braze 대시보드에서 최대 50명의 사용자의 구독 상태를 일괄 업데이트할 수 있습니다.

You can access a subscription group’s subscription_group_id by navigating to the Subscription Group page.

예제나 이메일 구독 그룹에 대한 이 엔드포인트를 테스트하려면:

예제나 SMS 구독 그룹에 대한 이 엔드포인트를 테스트하려면:

예제나 WhatsApp 그룹에 대한 이 엔드포인트를 테스트하려면:

필수 조건

이 엔드포인트를 사용하려면 API 키subscription.status.set 권한이 필요합니다.

V1과의 차이점

V2 엔드포인트는 다음과 같은 방식으로 V1 엔드포인트와 다릅니다:

  • 여러 구독 그룹: V2는 단일 API 요청으로 여러 구독 그룹을 업데이트할 수 있도록 하며, V1은 요청당 하나의 구독 그룹만 지원합니다.
  • 이메일과 SMS를 한 번의 호출로 업데이트: external_ids를 사용할 때, 동일한 사용자에 대해 이메일 및 SMS 구독 그룹을 단일 API 호출로 업데이트할 수 있습니다. V1에서는 이메일 및 SMS 구독 그룹에 대해 별도의 API 호출을 해야 합니다.
  • 이메일 또는 전화 식별자 사용: external_ids 대신 emails 또는 phones을 사용하면 동일한 요청에서 이메일 및 SMS 구독 그룹을 업데이트할 수 없습니다. 이메일 구독 그룹과 SMS 구독 그룹 각각에 대해 별도의 API 호출을 해야 합니다.

사용량 제한

이 엔드포인트는 API 속도 제한 설명서에 명시된 바와 같이 및/v2/subscription/status/set /subscription/status/set엔드포인트 간에 공유되는 분당 5,000개의 요청 속도 제한을 적용받습니다.

Request body

1
2
Content-Type: application/json
Authorization: Bearer YOUR-REST-API-KEY
1
2
3
4
5
6
7
8
9
10
11
{
  "subscription_groups":[
    {
      "subscription_group_id": (required, string),
      "subscription_state": (required, string)
      "external_ids": (required*, array of strings),
      "emails": (required*, array of strings),
      "phones": (required*, array of strings in E.164 format),
    }
  ]
}

요청 매개변수

요청 예시

다음 예제는 단일 API 호출로 이메일 및 SMS 구독 그룹을 업데이트하기 위해 external_ids을 사용합니다. 이는 external_ids를 사용할 때만 가능하며, emails 또는 phones를 사용할 때는 이메일 및 SMS 구독 그룹을 한 번의 호출로 업데이트할 수 없습니다.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
curl --location --request POST 'https://rest.iad-01.braze.com/v2/subscription/status/set' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR-REST-API-KEY' \
--data-raw '{
  "subscription_groups":[
    {
      "subscription_group_id":"subscription_group_identifier",
      "subscription_state":"subscribed",
      "external_ids":["example-user","[email protected]"]
    },
    {
      "subscription_group_id":"subscription_group_identifier",
      "subscription_state":"subscribed",
      "external_ids":["example-user","[email protected]"]
    }
  ]
}

Email

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

SMS 및 WhatsApp

1
2
3
4
5
6
7
8
9
10
11
12
13
curl --location --request POST 'https://rest.iad-01.braze.com/v2/subscription/status/set' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR-REST-API-KEY' \
--data-raw '{
  "subscription_groups":[
    {
      "subscription_group_id":"subscription_group_identifier",
      "subscription_state":"subscribed",
      "phones":["+12223334444","+15556667777"]
    }
  ]
}
'
New Stuff!