콘텐츠로 건너뛰기

WhatsApp 오브젝트

whats_app 오브젝트를 사용하면 메시징 엔드포인트를 통해 WhatsApp 메시지를 수정하거나 생성할 수 있습니다.

WhatsApp 오브젝트

{
  "app_id": (required, string) see App Identifier,
  "subscription_group_id": (required, string) the ID of your subscription group,
  "message_variation_id": (optional, string) used when providing a campaign_id to specify which message variation this message should be tracked under,
  "message_type": (required, string) the type of WhatsApp message being sent under the `message` key (template_message | text_response_message | text_image_response_message | quick_reply_response_message | list_response_message | flow_response_message | carousel_response_message),
  "message": (required, object) The message object that must include the required fields based on the selected `message_type`. Below are the specific message structures for each type. Refer to the relevant message type for the required fields and their format.
}

메시지 유형

template_message

{
  "template_name": (required, string) the WhatsApp template name for the message,
  "template_language_code": (required, string) the language code of the WhatsApp template for the message,
  "header_variables": (optional, header variables object) an object to specify header variable values for specified template_name, required if the header has variables; see object specification below,
  "body_variables": (optional, body variable object) an object to specify body variable values for specified template_name, required if the body has variables; see object specification below,
  "button_variables": (optional, button variables object) an object to specify button variable values for specified template_name, required if buttons have variables; see object specification below,
  "header_media_uri": (optional, string) URI to the header media, if the header is of type IMAGE in specified template_name. Only IMAGE and TEXT header types are supported by the messages/send API,
  "carousel_cards": (optional, array) an array of carousel card objects, required if the specified template_name is a carousel template; see object specification below
}

각 캐러셀 카드는 승인된 캐러셀 템플릿의 카드를 순서대로 채웁니다. 인덱스 0의 카드가 템플릿의 첫 번째 카드를 채웁니다.

{
  "header_media_uri": (required, string) URI to the card's header media; must be Braze-hosted media,
  "header_media_type": (required, string) The type of the card's header media (image | video),
  "body_variables": (optional, body variables object) Values for the card's body variables, in the same format as the template-level body_variables,
  "button_variables": (optional, button variables object) Values for the card's button variables, in the same format as the template-level button_variables
}
제약 조건
  • carousel_cards: 승인된 템플릿의 카드 수와 일치하도록 2~10개의 카드를 포함해야 합니다.
  • header_media_uri: Braze 미디어 라이브러리에 호스팅된 미디어를 참조해야 합니다.
  • header_media_type: 모든 카드는 승인된 템플릿과 일치하는 동일한 미디어 유형을 사용해야 합니다.
예시
{
  "template_name": "weekly_picks",
  "template_language_code": "en",
  "body_variables": {
    "0": "Jane"
  },
  "carousel_cards": [
    {
      "header_media_uri": "https://braze-images.com/card1.png",
      "header_media_type": "image",
      "body_variables": {
        "0": "Runner X"
      }
    },
    {
      "header_media_uri": "https://braze-images.com/card2.png",
      "header_media_type": "image",
      "body_variables": {
        "0": "Trail Pro"
      },
      "button_variables": {
        "0": "/promo/123"
      }
    }
  ]
}
헤더 변수 오브젝트

header_variables 오브젝트를 사용하면 WhatsApp 템플릿의 헤더 변수 값을 지정할 수 있습니다. 각 키는 지정된 값으로 대체할 WhatsApp 템플릿 변수 인덱스(0부터 시작)입니다.

{
  "$TEMPLATE_VARIABLE_INDEX_0": "$TEMPLATE_VARIABLE_VALUE_0"
}

현재 0개 또는 1개의 헤더 변수만 지정할 수 있습니다.

예시
{
  "0": "Check it out!"
}
본문 변수 오브젝트

body_variables 오브젝트를 사용하면 WhatsApp 템플릿의 본문 변수 값을 지정할 수 있습니다. 각 키는 지정된 값으로 대체할 WhatsApp 템플릿 변수 인덱스(0부터 시작)입니다.

{
  "$TEMPLATE_VARIABLE_INDEX_0": "$TEMPLATE_VARIABLE_VALUE_0",
  "$TEMPLATE_VARIABLE_INDEX_1": "$TEMPLATE_VARIABLE_VALUE_1"
}
예시
{
  "0": "Check it out!",
  "1": "It's pretty neat."
}
버튼 변수 오브젝트

button_variables 오브젝트를 사용하면 WhatsApp 템플릿의 버튼 변수 값을 지정할 수 있습니다. 각 키는 지정된 값으로 대체할 WhatsApp 템플릿 변수 인덱스(0부터 시작)입니다.

{
  "$TEMPLATE_VARIABLE_INDEX_1": "$TEMPLATE_VARIABLE_VALUE_1"
}

현재 하나의 버튼 변수만 지정할 수 있으며, 이는 행동 유도(CTA) URL의 경로 구성 요소입니다. 변수 인덱스는 템플릿의 CTA URL 버튼 인덱스와 일치해야 합니다. 예를 들어, CTA 버튼이 템플릿의 두 번째 버튼인 경우 변수 인덱스 “1”을 사용합니다.

예시
{
  "1": "/marketing/promotion123"
}

응답 메시지

text_response_message

{
  "body": (required, string) the body of the message to send,
  "preview_url": (optional, boolean) whether WhatsApp should render a preview of links included in body
}
예시
{
  "body": "Check out our new deals at https://braze.com",
  "preview_url": true
}

text_image_response_message

{
  "image_uri": (required, string) the uri of the image to send,
  "caption": (optional, string) the caption for the image being sent
}
예시
{
  "image_uri": "https://braze.com/promotion.jpg",
  "caption": "This won't last for long, check it out!"
}

quick_reply_response_message

{
  "body": (required, string) the body of the message to send,
  "header_image_uri": (optional, string) the URI of the image to send as the message header (only valid if header_text not present),
  "header_text": (optional, string) the text to send as the message header (only valid if header_image_uri not present),
  "footer": (optional, string) the footer of the message to send,
  "buttons": (required, array) array of Button objects. Will render in message based on order in array.
}
버튼 오브젝트
{
  "text": (required, string) the text of the button
}
예시
{
  "body": "Want to keep hearing from us?",
  "buttons": [
    {
      "text": "Yes!"
    },
    {
      "text": "No thanks"
    }
  ]
}

list_response_message

list_response_message 유형을 사용하면 WhatsApp에서 목록 기반 메시지를 전송할 수 있습니다. 이 메시지 유형에는 수신자가 상호작용할 수 있는 항목 목록이 포함됩니다.

{
  "header": (optional, string) the header of the message to send,
  "body": (required, string) the body of the message to send,
  "footer": (optional, string) the footer of the message to send,
  "list": (required, object) the list object that contains:
    "list_button_text": (required, string) the text that will appear on the list button,
    "list_sections": (required, array) an array of List Section Objects
}

목록 섹션 오브젝트

{
  "section_title": (required, string) The title of the section,
  "list_rows": (required, array) An array of List Row Objects
}

목록 행 오브젝트

{
  "row_title": (required, string) The title of the row,
  "row_description": (optional, string) The description for the row
}
제약 조건
  • list_sections: 최소 하나의 섹션이 있어야 합니다.
  • list_rows: 모든 섹션에 걸쳐 최대 10개의 행을 포함할 수 있습니다.
  • row_description: 각 행에 대해 선택 사항입니다.
예시
{
  "body": "Here is a list of options to choose from:",
  "list": {
    "list_button_text": "Choose an option",
    "list_sections": [
      {
        "section_title": "Section 1",
        "list_rows": [
          {
            "row_title": "Option 1"
          },
          {
            "row_title": "Option 2",
            "row_description": "Description for Option 2"
          }
        ]
      },
      {
        "section_title": "Section 2",
        "list_rows": [
          {
            "row_title": "Option 3"
          },
          {
            "row_title": "Option 4"
          },
          {
            "row_title": "Option 5"
          }
        ]
      }
    ]
  }
}

flow_response_message

flow_response_message 유형을 사용하면 WhatsApp에서 플로우 기반 메시지를 전송할 수 있습니다. 이 메시지 유형에는 수신자가 완료할 수 있는 인터랙티브 플로우가 포함됩니다.

{
  "header_text": (optional, string) the header text of the message to send,
  "body": (required, string) the body of the message to send,
  "footer": (optional, string) the footer of the message to send,
  "flow_button": (required, object) the flow button object that contains:
    "caption": (required, string) the text that will appear on the flow button,
    "flow_id": (required, string) the unique identifier of the WhatsApp Flow,
  "generate_custom_attribute": (optional, boolean) whether to save flow response on the user profile and generate a custom attribute upon responding to this flow message
}
플로우 버튼 오브젝트
{
  "caption": (required, string) The text displayed on the button,
  "flow_id": (required, string) The ID of the flow
}
제약 조건
  • flow_button: captionflow_id를 모두 포함해야 합니다.
  • caption: 최대 20자입니다.
  • flow_id: 유효한 게시된 플로우 ID여야 합니다.
예시
{
  "body": "Please complete your order details",
  "flow_button": {
    "caption": "Start Order",
    "flow_id": "594425479261596"
  },
  "generate_custom_attribute": true
}

carousel_response_message 유형을 사용하면 사용자가 스와이프하여 탐색할 수 있는 인터랙티브 미디어 카드 캐러셀을 응답 메시지로 전송할 수 있습니다. 각 카드에는 미디어, 선택적 본문 텍스트, 빠른 답장 버튼 또는 웹사이트 버튼이 포함됩니다.

{
  "body": (required, string) the body of the message to send,
  "carousel_button_type": (required, string) the button type used by every card (quick_reply | url),
  "cards": (required, array) an array of Card objects. Cards render in the carousel in array order.
}
카드 오브젝트
{
  "media_uri": (required, string) the URI of the card's media,
  "media_type": (required, string) the type of the card's media (image | video),
  "body_text": (optional, string) the body text of the card,
  "buttons": (required for quick_reply, array) an array of button label strings,
  "cta_url_button": (required for url, object) the website button object that contains:
    "display_text": (required, string) the text displayed on the button,
    "url": (required, string) the URL the button opens
}
제약 조건
  • cards: 2~10개의 카드를 포함해야 합니다.
  • media_type: 모든 카드는 동일한 미디어 유형을 사용해야 합니다.
  • body_text: 카드당 최대 160자입니다.
  • buttons: quick_reply의 경우, 모든 카드는 동일한 수의 버튼을 가져야 하며 카드당 최대 2개까지 가능합니다.
  • cta_url_button: url의 경우, 모든 카드에 cta_url_button이 포함되어야 합니다.
빠른 답장 버튼 예시
{
  "body": "Check out this week's picks!",
  "carousel_button_type": "quick_reply",
  "cards": [
    {
      "media_uri": "https://example.com/card1.png",
      "media_type": "image",
      "body_text": "Runner X - now 20% off",
      "buttons": ["Shop now", "Not for me"]
    },
    {
      "media_uri": "https://example.com/card2.png",
      "media_type": "image",
      "body_text": "Trail Pro - back in stock",
      "buttons": ["Shop now", "Not for me"]
    }
  ]
}
웹사이트 버튼 예시
{
  "body": "Check out this week's picks!",
  "carousel_button_type": "url",
  "cards": [
    {
      "media_uri": "https://example.com/card1.png",
      "media_type": "image",
      "body_text": "Runner X - now 20% off",
      "cta_url_button": {
        "display_text": "Visit",
        "url": "https://example.com/runner-x"
      }
    },
    {
      "media_uri": "https://example.com/card2.png",
      "media_type": "image",
      "body_text": "Trail Pro - back in stock",
      "cta_url_button": {
        "display_text": "Visit",
        "url": "https://example.com/trail-pro"
      }
    }
  ]
}
New Stuff!