Skip to content

コンテンツブロックを更新する

post

/content_blocks/update

このエンドポイントを使用して、コンテンツブロックを更新します。

前提条件

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

レート制限

APIレート制限に記載されているように、このエンドポイントにはデフォルトのBrazeレート制限(1時間あたり250,000リクエスト)が適用されます。

リクエスト本文

1
2
Content-Type: application/json
Authorization: Bearer YOUR_REST_API_KEY
1
2
3
4
5
6
7
8
{
  "content_block_id" : (required, string) Content Block's API identifier.
  "name": (optional, string) Must be less than 100 characters,
  "description": (optional, string) The description of the Content Block. Must be less than 250 character,
  "content": (optional, string) HTML or text content within Content Block,
  "state": (optional, string) Choose `active` or `draft`. Defaults to `active` if not specified,
  "tags": (optional, array of strings) Tags must already exist
}

リクエストパラメーター

パラメーター 必須 データタイプ 説明
content_block_id 必須 文字列 コンテンツブロックのAPI識別子。
name オプション 文字列 コンテンツブロックの名前。100文字未満でなければなりません。
description オプション 文字列 コンテンツブロックの説明。250文字未満でなければなりません。
content オプション 文字列 Content Blocks内のHTMLまたはテキストコンテンツ。
state オプション 文字列 active または draft を選択します。指定がない場合のデフォルトは active です。
tags オプション 文字列の配列 タグはすでに存在している必要があります。

リクエスト例

1
2
3
4
5
6
7
8
9
10
11
curl --location --request POST 'https://rest.iad-01.braze.com/content_blocks/update' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_REST_API_KEY' \
--data-raw '{
  "content_block_id" :"content_block_id",
  "name": "content_block",
  "description": "This is my Content Block",
  "content": "HTML or text content within block",
  "state": "draft",
  "tags": ["marketing"]
}'

応答

1
2
3
4
5
6
{
  "content_block_id": (string) Your newly generated block id,
  "liquid_tag": (string) The generated block tag from the Content Block name,
  "created_at": (string) The time the Content Block was created in ISO 8601,
  "message": "success"
}

トラブルシューティング

次の表に、返される可能性のあるエラーと、関連するトラブルシューティングステップを示します。

エラー トラブルシューティング
Content cannot be blank  
Content must be a string コンテンツが引用符("")で囲まれていることを確認してください。
Content must be smaller than 50kb コンテンツブロックのコンテンツは合計50KB未満である必要があります。
Content contains malformed liquid 指定されたLiquidは有効でないか、解析できません。有効なLiquidで再試行するか、サポートにお問い合わせください。
Content Block cannot be referenced within itself  
Content Block description cannot be blank  
Content Block description must be a string コンテンツブロックの説明が引用符("")で囲まれていることを確認してください。
Content Block description must be shorter than 250 characters  
Content Block name cannot be blank  
Content Block name must be shorter than 100 characters  
Content Block name can only contain alphanumeric characters コンテンツブロック名には、文字(大文字または小文字)AZ、数字 09、ダッシュ -、アンダースコア _ のいずれかを含めることができます。絵文字、!@~&、その他の「特殊」文字など、英数字以外の文字を含めることはできません。
Content Block with this name already exists 別の名前をお試しください。
Content Block name cannot be updated for active Content Blocks  
Content Block state must be either active or draft  
Active Content Block can not be updated to Draft. Create a new Content Block.  
Tags must be an array タグは文字列の配列としてフォーマットする必要があります(例: ["marketing", "promotional", "transactional"])。
All tags must be strings タグが引用符("")で囲まれていることを確認してください。
Some tags could not be found コンテンツブロックの作成時にタグを追加するには、そのタグがすでにBrazeに存在している必要があります。
New Stuff!