このドキュメントが更新されました。
日本語への翻訳がまだ完了していません。
英語の最終更新: 2月1日

メッセージ

/PHONE_NUMBER_ID/messagesエンドポイントを使って、テキストメッセージ、メディアメッセージ、連絡先メッセージ、位置情報メッセージ、インタラクティブメッセージ、ならびにメッセージテンプレートをカスタマーに送信します。送信できるメッセージについて詳しくは、こちらをご覧ください

エンドポイント認証

/PHONE_NUMBER_ID/messages

(電話番号IDの取得をご覧ください)

Developers can authenticate their API calls with the access token generated in the App Dashboard > WhatsApp > API Setup.


Solution Partners must authenticate themselves with an access token with the whatsapp_business_messaging permission.

メッセージは固有のID(WAMID)によって識別されます。WAMIDでWebhooksのメッセージステータスを追跡できます。受信メッセージをメッセージエンドポイントで既読にすることもできます。このWAMIDでは最大128文字まで使用することができます。

クラウドAPIによって、電話番号にWhatsApp IDがあるかどうかを明示的に確認する手段はなくなりました。クラウドAPIを使ってメッセージを送信する場合は、お客様の電話番号に直接送信するだけです。ただしそれは、お客様が事前にオプトインしていることが条件です。その例については、リファレンス、メッセージをご覧ください。

メッセージオブジェクト

メッセージを送信するには、まず送信する内容を含むメッセージオブジェクトを編成する必要があります。messageオブジェクトで使用されるパラメーターです:

名前説明(指定できるオプションについては、左側の列の矢印をクリックしてください。)

audio

オブジェクト

type=audioの時に必須。

オーディオを含むmediaオブジェクト

biz_opaque_callback_data

文字列

任意。

トラッキングに便利な任意の文字列。


例えば、このフィールドにメッセージテンプレートIDを渡して、最初に顧客に送信したメッセージから始まるカスタマージャーニーを追跡できます。その後、様々なメッセージテンプレートタイプのROIを追跡して、最も効果的なタイプを決定できます。


WhatsApp Business Accountのmessages Webhookフィールドにサブスクリプション登録しているすべてのアプリは、この文字列を、Webhookペイロード内のstatusesオブジェクトに含まれているかのように、取得できます。


クラウドAPIはこのフィールドを処理するのではなく、送信/配信/読み取りメッセージWebhookの一部として返します。


最大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オブジェクトの構成要素は、一般的に次の一貫したパターンに従います: headerbodyfooteraction

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ピクセルである必要があり、100 KBを超えることはできません。アニメーション付きスタンプは512x512ピクセルである必要があり、500 KBを超えることはできません。


オンプレミスAPI: あらゆる種類のインバウンドスタンプに加えて、静的なサードパーティアウトバウンドスタンプのみに対応しています。静的スタンプは512x512ピクセルである必要があり、100 KBを超えることはできません。アニメーション付きスタンプはサポートされていません。

template

オブジェクト

type=templateの時に必須。

templateオブジェクト

text

オブジェクト

テキストメッセージに必要。

textオブジェクト

to

文字列

必須。

メッセージを送信したい顧客のWhatsApp IDまたは電話番号。電話番号のフォーマットをご覧ください。


必要に応じて、オンプレミスAPIユーザーは、contactsエンドポイントに電話してこの番号を取得できます。

type

文字列

任意。

送りたいメッセージのタイプ。省略すると、デフォルトで textになります。

以下のオブジェクトがメッセージオブジェクト内にネストされています:

連絡先オブジェクト

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.

インタラクティブオブジェクト

名前説明

action

オブジェクト

必須。

メッセージを読んだ後にユーザーに実行してほしいアクション。

body

オブジェクト

タイプがproductの場合は任意。その他のメッセージタイプの場合は必須。

メッセージ本文を持つオブジェクト。


bodyオブジェクトには以下のフィールドが含まれています:

text文字列本文がある場合必須。メッセージの内容。絵文字とマークダウンがサポートされています。最大長: 1024文字。

footer

オブジェクト

任意。メッセージのフッターを持つオブジェクト。


footerオブジェクトには以下のフィールドが含まれています:

text文字列フッターがある場合必須。フッターの内容。絵文字、マークダウン、リンクがサポートされています。最大長: 60文字。

header

オブジェクト

タイプがproduct_listの場合に必須。その他のタイプでは任意。

メッセージ上部に表示されるヘッダーの内容。インタラクティブオブジェクトのタイプがproductの場合、ヘッダーは設定できません。詳しくは、headerオブジェクトをご覧ください。

type

オブジェクト

必須。

送信するインタラクティブメッセージのタイプ。使用できる値:


  • button: 返信ボタンで使用。
  • catalog_message: カタログメッセージで使用。
  • list: リストメッセージで使用。
  • product: 単一商品メッセージで使用。
  • product_list: 複数商品メッセージで使用。
  • flow: Flowsメッセージで使用。

以下のオブジェクトがinteractiveオブジェクト内にネストされています:

アクションオブジェクト

名前説明

button

文字列

リストメッセージの場合に必須。

ボタンの内容。これを空の文字列にすることはできません。また、メッセージ内で固有でなければなりません。絵文字がサポートされています。マークダウンはサポートされていません。


最大長: 20文字。

buttons

オブジェクトの配列

返信ボタンの場合に必須。

ボタンオブジェクトには、以下のパラメーターを含めることができます:


  • type: サポートされるタイプはreplyだけです(返信ボタンの場合)
  • title: ボタンのタイトル。これを空の文字列にすることはできません。また、メッセージ内で固有でなければなりません。絵文字がサポートされています。マークダウンはサポートされていません。最大長: 20文字。
  • id: ボタンに固有のID。このIDは、ユーザーがボタンをクリックした時点でWebhookで返されるものです。最大長: 256文字。

ボタンは3つまでです。IDを設定する際、先頭または末尾のスペースは使用できません。

catalog_id

文字列

単一商品メッセージと複数商品メッセージの場合に必須。

自分のWhatsApp BusinessアカウントにリンクされているFacebookカタログの固有ID。このIDはMetaコマースマネージャで取得できます。

product_retailer_id

文字列

単一商品メッセージと複数商品メッセージの場合に必須。

カタログの商品の固有ID。


このIDを取得するには、Metaコマースマネージャに移動し、Metaビジネスアカウントを選択してください。アカウントに関連付けられているショップのリストが表示されます。使用するショップをクリックします。左側のパネルで、[カタログ] > [アイテム]をクリックし、メンションしたいアイテムを見つけます。そのアイテムのIDが、アイテム名の下に表示されています。

sections

オブジェクトの配列

リストメッセージと複数商品メッセージの場合に必須。

sectionオブジェクトの配列。最低1、最大10。sectionオブジェクトをご覧ください。

mode

文字列

Flowsメッセージの場合に任意。

Flowの現在のモードは、draftまたは publishedです。


デフォルト: published

flow_message_version

文字列

Flowsメッセージの場合に必須。

3でなければなりません。

flow_token

文字列

Flowsメッセージの場合に必須。

識別子として機能するようビジネスによって生成されるトークン。

flow_id

文字列

Flowsメッセージの場合に必須。

WhatsAppが提供するFlowの一意の識別子。

flow_cta

文字列

Flowsメッセージの場合に必須。

CTAボタンのテキストの例「登録」


最大文字: 20文字(絵文字なし)。

flow_action

文字列

Flowsメッセージの場合に任意。

navigateまたはdata_exchange。最初の画面をメッセージの一部として事前定義するにはnavigateを使用します。最初の画面がエンドポイントで提供される高度なユースケースには、data_exchangeを使用してください。


デフォルト: navigate

flow_action_payload

オブジェクト

Flowsメッセージの場合に任意。

flow_actionnavigateの場合のみ必須。オブジェクトには、以下のパラメーターを含めることができます:

screen文字列必須。Flowの最初の画面のid

dataオブジェクト任意。Flowの最初の画面の入力データ。空でないオブジェクトでなければなりません。

Headerオブジェクト

名前説明

document

オブジェクト

typedocumentに設定されている場合に必須。

そのドキュメントのメディアオブジェクトが入ります。

image

オブジェクト

typeimageに設定されている場合に必須。

その画像のメディアオブジェクトが入ります。

text

文字列

typetextに設定されている場合に必須。

ヘッダーのテキスト。書式設定で絵文字は使用できますが、マークダウンは使用できません。


最大長: 60文字。

type

文字列

必須。

使用するヘッダーのタイプ。使用できる値:


  • text: リストメッセージ、返信ボタン、および複数商品メッセージの場合に使用。
  • video: 返信ボタンに使用。
  • image: 返信ボタンに使用。
  • document: 返信ボタンに使用。

video

オブジェクト

typevideoに設定されている場合に必須。

その動画のメディアオブジェクトが入ります。

Sectionオブジェクト

名前説明

product_items

オブジェクトの配列

複数商品メッセージの場合に必須。

productオブジェクトの配列。セクションあたり最低1商品、すべてのセクションで最大30商品があります。


productオブジェクトには以下のフィールドが含まれています:


  • product_retailer_id文字列複数商品メッセージの場合に必須。カタログの商品の固有ID。このIDを取得するには、Metaコマースマネージャに移動し、アカウントと使用するショップを選択してください。次に、[カタログ] > [アイテム]をクリックし、メンションしたいアイテムを見つけます。そのアイテムのIDが、アイテム名の下に表示されています。

rows

オブジェクトの配列

リストメッセージの場合に必須。

行のリストが入ります。セクション全体に合計10行を含めることができます。


各行にはタイトル(最大長: 24文字)とID(最大長: 200文字)が必要です。説明(最大長: 72文字)を追加することができますが、これは任意です。


例:

"rows": [
  {
   "id":"unique-row-identifier-here",
   "title": "row-title-content-here",
   "description": "row-description-content-here",           
   }
]

title

文字列

メッセージに複数のセクションがある場合に必須。

セクションのタイトル。


最大長: 24文字。

位置情報オブジェクト

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.

メディアオブジェクト

メディアオブジェクトのIDを取得する方法については、メディアIDを取得をご覧ください。クラウドAPIのサポートされるメディアタイプについては、サポートされるメディアタイプをご覧ください。

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.

テンプレートオブジェクト

スレッドベースの価格設定が変更されました。新しいスレッドベースの価格設定モデルの仕組みについては、価格設定をご覧ください。

さらに、metric_typesの可視性が2023年7月1日から変更されました。詳細はスレッド分析表をご覧ください。

NameDescription

name

Required.

Name of the template.

language

object

Required.

Contains a language object. Specifies the language the template may be rendered in.


The language object can contain the following fields:

policystringRequired. The language policy the message should follow. The only supported option is deterministic. See Language Policy Options.

codestringRequired. The code of the language or locale to use. Accepts both language and language_locale formats (e.g., en and en_US). For all codes, see Supported Languages.

components

array of objects

Optional.

Array of components objects containing the parameters of the message.

namespace

Optional. Only used for On-Premises API.

Namespace of the template.

以下のオブジェクトがtemplateオブジェクト内にネストされています:

ボタンパラメーターオブジェクト

名前説明 (指定できるオプションについては、左側の列の矢印をクリックしてください。)

type

文字列

必須。

ボタンのパラメーターの型を示します。

サポートされているオプション

  • "payload"
  • "text"

payload

quick_replyボタンの場合に必須。

ボタンがクリックされると、ボタンの表示テキストに加えて返される、開発者が定義したペイロード。


例については、クイック返信ボタンのクリックによるコールバックをご覧ください。

text

URLボタンの場合に必須。

テンプレート内の事前定義済みのプレフィックスURLに追加される、開発者が提供するサフィックス。

コンポーネントオブジェクト

NameDescription (Click the arrow in the left column for supported options.)

type

string

Required.

Describes the component type.


Example of a components object with an array of parameters object nested inside:

 "components": [{
   "type": "body",
   "parameters": [{
                "type": "text",
                "text": "name"
            },
            {
            "type": "text",
            "text": "Hi there"
            }]
      }] 

Supported Options

  • header
  • body
  • button

For text-based templates, we only support the type=body.

sub_type

string

Required when type=button. Not used for the other types.

Type of button to create.

Supported Options

  • quick_reply: Refers to a previously created quick reply button that allows for the customer to return a predefined message.
  • url: Refers to a previously created button that allows the customer to visit the URL generated by appending the text parameter to the predefined prefix URL in the template.
  • catalog: Refers to a previously created catalog button that allows for the customer to return a full product catalog.

parameters

array of objects

Required when type=button.

Array of parameter objects with the content of the message.

For components of type=button, see the button parameter object.

index

Required when type=button. Not used for the other types.

Position index of the button. You can have up to 10 buttons using index values of 0 to 9.

通貨オブジェクト

名前説明

fallback_value

必須。

ローカライズが失敗した場合のデフォルトテキスト。

code

必須。

ISO 4217で定義されている通貨コード。

amount_1000

必須。

金額に1000を掛けた値。

Date_Timeオブジェクト

名前説明

fallback_value

必須。

デフォルトのテキスト。クラウドAPIの場合は、常にフォールバック値を使用し、他のオプションのフィールドを使用してローカライズしようとはしません。

パラメーターオブジェクト

名前説明

type

文字列

必須。

パラメーターの型を説明します。使用できる値:


  • currency
  • date_time
  • document
  • image
  • text
  • video

テキストベースのテンプレートでは、サポートされるパラメーターの型はcurrencydate_timetextのみです。

text

文字列

type=textの時に必須。

メッセージのテキスト。文字数制限は、含まれる以下のコンポーネントの型によって異なります。


headerコンポーネントの型の場合:

  • 60文字

bodyコンポーネントの型の場合:

  • 他のコンポーネントの型が含まれている場合、1024文字
  • bodyが、含まれる唯一のコンポーネントの型の場合、32768文字

currency

オブジェクト

type=currencyの時に必須。

currencyオブジェクト

date_time

オブジェクト

type=date_timeの時に必須。

date_timeオブジェクト

image

オブジェクト

type=imageの時に必須。

imageの型のmediaオブジェクト。メディアテンプレートで使用する場合、キャプションはサポートされません。

document

オブジェクト

type=documentの時に必須。

documentの型のmediaオブジェクト。メディアベースのメッセージテンプレートではPDFドキュメントのみサポートされています。メディアテンプレートで使用する場合、キャプションはサポートされません。

video

オブジェクト

type=videoの時に必須。

videoの型のmediaオブジェクト。メディアテンプレートで使用する場合、キャプションはサポートされません。

テキストオブジェクト

名前説明

body

文字列

テキストメッセージの場合に必須。

http://またはhttps://で始まるURLとフォーマットを含めることができるテキストメッセージのテキスト。利用可能なフォーマットオプションについては、こちらをご覧ください。


テキストにURLを含めて、テキストメッセージ(preview_url: true)にプレビューボックスを含める場合は、URLがhttp://またはhttps://で始まることを確認してください。https://のURLが優先されます。IPアドレスが一致しないので、ホスト名を含める必要があります。


最大文字: 4096文字

preview_url

ブーリアン

任意。クラウドAPIのみ。

trueに設定すると、WhatsApp Messenger プリとWhatsApp Businessアプリがbodyテキスト文字列内の任意のURLのリンクプレビューをレンダリングしようとします。URLはhttp://またはhttps://で始まる必要があります。bodyテキスト文字列に複数のURLが含まれている場合は、最初のURLのみがレンダリングされます。


preview_urlが省略されたり、プレビューを取得できない場合は、クリック可能なリンクが代わりにレンダリングされます。


オンプレミスAPIユーザーは、代わりにトップレベルのメッセージペイロードでpreview_urlを使用してください。パラメーターをご覧ください。

リアクションオブジェクト

名前説明

message_id

文字列

必須

リアクションが表示されるメッセージのWhatsAppメッセージID(wamid)。次の場合、リアクションは送信されません:


  • メッセージが30日以上前のもの
  • メッセージがリアクションメッセージ
  • メッセージが削除された

削除されたメッセージのIDの場合、メッセージは配信されません。

emoji

文字列

必須

メッセージに表示される絵文字


  • AndroidとiOSデバイスでサポートされているすべての絵文字がサポートされています。
  • レンダリング絵文字がサポートされています。
  • 絵文字のUnicode値を使用する場合、値はJava-またはJavaScript-エスケープでエンコードされている必要があります。
  • リアクションメッセージで送信できる絵文字は1つだけです。
  • 空の文字列を使用して、過去に送信された絵文字を削除します。

概要

ガイド

/messagesエンドポイントを使用してメッセージを送信する方法についての完全な情報については、次のガイドを参照してください。

SMS

curl -X  POST \
'https://graph.facebook.com/v19.0/FROM_PHONE_NUMBER_ID/messages' \
-H 'Authorization: Bearer ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '
    {
      "messaging_product": "whatsapp",
      "recipient_type": "individual",
      "to": "PHONE_NUMBER",
      "type": "text",
      "text": { // the text object
        "preview_url": false,
        "body": "MESSAGE_CONTENT"
        }
    }'

リアクションメッセージ

curl -X  POST \
 'https://graph.facebook.com/v19.0/FROM_PHONE_NUMBER_ID/messages' \
 -H 'Authorization: Bearer ACCESS_TOKEN' \
 -H 'Content-Type: application/json' \
 -d '{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to": "PHONE_NUMBER",
  "type": "reaction",
  "reaction": {
    "message_id": "wamid.HBgLM...",
    "emoji": "\uD83D\uDE00"
  }
}'

メディアメッセージ

curl -X  POST \
 'https://graph.facebook.com/v19.0/FROM-PHONE-NUMBER-ID/messages' \
 -H 'Authorization: Bearer ACCESS_TOKEN' \
 -H 'Content-Type: application/json' \
 -d '{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to": "PHONE-NUMBER",
  "type": "image",
  "image": {
    "id" : "MEDIA-OBJECT-ID"
  }
}'

位置情報メッセージ

curl -X  POST \
 'https://graph.facebook.com/v19.0/FROM_PHONE_NUMBER_ID/messages' \
 -H 'Authorization: ACCESS_TOKEN' \
 -H 'Content-Type: application/json' \
 -d '{
  "messaging_product": "whatsapp",
  "to": "PHONE_NUMBER",
  "type": "location",
  "location": {
    "longitude": LONG_NUMBER,
    "latitude": LAT_NUMBER,
    "name": LOCATION_NAME,
    "address": LOCATION_ADDRESS
  }
}'

連絡先メッセージ

curl -X  POST \
 'https://graph.facebook.com/v19.0/FROM_PHONE_NUMBER_ID/messages' \
 -H 'Authorization: ACCESS_TOKEN' \
 -H 'Content-Type: application/json' \
 -d '{
  "messaging_product": "whatsapp",
  "to": "PHONE_NUMBER",
  "type": "contacts",
  "contacts": [{
      "addresses": [{
          "street": "STREET",
          "city": "CITY",
          "state": "STATE",
          "zip": "ZIP",
          "country": "COUNTRY",
          "country_code": "COUNTRY_CODE",
          "type": "HOME"
        },
        {
          "street": "STREET",
          "city": "CITY",
          "state": "STATE",
          "zip": "ZIP",
          "country": "COUNTRY",
          "country_code": "COUNTRY_CODE",
          "type": "WORK"
        }],
      "birthday": "YEAR_MONTH_DAY",
      "emails": [{
          "email": "EMAIL",
          "type": "WORK"
        },
        {
          "email": "EMAIL",
          "type": "HOME"
        }],
      "name": {
        "formatted_name": "NAME",
        "first_name": "FIRST_NAME",
        "last_name": "LAST_NAME",
        "middle_name": "MIDDLE_NAME",
        "suffix": "SUFFIX",
        "prefix": "PREFIX"
      },
      "org": {
        "company": "COMPANY",
        "department": "DEPARTMENT",
        "title": "TITLE"
      },
      "phones": [{
          "phone": "PHONE_NUMBER",
          "type": "HOME"
        },
        {
          "phone": "PHONE_NUMBER",
          "type": "WORK",
          "wa_id": "PHONE_OR_WA_ID"
        }],
      "urls": [{
          "url": "URL",
          "type": "WORK"
        },
        {
          "url": "URL",
          "type": "HOME"
        }]
    }]
}'

インタラクティブメッセージ

単一商品メッセージ

curl -X  POST \
 'https://graph.facebook.com/v19.0/FROM_PHONE_NUMBER/messages' \
 -H 'Authorization: Bearer ACCESS_TOKEN' \
 -H 'Content-Type: application/json' \
 -d '{
   "messaging_product": "whatsapp",
   "recipient_type": "individual",
   "to": "PHONE_NUMBER",
   "type": "interactive",
   "interactive": {
     "type": "product",
     "body": {
       "text": "optional body text"
     },
     "footer": {
       "text": "optional footer text"
     },
     "action": {
       "catalog_id": "CATALOG_ID",
       "product_retailer_id": "ID_TEST_ITEM_1"
     }
   }
 }'

複数商品メッセージ

curl -X  POST \
 'https://graph.facebook.com/v19.0/FROM_PHONE_NUMBER/messages' \
 -H 'Authorization: Bearer ACCESS_TOKEN' \
 -H 'Content-Type: application/json' \
 -d '{
 "messaging_product": "whatsapp",
   "recipient_type": "individual",
   "to": "PHONE_NUMBER",
   "type": "interactive",
   "interactive": {
     "type": "product_list",
     "header":{
       "type": "text",
       "text": "header-content"
     },
     "body": {
       "text": "body-content"
     },
     "footer": {
       "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": "section-title",
           "product_items": [
             { "product_retailer_id": "product-SKU-in-catalog" },
             { "product_retailer_id": "product-SKU-in-catalog" },
             ...
           ]
         }
       ]
     }
   }
 }

カタログメッセージ

curl -X  POST \
 'https://graph.facebook.com/v19.0/FROM_PHONE_NUMBER/messages' \
 -H 'Authorization: Bearer ACCESS_TOKEN' \
 -H 'Content-Type: application/json' \
 -d '{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to": "PHONE_NUMBER",
  "type": "interactive",
  "interactive" : {
    "type" : "catalog_message",
    "body" : {
      "text": "Thanks for your order! Tell us what address you’d like this order delivered to."
    },
    "action": {
      "name": "catalog_message",
      "parameters": { 
        "thumbnail_product_retailer_id": "<Product-retailer-id>"
      }
    }
  }
}'

Flowsメッセージ

curl -X  POST \
 'https://graph.facebook.com/v19.0/FROM_PHONE_NUMBER/messages' \
 -H 'Authorization: Bearer ACCESS_TOKEN' \
 -H 'Content-Type: application/json' \
 -d '{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to": "PHONE_NUMBER",
  "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": {
            "user_name": "name",
            "user_age": 25
          }
        }
      }
    }
  }
}'
  

リストメッセージ

curl -X  POST \
 'https://graph.facebook.com/v19.0/FROM_PHONE_NUMBER_ID/messages' \
 -H 'Authorization: Bearer ACCESS_TOKEN' \
 -H 'Content-Type: application/json' \
 -d '{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to": "PHONE_NUMBER",
  "type": "interactive",
  "interactive": {
    "type": "list",
    "header": {
      "type": "text",
      "text": "HEADER_TEXT"
    },
    "body": {
      "text": "BODY_TEXT"
    },
    "footer": {
      "text": "FOOTER_TEXT"
    },
    "action": {
      "button": "BUTTON_TEXT",
      "sections": [
        {
          "title": "SECTION_1_TITLE",
          "rows": [
            {
              "id": "SECTION_1_ROW_1_ID",
              "title": "SECTION_1_ROW_1_TITLE",
              "description": "SECTION_1_ROW_1_DESCRIPTION"
            },
            {
              "id": "SECTION_1_ROW_2_ID",
              "title": "SECTION_1_ROW_2_TITLE",
              "description": "SECTION_1_ROW_2_DESCRIPTION"
            }
          ]
        },
        {
          "title": "SECTION_2_TITLE",
          "rows": [
            {
              "id": "SECTION_2_ROW_1_ID",
              "title": "SECTION_2_ROW_1_TITLE",
              "description": "SECTION_2_ROW_1_DESCRIPTION"
            },
            {
              "id": "SECTION_2_ROW_2_ID",
              "title": "SECTION_2_ROW_2_TITLE",
              "description": "SECTION_2_ROW_2_DESCRIPTION"
            }
          ]
        }
      ]
    }
  }
}'

返信ボタン

curl -X  POST \
 'https://graph.facebook.com/v19.0/FROM_PHONE_NUMBER_ID/messages' \
 -H 'Authorization: Bearer ACCESS_TOKEN' \
 -H 'Content-Type: application/json' \
 -d '{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to": "PHONE_NUMBER",
  "type": "interactive",
  "interactive": {
    "type": "button",
    "body": {
      "text": "BUTTON_TEXT"
    },
    "action": {
      "buttons": [
        {
          "type": "reply",
          "reply": {
            "id": "UNIQUE_BUTTON_ID_1",
            "title": "BUTTON_TITLE_1"
          }
        },
        {
          "type": "reply",
          "reply": {
            "id": "UNIQUE_BUTTON_ID_2",
            "title": "BUTTON_TITLE_2"
          }
        }
      ]
    }
  }
}'

テンプレートメッセージ

スレッドベースの価格設定が変更されました。新しいスレッドベースの価格設定モデルの仕組みについては、価格設定をご覧ください。

さらに、metric_typesの可視性が2023年7月1日から変更されました。詳細はスレッド分析表をご覧ください。

curl -X  POST \
 'https://graph.facebook.com/v19.0/FROM_PHONE_NUMBER_ID/messages' \
 -H 'Authorization: Bearer ACCESS_TOKEN' \
 -H 'Content-Type: application/json' \
 -d '{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to": "PHONE_NUMBER",
  "type": "template",
  "template": {
    "name": "TEMPLATE_NAME",
    "language": {
      "code": "LANGUAGE_AND_LOCALE_CODE"
    },
    "components": [
      {
        "type": "header",
        "parameters": [
          {
            "type": "image",
            "image": {
              "link": "http(s)://URL"
            }
          }
        ]
      },
      {
        "type": "body",
        "parameters": [
          {
            "type": "text",
            "text": "TEXT_STRING"
          },
          {
            "type": "currency",
            "currency": {
              "fallback_value": "VALUE",
              "code": "USD",
              "amount_1000": NUMBER
            }
          },
          {
            "type": "date_time",
            "date_time": {
              "fallback_value": "MONTH DAY, YEAR"
            }
          }
        ]
      },
      {
        "type": "button",
        "sub_type": "quick_reply",
        "index": "0",
        "parameters": [
          {
            "type": "payload",
            "payload": "PAYLOAD"
          }
        ]
      },
      {
        "type": "button",
        "sub_type": "quick_reply",
        "index": "1",
        "parameters": [
          {
            "type": "payload",
            "payload": "PAYLOAD"
          }
        ]
      }
    ]
  }
}'

メッセージへの返信

curl -X POST \
 'https://graph.facebook.com/v19.0/FROM_PHONE_NUMBER/messages' \
 -H 'Authorization: Bearer ACCESS_TOKEN' \
 -H 'Content-Type: application/json' \
 -d '{
  "messaging_product": "whatsapp",
  "context": {
     "message_id": "MESSAGE_ID"
  },
  "to": "PHONE_NUMBER",
  "type": "text",
  "text": {
    "preview_url": false,
    "body": "your-text-message-content"
  }
}’

成功した応答

    {
      "messaging_product": "whatsapp",
      "contacts": [
        {
          "input": "16505555555",
          "wa_id": "16505555555"
        }
      ],
      "messages": [
        {
          "id": "wamid.HBgLMTY1MDUwNzY1MjAVAgARGBI5QTNDQTVCM0Q0Q0Q2RTY3RTcA"
        }
      ]
    }
    

Applies to businesses in Brazil, Colombia, and Singapore, starting September 12, 2023. Applies to all businesses starting October 12, 2023.

Messages will have one of the following statuses which will be returned in each of the messages objects

  • "message_status":"accepted" : means the message was sent to the intended recipient
  • "message_status":"held_for_quality_assessment": means the message send was delayed until quality can be validated and it will either be sent or dropped at this point

      {
      "messaging_product": "whatsapp",
      "contacts": [
        {
          "input": "16505555555",
          "wa_id": "16505555555"
        }
      ],
      "messages": [
        {
          "id": "wamid.HBgLMTY1MDUwNzY1MjAVAgARGBI5QTNDQTVCM0Q0Q0Q2RTY3RTcA",
          "message_status": "accepted",
        }
      ]
    }