Skip to content

API 트리거 Campaign 예약하기

post

/campaigns/trigger/schedule/create

이 엔드포인트를 사용하면 대시보드에서 생성한 Campaign 메시지를 API 트리거 전달을 통해 전송할 수 있으며, 메시지 전송을 트리거할 동작을 결정할 수 있습니다.

메시지 자체에 템플릿으로 적용될 trigger_properties를 전달할 수 있습니다.

이 엔드포인트로 메시지를 보내려면 API 트리거 Campaign을 구축할 때 생성한 Campaign ID가 있어야 합니다.

필수 조건

이 엔드포인트를 사용하려면 campaigns.trigger.schedule.create 권한이 있는 API 키가 필요합니다.

사용량 제한

요청에서 Connected 오디언스 필터를 사용하는 경우, 이 엔드포인트에 분당 250건의 요청 제한이 적용됩니다. 그렇지 않은 경우 external_id를 지정하면, 이 엔드포인트는 API 사용량 제한 설명서에 명시된 엔드포인트 간에 공유되는 시간당 250,000건의 요청이라는 기본 사용량 제한이 적용됩니다.

Braze 엔드포인트는 API 요청의 일괄 처리를 지원합니다. 메시징 엔드포인트에 대한 단일 요청은 다음 중 하나에 해당할 수 있습니다:

  • 최대 50개의 특정 external_ids(각각 개별 메시지 매개변수 포함)
  • 요청에서 Connected 오디언스 오브젝트로 정의된 모든 규모의 오디언스 Segment

요청 본문

1
2
Content-Type: application/json
Authorization: Bearer YOUR-REST-API-KEY
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
  "campaign_id": (required, string) see campaign identifier,
  "send_id": (optional, string) see send identifier,
  // Including 'recipients' will send only to the provided user ids if they are in the campaign's segment
  "recipients": (optional, array of recipients object),
  // for any keys that conflict between these trigger properties and those in a Recipients Object, the value from the Recipients Object will be used
  "audience": (optional, connected audience object) see connected audience,
  // Including 'audience' will only send to users in the audience
  // If 'recipients' and 'audience' are not provided and broadcast is not set to 'false',
  // the message will send to entire segment targeted by the campaign
  "broadcast": (optional, boolean) see broadcast -- defaults to false on 8/31/17, must be set to true if "recipients" object is omitted,
  "trigger_properties": (optional, object) personalization key-value pairs for all users in this send; see trigger properties,
  "schedule": {
    "time": (required, datetime as ISO 8601 string) time to send the message,
    "in_local_time": (optional, bool),
    "at_optimal_time": (optional, bool),
  }
}

요청 매개변수

매개변수 필수 데이터 유형 설명
campaign_id 필수 문자열 Campaign 식별자를 참조하세요.
send_id 선택 사항 문자열 전송 식별자를 참조하세요.
recipients 선택 사항 수신자 오브젝트 배열 수신자 오브젝트를 참조하세요.
audience 선택 사항 연결된 오디언스 오브젝트 연결된 오디언스를 참조하세요.
broadcast 선택 사항 부울 Campaign 또는 Canvas가 타겟팅하는 전체 Segment에 메시지를 보낼 때 broadcast를 true로 설정해야 합니다. 이 매개변수는 기본적으로 false로 설정됩니다(2017년 8월 31일 기준).

broadcast가 true로 설정되면 recipients 목록을 포함할 수 없습니다. 그러나 broadcast: true를 설정할 때 주의하세요. 이 플래그를 의도치 않게 설정하면 예상보다 더 많은 오디언스에게 메시지를 보낼 수 있습니다.
trigger_properties 선택 사항 오브젝트 이 전송의 모든 사용자에 대한 개인화 키-값 페어입니다. 트리거 등록정보를 참조하세요.
schedule 필수 스케줄 오브젝트 스케줄 오브젝트를 참조하세요.

요청 예시

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
curl --location --request POST 'https://rest.iad-01.braze.com/campaigns/trigger/schedule/create' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR-REST-API-KEY' \
--data-raw '{
  "campaign_id": "campaign_identifier",
  "send_id": "send_identifier",
  "recipients": [
    {
      "user_alias": "example_alias",
      "external_user_id": "external_user_identifier",
      "trigger_properties": {}
    }
  ],
  "audience": {
    "AND": [
      {
        "custom_attribute": {
          "custom_attribute_name": "eye_color",
          "comparison": "equals",
          "value": "blue"
        }
      },
      {
        "custom_attribute": {
          "custom_attribute_name": "favorite_foods",
          "comparison": "includes_value",
          "value": "pizza"
        }
      },
      {
        "OR": [
          {
            "custom_attribute": {
              "custom_attribute_name": "last_purchase_time",
              "comparison": "less_than_x_days_ago",
              "value": 2
            }
          },
          {
            "push_subscription_status": {
              "comparison": "is",
              "value": "opted_in"
            }
          }
        ]
      },
      {
        "email_subscription_status": {
          "comparison": "is_not",
          "value": "subscribed"
        }
      },
      {
        "last_used_app": {
          "comparison": "after",
          "value": "2019-07-22T13:17:55+0000"
        }
      }
    ]
  },
  "broadcast": false,
  "trigger_properties": {},
  "schedule": {
    "time": "",
    "in_local_time": false,
    "at_optimal_time": false
  }
}'

응답

성공 응답 예시

1
2
3
4
5
{
    "dispatch_id": "dispatch_identifier",
    "schedule_id": "schedule_identifier",
    "message": "success"
}
New Stuff!