Skip to content

カタログセレクションを作成する

post

/catalogs/{catalog_name}/selections

このエンドポイントを使用して、カタログにセレクションを作成する。

前提条件

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

レート制限

This endpoint has a shared rate limit of 50 requests per minute between all asynchronous catalog fields and selections endpoints, as documented in API rate limits.

パスパラメーター

パラメーター required データ型 説明
catalog_name 必須 string カタログ名。

リクエストパラメーター

パラメーター required データ型 説明
selection required オブジェクト 選択基準を含むオブジェクト。選択オブジェクトには、namedescriptionfiltersresults_limitsort_fieldsort_order が含まれる場合があります。

リクエスト例

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
curl --location --request POST 'https://rest.iad-03.braze.com/catalogs/restaurants/selections' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR-REST-API-KEY' \
--data-raw '{
  "selection": {
    "name": "favorite-restaurants",
    "description": "Favorite restaurants in NYC",
    "filters": [
      {
        "field": "City",
        "operator": "equals",
        "value": "NYC"
      },
      {
        "field": "Rating",
        "operator": "greater than",
        "value": 7
      }
    ]
  }
}'

フィルター演算子

フィールドタイプ 対応オペレーター
string equals, does not equal
number equalsdoes not equal,greater thanless than
boolean is
time before, after
array includes value, does not include value

応答

このエンドポイントには、202400404 という3つのステータスコード応答があります。

成功応答の例

ステータスコード 202 は、次の応答本文を返す可能性があります。

1
2
3
{
  "message": "success"
}

エラー応答例

ステータスコード 400 は、次の応答本文を返す可能性があります。遭遇する可能性のあるエラーの詳細については、「トラブルシューティング」を参照のこと。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{
  "errors": [
    {
      "id": "catalog-not-found",
      "message": "Could not find catalog",
      "parameters": [
        "catalog_name"
      ],
      "parameter_values": [
        "restaurants"
      ]
    }
  ],
  "message": "Invalid Request"
}

トラブルシューティング

以下の表は、返される可能性のあるエラーと、それに関連するトラブルシューティングの手順を示したものである。

エラー トラブルシューティング
catalog-not-found カタログ名が有効であることを確認する。
company-size-limit-already-reached カタログのストレージサイズの上限に達しています。
selection-limit-reached カタログの選択数が制限に達した。
invalid-selection 選択が有効であることを確認する。
too-many-filters 選択範囲にフィルターが多すぎないかチェックする。
selection-name-already-exists 選択名がカタログにすでに存在するかどうかをチェックする。
selection-has-invalid-filter 選択フィルターが有効かどうかをチェックする。
selection-invalid-results-limit 選考結果の上限が有効かどうかをチェックする。
invalid-sorting 選択ソートが有効かどうかをチェックする。
invalid-sort-field 選択ソートフィールドが有効かどうかをチェックする。
invalid-sort-order 選択のソート順が有効かどうかをチェックする。
selection-contains-too-many-arrays 選択範囲にarray 型のフィールドが複数含まれているかどうかをチェックする。サポートされているのは1つのみです。
「このページはどの程度役に立ちましたか?」
New Stuff!