Skip to content

API によってトリガーされる Canvases のスケジュール設定

post

/canvas/trigger/schedule/create

このエンドポイントを使用して、API トリガー配信を介して Canvas メッセージをスケジュールし、メッセージの送信をトリガーするアクションを決定できます。

Canvas の最初のステップで送信されるメッセージにテンプレート化されるものを渡す canvas_entry_properties ことができます。

このエンドポイントでメッセージを送信するには、Canvas の構築時に作成された Canvas ID が必要です。

前提 条件

このエンドポイントを使用するには、アクセス許可を持つ canvas.trigger.schedule.create API キーが必要です。

レート制限

We apply the default Braze rate limit of 250,000 requests per hour to this endpoint, as documented in API rate limits.

Braze endpoints support batching API requests. A single request to the messaging endpoints can reach any of the following:

  • Up to 50 specific external_ids, each with individual message parameters
  • A segment of any size created in the Braze dashboard, specified by its segment_id
  • An audience segment of any size, defined in the request as a connected audience object

リクエスト本文

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
{
  "canvas_id": (required, string) see Canvas 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 Canvas
  "broadcast": (optional, boolean) see broadcast -- defaults to false on 8/31/17, must be set to true if "recipients" object is omitted,
  "canvas_entry_properties": (optional, object) personalization key-value pairs for the first step 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),
  }
}

要求パラメーター

パラメータ 必須項目 データ型 説明
canvas_id 必須項目 文字列 キャンバス識別子」を参照してください。
recipients オプション 受信者オブジェクトの配列 受信者オブジェクト (recipients object) を参照。
audience オプション 接続されたオーディエンスオブジェクト 「接続されたオーディエンス」を参照してください。
broadcast オプション ブーリアン キャンペーンまたはキャンバスがターゲットとするセグメント全体にメッセージを送信する場合は、true に設定する broadcast 必要があります。このパラメーターの既定値は false です (2017 年 8 月 31 日現在)。

broadcastが true に設定されている場合、recipientsリストを含めることはできません。ただし、 を設定するときは broadcast: true、このフラグを意図せずに設定すると、予想よりも多くのオーディエンスにメッセージが送信される可能性があるため、注意が必要です。
canvas_entry_properties オプション オブジェクト この送信のすべてのユーザーのパーソナライゼーションのキーと値のペア。「Canvas エントリのプロパティオブジェクト」を参照してください。
schedule 必須項目 スケジュール オブジェクト スケジュール・オブジェクト (schedule object) を参照。

要求の例

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
curl --location --request POST 'https://rest.iad-01.braze.com/canvas/trigger/schedule/create' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR-REST-API-KEY' \
--data-raw '{
  "canvas_id": "canvas_identifier",
  "recipients": [
    {
      "user_alias": "example_alias",
      "external_user_id": "external_user_identifier",
      "canvas_entry_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,
  "canvas_entry_properties": {},
  "schedule": {
    "time": "",
    "in_local_time": false,
    "at_optimal_time": false
  }
}'

応答

成功応答の例

1
2
3
4
5
6
7
8
Content-Type: application/json
Authorization: Bearer YOUR-API-KEY-HERE
{
{
    "dispatch_id": "dispatch_identifier",
    "schedule_id": "schedule_identifier",
    "message": "success"
}
「このページはどの程度役に立ちましたか?」
New Stuff!