メッセージ

/v1/messages

messagesノードを使って、テキストメッセージ、メディアメッセージ、連絡先メッセージ、位置情報メッセージ、インタラクティブメッセージ、ならびにメッセージテンプレートをカスタマーに送信します。

送信可能なメッセージの具体的な種類については、テキストメッセージメディアメッセージ連絡先メッセージと位置情報メッセージインタラクティブメッセージメッセージテンプレートメディアメッセージテンプレートインタラクティブメッセージテンプレートのガイドをご覧ください。

開始する前に

以下のことが必要です。

v2.39以降は、メッセージの送信前にcontactsノードを呼び出す必要がなくなりました。

制約

  • メッセージの種類としては、テキスト、メッセージテンプレート、画像、ドキュメント、および音声がサポートされています。
  • テキストメッセージの長さは最大で4096文字です。

作成

メッセージを送信するには、メッセージの種類に関係なく、/messagesノードにPOST呼び出しを実行します。JSONメッセージ本文の内容は、メッセージの種類(テキストや画像など)によって異なります。

パラメーター

/messages POSTリクエストで使用される主なパラメーターは以下のとおりです。

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

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になります。

テキストオブジェクト

名前説明

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の中には、addressesemailsnameorgphoneurlsをオブジェクトとして入れ子にすることができます。複数化オブジェクトは、以下の例に示すように配列でラッピングされます。

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ビジネスAPIクライアントに関連付けられた電話番号を所有するWhatsAppビジネスアカウントに関連付けられた名前空間にしなければなりません。そうでない場合、メッセージの送信は失敗します。

name

必須。

テンプレートの名前。

language

必須。

テンプレートがレンダリングされる言語を指定します。メディアテンプレートメッセージでは、deterministic言語ポリシーのみが有効です。詳しくは、「言語」セクションをご覧ください。

components

任意。

メッセージのパラメーターを含む配列。

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

componentsの中に、parametersオブジェクトをネストできます。さらに、typebuttonに設定することができます。

名前説明

type

必須。

componentタイプを記述します。
値:headerbodyfooter

parameters

任意。

メッセージのコンテンツを含む配列。

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

名前説明

type

必須。

parameterタイプを記述します。
値:textcurrencydate_timeimagedocumentvideo


メディアタイプ(imagedocument、およびvideo)のフォーマットは、標準メディアメッセージで使用されるフォーマットと同じです。詳しくは、メディアのドキュメンテーションをご覧ください。現在、メディアメッセージテンプレートではPDFドキュメントのみサポートされています。


currencyおよびdate_timeについて詳しくは、「ローカライズ可能なパラメーター」セクションをご覧ください。templateメッセージのcurrencyパラメーターとdate_timeパラメーターでは、defaultの代わりにfallback_valueを使用します。上記のリクエスト例を参考にしてください。

ボタンの型

componentsオブジェクトの中で、typebuttonに設定できます。ボタンのパラメーターは次のとおりです。

名前説明

sub_type

必須。

作成するボタンのタイプ:
値:quick_replyurlcopy_code

index

必須。

ボタンの位置インデックス。インデックス値として0-9を使って、最大10個のボタンを設定できます。

parameters

必須。

ボタンのパラメーター。ビジネスマネージャでの作成時に設定されます。次のパラメーターを指定します。

  • type (必須): ボタンのパラメーターのタイプを示します。使用できる値は、payloadtextcoupon_codeです。
  • payload (quick_replyボタンの場合に必須): ボタンがクリックされたときに返される開発者定義のペイロード(ボタンの表示テキスト以外)。
  • text) (urlボタンの場合に必須): 以前に作成されたダイナミックURLボタンに付加される開発者指定のサフィックス。
  • coupon_code (copy_codeボタンの場合に必須): コードコピーボタンをクリックしたときにコピーされる開発者指定のクーポンコード。

sub_typeがquick_replybuttonタイプの例:

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

sub_typeがbuttoncopy_codeタイプの例

    
 { 
    "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

必須。

決定性言語を指定できます。詳しくは、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を設定するときには、前後にスペースがあってはなりません。

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": {
      "catalog_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" }
                           ...
              ]},
               ...
       ]
     },  
    }
}

応答の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では一部メッセージの書式設定ができます。次の書式設定記号を使ってメッセージの一部、または全体の書式を設定します。

書式記号

太字

アスタリスク(*)

ご注文金額の合計は*¥1,050*になります。

斜体

アンダースコア(_)

_WhatsApp_をご利用いただきありがとうございます!

取り消し線

波線(~)

これは~日本一~世界一です。

Code

3連バッククォート(```)

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

パフォーマンス

このコンテキストにおけるパフォーマンスとは、WhatsApp Businessオンプレミス/リファレンスクライアントを使用して特定の1秒間で送信できるメッセージの数を表します。どこまで高いパフォーマンスを達成できるかは、さまざまな要素に応じて異なります。最も重要な要素はクライアント設定の選択、およびメッセージ送信先が新規ユーザーかそれとも既存ユーザーかという点です。暗号化セッションの設定の場合、新規ユーザーとのメッセージングにかかる時間が多少長くなります。

クライアントの設定1秒間にサポートされるテキストメッセージ

単一シャード

70

複数シャード(32シャード)

250

よくある質問

注:WhatsApp Business APIを使用して、同じ受信者に同じメッセージを繰り返し送信しないでください。

配信率が100%でない場合は、いくつかの理由が考えられます。よくあるケースとしては、ネットワークにたまにしかアクセスしないユーザーや、一定期間アクティブでないユーザーがいることや、高品質のユーザーエクスペリエンスを作成すること が挙げられます

WhatsAppで配信可能なメッセージには、配信率が非常に高いという傾向があります。しかし、メッセージが配信されなくなり得る理由はたくさんあります。コールバックをモニタリングすることで、メッセージの正確なステータスを把握することができます。しかし、これは、例えば、SMSでメッセージを送信する場合とは異なります。この場合、最終送信ステータスにアクセスできなかったため、メッセージを再送信すると、まったく異なる結果になる可能性があります

ユーザーの携帯電話が故障している、バッテリ切れである、または携帯電話を紛失したユーザーが新しい携帯電話を入手して以前のSIMを停止したなどの理由で、メッセージが配信されないままになっていることがあります。ビジネスクライアントがネットワークに接続しようとするときにエラーが発生する可能性があります。コールバック(Webhooks)が配信されない可能性もあります。healthノードを使えば、これらの状況をモニタリングすることができます。サーバーの受信コールバックをオンにして、メッセージがWhatsAppサーバークラウドに配信されたことを確認できます。

ユーザーがネットワークに再接続した場合は、送信したメッセージがすべてユーザーに送信されます。同じコンテンツのメッセージを何通も受信することは、ユーザーにとって気持ちのよいことではありません。ユーザーからブロックされたり、クレームを受けたりする確立が高まります。配信登録が解除されかねません。

送信したメッセージに対してAPIからメッセージIDを受け取ったなら、そのメッセージを送信するためにすべきことはすべて完了しています。同じコンテンツを同じ受信者に再送信しないでください。

長期にわたって配信率が低下している場合は、 ダイレクトサポートからサポートチケットを提出してください。

メッセージを送信するとメッセージIDが返されますが、それはメッセージリクエストがデータベースに格納されたことを意味します。WhatsAppビジネスAPIクライアントは、WhatsAppサーバーによって認識されるまで、そのメッセージの送信を試行し続けます。このプロセスに終了期限はありません。次に、WhatsAppサーバーは、メッセージをユーザーの携帯電話に配信しようとします。ユーザーの携帯電話がオンラインでない場合、メッセージは30日間保存された後、WhatsAppサーバーによって破棄されます。

はい、できます。WhatsAppでは、メッセージ内の選択したテキストに、太字、斜体、取り消し線、または等幅のフォーマットを設定することができます。

現時点では、何人のユーザーが、またどのユーザーが、ビジネスをブロックしたかを知る方法はありません。最良の指標としては、ステータスコールバックをリッスンし、deliveredステータスを受け取らない場合、そのユーザーはビジネスをブロックしているか、ネットワーク接続がないかのいずれかであることがわかります。詳細については、Webhookに関するドキュメントをご覧ください。

ユーザーがビジネスをブロックしている場合でも、Contacts APIは引き続きその電話番号を有効なWhatsAppユーザーとして返します。しかし、メッセージを送信しても、配信されることはありません。それが有料メッセージの場合、料金は発生しません。

いいえ。メッセージが送信された順序で到着することは保証されていません。順序が重要な使用事例では、最初のメッセージの配信のコールバックをリッスンしてから、2つ目のメッセージを送信する方法を推奨します。

messagesノードを使用する場合、メッセージ本体を正確に解析するには、Content-TypeヘッダーをWhatsApp Business APIクライアントのapplication/jsonに設定する必要があります。また、期限の切れていないアクセストークンが含まれるAuthorizationも設定する必要があります。トークンを取得する方法とトークンの有効期限について詳しくは、ログインと認証に関するドキュメントをご覧ください。

お客様の問い合わせを処理するのに通常よりも時間がかかる場合や、24時間後にしか回答できない場合があります。そのような場合のために、次のいずれかのメッセージテンプレートを作成することをおすすめします。

  • 結果をユーザーに送信するテンプレート、または
  • カスタマーサービスウィンドウをアクティブにするために、ユーザーに返信を求めるテンプレートです。

どちらの場合も、メッセージテンプレートに状況に関連する情報をできるだけ多く含めてください。例:

  • 「こんにちは、{{1}}さん。以前にご報告いただいた問題についてご連絡いたします。残念ながら、{{2}}。ご不便をおかけしますがご了承ください。」
  • オープンしたチケットに関するアップデートがあります。サポートの継続を希望する場合は、ご返信ください。」