Messages can be sent as different types,
allowing for the display to match the message payload.
Your app can send messages as basic
, template
, minimal
, or form
type.
You may see an additional system
type in some responses.
system
type is reserved for internal use for sending messages.
This article gives a brief overview of each of the message types
and how to structure the メッセージ
object in your
Send Message request.
basic
messages contain an array of テキスト
, イメージ
, or file
.
Array items are displayed in Inbox and the visitor's chat widget
as if each item was a separate message.
This example contains an image followed by two text messages:
1
The above example produces this output:
受信トレイ | Chat Widget |
---|---|
form
messages present form data submitted by the participant.
Form messages contain a タイトル
, an optional 記述
,
and an array of fields
.
Each field in the array has a 名称
and submitted 価値
財産である。
Form messages are typically sent with a direction of PARTICIPANT_TO_BUSINESS
.
To hide the message from the visitor, set visibility
to ビジネス
.
This example contains 4 form fields and an image:
1
The above example is not displayed in the visitor's chat widget
because visibility
is set to ビジネス
.
It produces this output in Inbox:
受信トレイ |
---|
minimal
messages contain a single line of text and an optional icon.
They're useful for reporting an activity that took place.
To hide the message from the visitor, set visibility
to ビジネス
.
This example reports that the visitor made a spa appointment:
1
The above example is not displayed in the visitor's chat widget
because visibility
is set to ビジネス
.
It produces this output in Inbox:
受信トレイ |
---|
template
messages use buttons to allow the visitor to perform actions.
Buttons can be either ACTION
または POSTBACK
type.
Action buttons open a specified url
in the visitor's browser,
and postback buttons pass a buttonPayload
to the
Button Interacted Webhook.
This example tells the visitor their spa appointment has been booked and offers two buttons. The first is an action button, and the second is a postback button:
1
The above example produces this output:
受信トレイ | Chat Widget |
---|---|
system
messages convey system information from an integrated service
such as Facebook or Instagram.
System messages cannot be sent by 3rd-party apps. However, your app may still need to consume system messages.
This example payload contains text and a "Learn More" link:
1
The above example produces this output:
受信トレイ |
---|