메시지

/v1/messages

messages 노드를 사용하여 고객에게 메시지 템플릿과 문자, 미디어, 연락처, 위치, 인터랙티브 메시지를 전송합니다.

전송할 수 있는 구체적인 메시지 유형과 관련된 정보는 문자 메시지, 미디어 메시지, 연락처 및 위치 메시지, 인터랙티브 메시지, 메시지 템플릿, 미디어 메시지 템플릿, 인터랙티브 메시지 템플릿 가이드를 참조하세요.

시작하기 전에

다음 항목이 필요합니다.

  • 본인을 인증하고 서비스에 액세스하기 위한 인증 토큰을 받습니다. 진행 방법에 대한 자세한 내용은 로그인 및 인증 문서를 참조하세요.
  • 메시지를 보내고자 하는 WhatsApp 계정을 인증하고 WhatsApp 사용자 ID를 가져오는 방법에 대해 자세히 알아보려면 연락처 문서를 참조하세요.
  • 메시지의 컷오프 제어 서비스 요구 사항을 준수합니다.

v2.39 이후부터는 메시지를 보내기 전에 연락처 노드를 호출할 필요가 없습니다.

제약 사항

  • 지원되는 메시지 유형은 문자, 메시지 템플릿, 이미지, 문서, 오디오입니다.
  • 문자 메시지는 최대 4,096자까지 가능합니다.

만들기

메시지 유형과 관계없이 /messages 노드로 POST 호출을 보내서 메시지를 전송합니다. JSON 메시지 본문 내용은 메시지 유형(예: 문자, 이미지)에 따라 다릅니다.

매개변수

/messages POST 요청에서 사용하는 주요 매개변수는 다음과 같습니다.

이름설명 (왼쪽 열의 화살표를 클릭하여 지원되는 옵션을 확인하세요.)

audio

개체

type=audio일 때 필수 항목.

오디오를 포함하는 media 개체.

biz_opaque_callback_data

문자열

선택 사항.

임의의 문자열이며, 추적에 사용합니다.


예를 들어 이 필드에 메시지 템플릿 ID를 전달하여 비즈니스가 전송한 첫 메시지부터 고객의 여정을 추적할 수 있습니다. 그런 다음, 다양한 메시지 템플릿 유형의 ROI를 추적하여 가장 효과적인 템플릿을 확인할 수 있습니다.


이 문자열은 Webhooks 페이로드 내의 statuses 개체에 포함되어 있으므로 WhatsApp Business 계정에서 messages Webhooks 필드를 구독하는 모든 앱은 이 문자열을 받을 수 있습니다.


클라우드 API는 이 필드를 처리하지 않고 메시지 전송됨/전달됨/읽음 Webhooks에서 반환합니다.


최대 512자입니다.


클라우드 API 전용.

contacts

개체

type=contacts일 때 필수 항목.

contacts 개체.

context

개체

대화 중 메시지에 답장하는 경우 필수 항목.

답장하려는 이전 메시지의 ID를 포함하는 개체. 예를 들면 다음과 같습니다.


{"message_id":"MESSAGE_ID"}


클라우드 API 전용.

document

개체

type=document일 때 필수 항목.

문서를 포함하는 media 개체.

hsm

개체

hsm 개체를 포함합니다. 이 옵션은 온프레미스 API의 v2.39부터 사용 중단되었습니다. 대신 template 개체를 사용하세요.


온프레미스 API 전용.

image

개체

type=image일 때 필수 항목.

이미지를 포함하는 media 개체.

interactive

개체

type=interactive일 때 필수 항목.

interactive 개체. 각 interactive 개체의 구성 요소는 일반적으로 일관된 패턴(header, body, footeraction)을 따릅니다.

location

개체

type=location일 때 필수 항목.

location 개체.

messaging_product

문자열

필수 항목.

요청에 사용된 메시지 서비스. "whatsapp"을 사용합니다.


클라우드 API 전용.

preview_url

부울

type=text일 때 필수 항목.

문자 메시지에서 URL 미리 보기 허용 — 문자 메시지에서 URL 전송을 참조하세요. 메시지에 URL을 포함하지 않는 경우 이 필드는 선택 사항입니다. 값:false(기본값), true.


온프레미스 API 전용. 클라우드 API 사용자는 텍스트 개체 내의 preview_url 필드와 동일한 기능을 사용할 수 있습니다.

recipient_type

문자열

선택 사항.

현재는 개인에게만 메시지를 보낼 수 있습니다. 이 필드를 individual로 설정하세요.


기본값: individual

status

문자열

메시지 상태. 이 필드를 사용하여 메시지를 read로 표시할 수 있습니다. 자세한 내용은 다음 가이드를 참조하세요.


sticker

개체

type=sticker일 때 필수 항목.

스티커를 포함하는 media 개체.


클라우드 API: 모든 유형의 인바운드 스티커 외에 고정 및 애니메이션 타사 아웃바운드 스티커도 지원됩니다. 고정 스티커는 512x512픽셀이어야 하고 100KB를 초과할 수 없습니다. 애니메이션 스티커는 512x512픽셀이어야 하고 500KB를 초과할 수 없습니다.


온프레미스 API: 모든 유형의 인바운드 스티커 외에 고정 타사 아웃바운드 스티커만 지원됩니다. 고정 스티커는 512x512픽셀이어야 하고 100KB를 초과할 수 없습니다. 애니메이션 스티커는 지원되지 않습니다.

template

개체

type=template일 때 필수 항목.

template 개체.

text

개체

문자 메시지에 필수 항목.

text 개체.

to

문자열

필수 항목.

메시지를 보낼 대상인 고객의 WhatsApp ID 또는 전화번호. 전화번호 형식을 참조하세요.


필요한 경우 온프레미스 API 사용자는 contacts 엔드포인트를 호출하여 이 번호를 받을 수 있습니다.

type

문자열

선택 사항.

전송하고자 하는 메시지 유형. 생략하는 경우 기본값은 text로 지정됩니다.

텍스트 개체

이름설명

body

필수 항목.

문자 메시지의 텍스트와 함께 URL과 형식화를 포함할 수 있습니다.

미디어 개체

온프레미스 API의 경우 media 엔드포인트를 통해 WhatsApp Business 온프레미스/참조 클라이언트에 미디어가 성공적으로 업로드되면 미디어 개체 ID가 반환됩니다.

NameDescription

id

string

Required when type is audio, document, image, sticker, or video and you are not using a link.


The media object ID. Do not use this field when message type is set to text.

link

string

Required when type is audio, document, image, sticker, or video and you are not using an uploaded media ID (i.e. you are hosting the media asset on your public server).

The protocol and URL of the media to be sent. Use only with HTTP/HTTPS URLs.


Do not use this field when message type is set to text.


Cloud API users only:


  • See Media HTTP Caching if you would like us to cache the media asset for future messages.
  • When we request the media asset from your server you must indicate the media's MIME type by including the Content-Type HTTP header. For example: Content-Type: video/mp4. See Supported Media Types for a list of supported media and their MIME types.

caption

string

Optional.


Media asset caption. Do not use with audio or sticker media.


On-Premises API users:

  • For v2.41.2 or newer, this field is is limited to 1024 characters.
  • Captions are currently not supported for document media.

filename

string

Optional.


Describes the filename for the specific document. Use only with document media.


The extension of the filename will specify what format the document is displayed as in WhatsApp.

provider

string

Optional. On-Premises API only.

This path is optionally used with a link when the HTTP/HTTPS link is not directly accessible and requires additional configurations like a bearer token. For information on configuring providers, see the Media Providers documentation.

연락처 개체

contacts 내에서 addresses, emails, name, org, phoneurls 개체를 중첩할 수 있습니다. 복수화된 개체는 아래의 예와 같이 배열로 래핑됩니다.

NameDescription

addresses

object

Optional.

Full contact address(es) formatted as an addresses object. The object can contain the following fields:

streetstringOptional. Street number and name.

citystringOptional. City name.

statestringOptional. State abbreviation.

zipstringOptional. ZIP code.

countrystringOptional. Full country name.

country_codestringOptional. Two-letter country abbreviation.

typestringOptional. Standard values are HOME and WORK.

birthday

Optional.

YYYY-MM-DD formatted string.

emails

object

Optional.

Contact email address(es) formatted as an emails object. The object can contain the following fields:

emailstringOptional. Email address.

typestringOptional. Standard values are HOME and WORK.

name

object

Required.

Full contact name formatted as a name object. The object can contain the following fields:

formatted_namestringRequired. Full name, as it normally appears.

first_namestringOptional*. First name.

last_namestringOptional*. Last name.

middle_namestringOptional*. Middle name.

suffixstringOptional*. Name suffix.

prefixstringOptional*. Name prefix.


*At least one of the optional parameters needs to be included along with the formatted_name parameter.

org

object

Optional.

Contact organization information formatted as an org object. The object can contain the following fields:

companystringOptional. Name of the contact's company.

departmentstringOptional. Name of the contact's department.

titlestringOptional. Contact's business title.

phones

object

Optional.

Contact phone number(s) formatted as a phone object. The object can contain the following fields:

phonestringOptional. Automatically populated with the `wa_id` value as a formatted phone number.

typestringOptional. Standard Values are CELL, MAIN, IPHONE, HOME, and WORK.

wa_idstringOptional. WhatsApp ID.

urls

object

Optional.

Contact URL(s) formatted as a urls object. The object can contain the following fields:

urlstringOptional. URL.

typestringOptional. Standard values are HOME and WORK.

내부에 복수화된 개체를 중첩한 contacts 개체의 예는 다음과 같습니다.

"contacts": [
    {
        "addresses": [
            {
                "city": "city name",
                "country": "country name",
                "country_code": "code",
                "state": "Contact's State",
                "street": "Contact's Street",
                "type": "Contact's Address Type",
                "zip": "Contact's Zip Code"
            }
        ],
        "birthday": "birthday",
        "emails": [
            {
                "email": "email",
                "type": "HOME"
            },
            {
                "email": "email",
                "type": "WORK"
            }
        ],
        "name": {
            "first_name": "first name value",
            "formatted_name": "formatted name value",
            "last_name": "last name value",
            "suffix": "suffix value"
        },
        "org": {
            "company": "company name",
            "department": "dep name",
            "title": "title"
        },
        "phones": [
            {
                "phone": "Phone number",
                "wa-id": "WA-ID value",
                "type": "MAIN"
            },
            {
                "phone": "Phone number",
                "type": "HOME"
            },
            {
                "phone": "Phone number",
                "type": "WORK"
            }
        ],
        "urls": [{
            "url": "some url",
            "type": "WORK"
        }]
    }
]

위치 개체

NameDescription

latitude

Required.

Location latitude in decimal degrees.

longitude

Required.

Location longitude in decimal degrees.

name

Required.

Name of the location.

address

Required.

Address of the location.

템플릿 개체

template 안에서 componentslanguage 개체를 중첩할 수 있습니다.

v2.27.8부터 템플릿의 namespace는 현재의 WhatsApp Business 온프레미스 클라이언트에 등록된 전화번호를 소유하는 WABA와 연결된 네임스페이스여야 합니다. 그렇지 않으면 메시지 전송이 실패합니다.

또한 v2.41 이후부터는 namespace가 선택 사항 필드가 됩니다.

이름설명

namespace

필수 항목.

템플릿의 네임스페이스입니다.


v2.27.8부터 현재 WhatsApp Business API 클라이언트와 연결된 전화번호를 소유하는 WhatsApp Business 계정과 연결된 네임스페이스여야 합니다. 그렇지 않으면 메시지 전송에 실패합니다.

name

필수 항목.

템플릿 이름입니다.

language

필수 항목.

템플릿을 렌더링할 수 있는 언어를 지정합니다. deterministic 언어 정책만 미디어 템플릿 메시지에 적용됩니다. 자세한 내용은 언어 섹션을 참조하세요.

components

선택 사항.

메시지 매개변수가 포함된 배열입니다.

구성 요소 개체

components 안에서 parameters 개체를 중첩할 수 있습니다. 또한 typebutton으로 설정할 수 있습니다.

이름설명

type

필수 항목.

component 유형을 설명합니다.
값:header, body, footer

parameters

선택 사항.

메시지 콘텐츠가 포함된 배열입니다.

매개변수 개체

이름설명

type

필수 항목.

parameter 유형을 설명합니다.
값:text, currency, date_time, image, document, video


미디어 유형(image, document, video)은 표준 미디어 메시지에서 사용한 것과 동일한 형식을 따릅니다. 자세한 내용은 미디어 문서를 참조하세요. 현재 미디어 메시지 템플릿에 대해서는 PDF 문서만 지원됩니다.


currencydate_time에 대한 자세한 내용은 현지화 가능한 매개변수 섹션을 참조하세요. template 메시지의 currencydate_time 매개변수는 default 대신 fallback_value를 사용합니다. 예시는 위의 요청 샘플을 참조하세요.

버튼 유형

components 개체 안에서 typebutton으로 설정할 수 있습니다. 버튼 매개변수는 다음과 같습니다.

이름설명

sub_type

필수 항목.

생성되는 버튼 유형입니다.
값:quick_reply, url, copy_code (available from 2.49 and onwards)

index

필수 항목.

버튼의 위치 인덱스입니다. 0-9의 인덱스 값을 사용하여 버튼을 최대 3개까지 사용할 수 있습니다.

parameters

필수 항목.

비즈니스 관리자에서 생성 시점에 설정되는 버튼 매개변수입니다. 다음과 같은 매개변수를 포함합니다.

  • type(필수 항목): 버튼 매개변수 유형을 나타냅니다. 지원되는 값은 payload, textcoupon_code입니다.
  • payload(quick_reply 버튼에 필수): 버튼의 표시 텍스트와 함께 버튼을 클릭했을 때 반환되는 개발자가 정의한 페이로드입니다.
  • text(url 버튼에 필수): 이전에 생성된 동적 URL 버튼에 추가될 개발자 제공 접미사입니다.
  • coupon_code(copy_code 버튼에 필수)(2.49 이상에서 제공): 개발자가 제공한 쿠폰 코드로, 코드 복사 버튼을 클릭할 때 복사됩니다.

sub_type quick_reply를 포함한 button 유형의 예는 다음과 같습니다.

 {
    "type": "button",
    "sub_type": "quick_reply",
    "index": 0,
    "parameters": 
     [{
    	"type": "payload",
    	"payload": "Yes-Button-Payload"
     }]
 } 

sub_type copy_code를 포함한 button 유형의 예는 다음과 같습니다.

    
 { 
    "type": "button", 
    "sub_type": "copy_code", 
    "index": 0, 
    "parameters": 
    [{ 
     "type": "coupon_code", 
     "coupon_code": "DISCOUNT20" 
    }] 
 }

Hsm 개체

hsm 개체는 WhatsApp Business 온프레미스/참조 v2.39부터 사용이 중단되었습니다. 대신 template 개체를 사용하세요.

이름 설명

namespace

필수 항목.

사용할 네임스페이스입니다. v2.2.7부터 네임스페이스가 element_name과 일치하지 않으면 메시지 전송이 실패합니다.

element_name

필수 항목.

네임스페이스에서 사용할 템플릿을 나타내는 요소 이름입니다. v2.2.7부터 element_name이 네임스페이스와 일치하지 않으면 메시지 전송이 실패합니다.

language

필수 항목.

결정적 언어 또는 폴백 언어의 사양을 고려합니다. 자세한 내용은 언어 섹션을 참조하세요.


이 필드는 fallback 옵션을 허용했지만 v2.27.8부터 사용이 중단되었습니다.

localizable_params

필수 항목.

이 필드는 템플릿 내 변수에 적용되는 값의 배열입니다. 자세한 내용은 현지화 가능한 매개변수 섹션을 참조하세요.

인터랙티브 개체

The interactive object generally contains 4 main components: header, body, footer, and action. Additionally, some of those components can contain one or more different objects:

  • Inside header, you can nest media objects.
  • Inside action, you can nest section and button objects.
NameDescription

type

string

Required.

The type of interactive message you want to send. Supported values:

  • list: Use it for List Messages.
  • button: Use it for Reply Buttons.
  • product: Use it for Single-Product Messages.
  • product_list: Use it for Multi-Product Messages.
  • catalog_message: Use it for Catalog Messages.
  • flow: Use it for Flows Messages.

header

object

Required for type product_list. Optional for other types.

Header content displayed on top of a message. You cannot set a header if your interactive object is of product type.


The header object contains the following fields:

documentobjectRequired if type is set to document. Contains the media object with the document.

imageobjectRequired if type is set to image. Contains the media object with the image.

videoobjectRequired if type is set to video. Contains the media object with the video.

textstringRequired if type is set to text. Text for the header. Formatting allows emojis, but not markdown. Maximum length: 60 characters.

typestringRequired. The header type you would like to use. Supported values are:

text – for List Messages, Reply Buttons, and Multi-Product Messages.

video – for Reply Buttons.

image – for Reply Buttons.

document – for Reply Buttons.

body

object

Optional for type product. Required for other message types.

An object with the body of the message.


The body object contains the following field:

textstringRequired if body is present. The content of the message. Emojis and markdown are supported. Maximum length: 1024 characters.

footer

object

Optional.

An object with the footer of the message.


The footer object contains the following field:

textstringRequired if footer is present. The footer content. Emojis, markdown, and links are supported. Maximum length: 60 characters.

action

object

Required.

An action object with what you want the user to perform after reading the message. See action object for full information.

행동 개체

NameDescription

button

string

Required for List Messages.

Button content. It cannot be an empty string and must be unique within the message. Emojis are supported, markdown is not. Maximum length: 20 characters.

buttons

object

Required for Reply Button Messages.

A button object. The object can contain the following parameters:

type – The only supported option is reply for Reply Button Messages.

title – Button title. It cannot be an empty string and must be unique within the message. Emojis are supported, markdown is not. Maximum length: 20 characters.

id – Unique identifier for your button. This ID is returned in the webhook when the button is clicked by the user. Maximum length: 256 characters.


ID를 설정할 때는 ID의 앞 또는 뒤에 공백이 있으면 안 됩니다.

sections

array of objects

Required for List Messages and Multi-Product Messages.

Array of section objects. There is a minimum of 1 and maximum of 10. See section object.

catalog_id

string

Required for Single-Product Messages and Multi-Product Messages.

Unique identifier of the Facebook catalog linked to your WhatsApp Business Account. This ID can be retrieved via Commerce Manager.

product_retailer_id

string

Required for Single-Product Messages and Multi-Product Messages.

Unique identifier of the product in a catalog. Maximum 100 characters for both Single-Product and Multi-Product messages.


To get this ID, go to Commerce Manager, select your Facebook Business account, and you will see a list of shops connected to your account. Click the shop you want to use. On the left-side panel, click Catalog > Items, and find the item you want to mention. The ID for that item is displayed under the item's name.

mode

string

Optional for Flows Messages.

The current mode of the Flow, either draft or published.


Default: published

flow_message_version

string

Required for Flows Messages.

Must be 3.

flow_token

string

Required for Flows Messages.

A token that is generated by the business to serve as an identifier.

flow_id

string

Required for Flows Messages.

Unique identifier of the Flow provided by WhatsApp.

flow_cta

string

Required for Flows Messages.

Text on the CTA button, eg. "Signup".


Maximum length: 20 characters (no emoji).

flow_action

string

Optional for Flows Messages.

navigate or data_exchange. Use navigate to predefine the first screen as part of the message. Use data_exchange for advanced use-cases where the first screen is provided by your endpoint.


Default: navigate

flow_action_payload

object

Optional for Flows Messages.

Required only if flow_action is navigate. The object can contain the following parameters:

screenstringRequired. The id of the first screen of the Flow.

dataobjectOptional. The input data for the first screen of the Flow. Must be a non-empty object.

Section Object

NameDescription

title

string

Required if the message has more than one section.

Title of the section. Maximum length: 24 characters.

rows

array of objects

Required for List Messages.

Contains a list of row objects. Limited to 10 rows across all sections.


Each row object contains the following fields:

titlestringRequired. Maximum length: 24 characters.

IDstringRequired. Maximum length: 200 characters.

descriptionstringOptional. Maximum length: 72 characters.

product_items

array of objects

Required for Multi-Product Messages.

Array of product objects. There is a minimum of 1 product per section and a maximum of 30 products across all sections.


Each product object contains the following field:

product_retailer_idstringRequired for Multi-Product Messages. Unique identifier of the product in a catalog. To get this ID, go to Commerce Manager, select your account and the shop you want to use. Then, click Catalog > Items, and find the item you want to mention. The ID for that item is displayed under the item's name.

오디오 메시지:

POST /v1/messages
{
  "recipient_type": "individual",
  "to": "whatsapp-id",
  "type": "audio",
  "audio": {
      "id": "your-media-id",
  }
}

문서 메시지(filename 사용):

POST /v1/messages
{
  "recipient_type": "individual",
  "to": "whatsapp-id",
  "type": "document",
  "document": {
      "id": "your-media-id",
      "filename": "your-document-filename"
  }
}

문서 메시지(link 사용):

POST /v1/messages
{
  "recipient_type": "individual",
  "to": "whatsapp-id",
  "type": "document",
  "document": {
      "link": "http(s)://the-url"
      "provider": {
          "name" : "provider-name"
      }     
    }
}

동영상 메시지(link 사용):

POST /v1/messages
{
  "recipient_type": "individual",
  "to": "whatsapp-id",
  "type": "video",  
  "video": {
      "link": "http(s)://the-url"
      "provider": {
          "name" : "provider-name"
      }
    }
  }
}

문자 메시지:

POST /v1/messages
{
  "recipient_type": "individual",
  "to": "whatsapp-id",
  "type": "text",
  "text": {
      "body": "your-message-content"
  }
}

인터랙티브 메시지(리스트):

POST /v1/messages
{
  "recipient_type": "individual",
  "to": "whatsapp-id",
  "type": "interactive",
  "interactive":{
    "type": "list",
    "header": {
      "type": "text",
      "text": "your-header-content-here"
    },
    "body": {
      "text": "your-text-message-content-here"
    },
    "footer": {
      "text": "your-footer-content-here"
    },
    "action": {
      "button": "cta-button-content-here",
      "sections":[
        {
          "title":"your-section-title-content-here",
          "rows": [
            {
              "id":"unique-row-identifier-here",
              "title": "row-title-content-here",
              "description": "row-description-content-here",           
            }
          ]
        },
        {
          "title":"your-section-title-content-here",
          "rows": [
            {
              "id":"unique-row-identifier-here",
              "title": "row-title-content-here",
              "description": "row-description-content-here",           
            }
          ]
        },
        ...
      ]
    }
  }

}

인터랙티브 메시지(답장 버튼):

POST /v1/messages
{
  "recipient_type": "individual",
  "to": "whatsapp-id",
  "type": "interactive",
  "interactive": {
    "type": "button",
    "header": { # optional
      "type": "text" | "image" | "video" | "document",
      "text": "your text"
      # OR
      "document": {
        "id": "your-media-id",
        "filename": "some-file-name"
      }
      # OR
      "document": {
        "link": "the-provider-name/protocol://the-url",
        "provider": {
          "name": "provider-name",
        },
        "filename": "some-file-name"
      },
      # OR
      "video": {
        "id": "your-media-id"
      }
      # OR
      "video": {
        "link": "the-provider-name/protocol://the-url",
        "provider": {
          "name": "provider-name"
        }
      }
      # OR
      "image": {
        "id": "your-media-id"
      }
      # OR
      "image": {
        "link": "http(s)://the-url",
        "provider": {
          "name": "provider-name"
        }
      }
    }, # end header
    "body": {
      "text": "your-text-body-content"
    },
    "footer": { # optional
      "text": "your-text-footer-content"
    },
    "action": {
      "buttons": [
        {
          "type": "reply",
          "reply": {
            "id": "unique-postback-id",
            "title": "First Button’s Title" 
          }
        },
        {
          "type": "reply",
          "reply": {
            "id": "unique-postback-id",
            "title": "Second Button’s Title" 
          }
        }
      ] 
    } # end action   
  } # end interactive

}

인터랙티브 메시지(다중 및 단일 제품 메시지):

{ 
  "recipient_type": "individual",
  "to" : "{{Recipient-WA-ID}}",
  "type": "interactive",
  "interactive": {
    "type": "product",
    "body": {
      "text": "body text"
    },
    "footer": {
      "text": "footer text"
    },
    "action": {
      "
      
      _id": "catalog-ID",
      "product_retailer_id": "product-ID"
    }
  }
}

인터랙티브 메시지(다중 제품 메시지):

{ 
  "recipient_type": "individual",
  "to" : "whatsapp-id",
  "type": "interactive",
  "interactive": 
    {
    "type": "product_list",
    "Header":{
       "type": "text",
        "text": "text-header-content"
     },
     "body":{
        "text": "text-body-content"
      },
     "footer":{
        "text":"text-footer-content"
     },
     "action":{
        "catalog_id":"catalog-id",
        "sections": [
             {
             "title": "section-title",             
             "product_items": [
                  { "product_retailer_id": "product-SKU-in-catalog" },
                  { "product_retailer_id": "product-SKU-in-catalog" },
                            ...
              ]},
              {
              "title": "the-section-title",
              "product_items": [
                 { "product_retailer_id": "product-SKU-in-catalog" }
                           ...
              ]},
               ...
       ]
     },  
    }
}

인터랙티브 메시지(카탈로그 메시지):

{ 
  "recipient_type": "individual",
  "to" : "whatsapp-id",
  "type": "interactive",
  "interactive": 
    {
    "type": "catalog_message",
     "body":{
        "text": "text-body-content"
      },
     "footer":{
        "text":"text-footer-content"
     },
     "action":{
        "name": "catalog_message",
      	"parameters":{ 
      	  "thumbnail_product_retailer_id": "product-SKU-in-catalog"
      	}
     },  
    }
}

인터랙티브 메시지(플로):

{
  "recipient_type": "individual",
  "to": "{{Recipient-WA-ID}}",
  "type": "interactive",
  "interactive": {
    "type": "flow",
    "header": {
      "type": "text",
      "text": "Flow message header"
    },
    "body": {
      "text": "Flow message body"
    },
    "footer": {
      "text": "Flow message footer"
    },
    "action": {
      "name": "flow",
      "parameters": {
        "flow_message_version": "3",
        "flow_token": "AQAAAAACS5FpgQ_cAAAAAD0QI3s",
        "flow_id": "<FLOW_ID>",
        "flow_cta": "Book!",
        "flow_action": "navigate",
        "flow_action_payload": {
          "screen": "<SCREEN_ID>",
          "data": { # optional
            "user_name": "name",
            "user_age": 25
          }
        }
      }
    }
  }
}

응답의 payload 예시는 다음과 같습니다. 메타와 오류 개체는 간결함을 위해 생략했습니다.

{
  "messages": [{ 
    "id": "message-id" 
  }]    
}

요청이 성공하면 메시지 ID가 포함된 응답을 수신합니다. 요청이 errors 섹션을 반환하면 원본 메시지를 확인하고 오류를 수정한 다음 요청을 다시 보내세요. 오류에 대한 자세한 내용은 WhatsApp Business 온프레미스/참조 클라이언트 오류 코드HTTP 상태 코드를 참조하세요.

2023년 9월 12일부터 브라질, 콜롬비아, 싱가포르의 비즈니스에 적용됩니다. 2023년 10월 12일부터 모든 비즈니스에 적용됩니다.

품질 평가를 위해 요청이 보류되는 경우, 메시지가 즉시 전송되지 않았고 품질이 검증된 후에 전송되거나 드롭될 것임을 나타내는 메시지와 함께 message_status 속성이 응답에 포함됩니다. 이 속성은 메시지가 보류되는 경우에만 존재합니다.

    {
      "messages": [{ 
        "id": "message-id",
        "message_status": "Message has been held because quality assessment is pending",
      }]    
    }
    

문자 메시지에서 형식화

WhatsApp은 메시지에서 몇 가지 형식화가 가능합니다. 전체 또는 일부 메시지를 형식화하려면 다음의 형식화 기호를 사용하세요.

형식 지정기호

굵게

별표(*)

합계는 *$10.50*입니다.

기울임

밑줄(_)

_WhatsApp_에 오신 것을 환영합니다!

가운데 줄

물결표(~)

~더 나은 것~ 최고입니다!

Code

백틱 3개(```)

```print 'Hello World';```

성능

이 경우 성능은 WhatsApp Business 온프레미스/참조 클라이언트를 사용하여 1초에 보낼 수 있는 메시지 수를 나타냅니다. 달성 가능한 최대 성능은 여러 가지 요소에 따라 달라집니다. 클라이언트 설정으로 무엇을 선택했는지, 메시지가 새로운 사용자 또는 기존 사용자에게 전송되었는지 여부가 가장 중요합니다. 새로운 사용자에게 메시지를 보낼 때 암호화 세션 설정은 시간이 다소 오래 걸릴 수 있습니다.

클라이언트 설정초당 지원되는 메시지 개수

싱글 샤드

70

멀티 샤드(32개)

250

FAQ

참고: WhatsApp Business API를 사용하여 동일한 수신자에게 반복적으로 동일한 메시지를 보내지 마세요.

전달률이 100%가 아닌 이유는 여러 가지가 있을 수 있습니다. 일반적인 사례로는 사용자가 네트워크에 산발적으로 액세스하거나, 일정 기간 비활성화 상태이거나 좋은 품질의 사용자 경험을 만들기 위해 전달되지 않은 경우가 있습니다.

WhatsApp으로 전송 가능한 메시지는 전달률이 매우 높습니다. 그러나 메시지가 전달되지 않는 이유는 여러 가지가 있습니다. 콜백을 모니터링하면 메시지의 정확한 상태에 액세스할 수 있습니다. 예를 들어 이는 SMS로 메시지를 전송하는 것과는 다른데, SMS로 메시지를 전송할 때는 최종 전달된 상태에 액세스할 수 없고 메시지를 다시 전송하면 다른 결과를 초래할 수 있습니다.

메시지가 전달되지 않은 이유는 사용자의 전화기를 사용할 수 없거나, 배터리가 모두 소모되었거나, 전화기를 분실해서 새로운 전화기를 구매했고 SIM을 비활성화했기 때문일 수 있습니다. 비즈니스 클라이언트가 네트워크에 연결하는 기능에 오류가 발생했을 수도 있습니다. 또한 콜백(Webhooks)이 전송되지 않았을 수도 있습니다. health 노드를 사용하여 이러한 상황을 모니터링할 수 있습니다. 서버 수신 콜백을 활성화하면 메시지가 WhatsApp 서버 클라우드로 전달되었는지 알 수 있습니다.

사용자가 네트워크에 다시 연결하면 전송한 모든 메시지가 전달됩니다. 동일한 내용의 메시지를 2번 이상 수신하는 것은 사용자에게 불쾌한 경험을 제공합니다. 그러면 사용자가 차단하거나 불만을 접수할 가능성이 크고 비즈니스가 차단될 가능성이 더욱 커집니다.

메시지를 전송하고 API로부터 메시지 ID를 받았다면 이 메시지 전송을 위해 할 수 있는 일을 완료한 것입니다. 동일한 내용을 동일한 수신자에게 다시 보내지 마세요.

오랫동안 전달률이 낮게 유지되면 기술 지원에 지원 티켓을 제출하세요.

메시지를 전송하는 즉시 메시지 ID로 돌아갑니다. 즉, 메시지 요청이 데이터베이스에 저장된 것을 의미합니다. WhatsApp Business API 클라이언트는 WhatsApp 서버에서 승인할 때까지 해당 메시지의 전송을 계속 시도합니다. 이 프로세스는 종료 시간이 정해져 있지 않습니다. 그러면 WhatsApp 서버에서 사용자 전화기로 해당 메시지를 전송하려고 시도할 것입니다. 사용자의 전화기가 온라인 상태가 아니라면 메시지는 30일간 보관되었다가 WhatsApp 서버에서 폐기합니다.

예! WhatsApp에서는 메시지 안의 선택된 텍스트를 굵게, 기울임, 취소선 또는 고정 너비로 서식을 지정할 수 있습니다.

현재로서는 비즈니스를 차단한 사용자의 수 또는 사용자의 신원을 확인할 방법이 없습니다. 가장 좋은 지표는 상태 콜백을 수신하는 것입니다. delivered 상태가 수신되지 않는 경우, 해당 사용자가 비즈니스를 차단했거나 네트워크에 연결되지 않은 것입니다. 자세한 내용은 Webhook 문서를 참조하세요.

사용자가 비즈니스를 차단한 경우, 연락처 API가 계속해서 해당 전화번호를 유효한 WhatsApp 사용자로 반환합니다. 그러나 메시지를 전송하면 전달되지 않습니다. 메시지가 유료 메시지인 경우, 요금이 부과되지 않습니다.

아니요, 메시지가 도착하는 순서는 보낸 순서와 동일하게 보장되지 않습니다. 사용 사례에서 순서가 중요한 경우 첫 번째 메시지의 전송된 콜백을 수신한 다음, 두 번째 메시지를 보내는 것이 좋습니다.

messages 노드를 사용하면 WhatsApp Business API 클라이언트의 Content-Type 헤더를 application/json로 설정해야 메시지 본문을 적절히 파싱할 수 있습니다. Authorization 헤더도 설정해야 하고 만료되지 않은 액세스 토큰을 포함해야 합니다. 토큰을 얻는 방법과 만료 시점에 대한 자세한 내용은 로그인 및 인증 문서를 참조하세요.

고객 문의를 처리하는 데 더 많은 시간이 필요하고 24시간이 지난 이후에만 응답을 할 수 있는 경우가 있습니다. 다음과 같이 메시지 템플릿을 생성해서 처리하는 것이 좋습니다.

  • 사용자에게 결과를 전달합니다.
  • 또는 고객 서비스 창을 활성화하기 위해 답장할 사용자를 호출합니다.

두 경우 모두 메시지 템플릿에 최대한 많은 컨텍스트를 제공하세요. 예를 들면 다음과 같습니다.

  • "{{1}} 님, 안녕하세요. 앞서 신고한 문제와 관련하여 유감스럽지만 {{2}}임을 알려드립니다. 불편을 끼쳐드려 죄송합니다."
  • 관련 티켓을 업데이트했습니다. 지원을 계속 받으시려면 회신해주세요."