Skip to content

콘텐츠 블록 생성

post

/content_blocks/create

이 엔드포인트를 사용하여 Content Block을 생성합니다.

필수 조건

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

사용량 제한

이 엔드포인트에는 API 사용량 제한 설명서에 명시된 대로 기본 Braze 사용량 제한인 시간당 250,000건의 요청이 적용됩니다.

요청 본문

1
2
Content-Type: application/json
Authorization: Bearer YOUR_REST_API_KEY
1
2
3
4
5
6
7
{
  "name": (required, string) Must be less than 100 characters,
  "description": (optional, string) The description of the Content Block. Must be less than 250 character,
  "content": (required, 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
}

요청 매개변수

매개변수 필수 데이터 유형 설명
name 필수 문자열 Content Block의 이름입니다. 100자 미만이어야 합니다.
description 선택 사항 문자열 Content Block에 대한 설명입니다. 250자 미만이어야 합니다.
content 필수 문자열 Content Block 내의 HTML 또는 텍스트 콘텐츠입니다.
state 선택 사항 문자열 active 또는 draft를 선택합니다. 지정하지 않으면 기본값은 active입니다.
tags 선택 사항 문자열 배열 태그가 이미 존재해야 합니다.

요청 예시

1
2
3
4
5
6
7
8
9
10
curl --location --request POST 'https://rest.iad-01.braze.com/content_blocks/create' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_REST_API_KEY' \
--data-raw '{
  "name": "content_block",
  "description": "This is my Content Block",
  "content": "HTML 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 Content Block의 콘텐츠는 총 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 설명이 따옴표("")로 묶여 있는지 확인하세요.  
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 Content Block 이름에는 문자(대문자 또는 소문자) A~Z, 숫자 0~9, 대시 -, 밑줄 _만 포함할 수 있습니다. 이모지, !, @, ~, & 및 기타 “특수” 문자와 같은 영숫자가 아닌 문자는 포함할 수 없습니다.  
Content Block with this name already exists 다른 이름을 사용해 보세요.  
Content Block state must be either active or draft    
Tags must be an array 태그는 문자열 배열 형식이어야 합니다(예: ["marketing", "promotional", "transactional"]).  
All tags must be strings 태그가 따옴표("")로 묶여 있는지 확인하세요.  
Some tags could not be found Content Block을 생성할 때 태그를 추가하려면 해당 태그가 Braze에 이미 존재해야 합니다.  
New Stuff!