Resource: AgentMessage
A message sent from the agent to a user.
JSON representation |
---|
{ "name": string, "sendTime": string, "contentMessage": { object ( |
Fields | |
---|---|
name |
This field is set by the RBM platform. Do not include it when creating an agent message. The field resolves "phones/{E.164}/agentMessages/{messageId}", where {E.164} is the user's phone number in E.164 format and {messageId} is the agent-assigned ID of the agent message. |
send |
This field is set by the RBM platform. Do not include it when creating an agent message. The field resolves the time when the message is sent to the user. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
content |
The content of the agent message. |
Union field
|
|
expire |
Optional. Timestamp in UTC of when this resource is considered expired. This value is provided on output if it is set or if the TTL field is set. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
ttl |
Optional. Input only. How long the message will live before it is automatically revoked. A duration in seconds with up to nine fractional digits, ending with ' |
AgentContentMessage
The content of a message sent from the agent to a user.
JSON representation |
---|
{ "suggestions": [ { object ( |
Fields | |
---|---|
suggestions[] |
A list of suggested replies and suggested actions that appear as a list of suggestion chips following the associated agent message. Maximum 11 suggestions. The chips only display when the associated agent message is the most recent message within the conversation (including both agent and user messages). The user can tap a suggested reply to send the text reply back to the agent or tap a suggested action to initiate a native action on the device. Maximum 11 suggestions. |
Union field content . The content of the agent message content can be only one of the following: |
|
text |
Text encoded in UTF-8. Maximum 3072 characters. |
fileName |
The unique name of a file. The RBM platform returns a file name when an agent uploads a file. Deprecated in favor of uploadedRbmFile below |
uploaded |
Contains identifiers for a file and thumbnail that were uploaded to and served by the RBM server |
rich |
A standalone rich card. |
content |
Information about a file, including the URL of the file and the URL of the file’s thumbnail. The RBM platform serves content from a cache, but an agent can force the RBM platform to fetch a new version of the content and refresh the cache. |
UploadedRbmFile
Message containing file and thumbnail information
JSON representation |
---|
{ "fileName": string, "thumbnailName": string } |
Fields | |
---|---|
file |
The name of the file, returned by the RBM platform when the file was uploaded. |
thumbnail |
The name of the thumbnail, returned by the RBM platform when the thumbnail was uploaded. |
RichCard
A standalone rich card or a carousel of rich cards sent from the agent to the user.
JSON representation |
---|
{ // Union field |
Fields | |
---|---|
Union field card . Standalone card or carousel of cards. card can be only one of the following: |
|
carousel |
Carousel of cards. |
standalone |
Standalone card. |
CarouselCard
Carousel of cards.
JSON representation |
---|
{ "cardWidth": enum ( |
Fields | |
---|---|
card |
The width of the cards in the carousel. |
card |
The list of contents for each card in the carousel. A carousel can have a minimum of 2 cards and a maximum 10 cards. |
CarouselCard.CardWidth
The width of the cards in the carousel.
Enums | |
---|---|
CARD_WIDTH_UNSPECIFIED |
Not specified. |
SMALL |
120 DP. Note that tall media cannot be used. |
MEDIUM |
232 DP. |
CardContent
Card content
JSON representation |
---|
{ "title": string, "description": string, "media": { object ( |
Fields | |
---|---|
title |
(Optional) Title of the card. Maximum 200 characters. |
description |
(Optional) Description of the card. Maximum 2000 characters. |
media |
(Optional) Media (image, GIF, video) to include in the card. |
suggestions[] |
(Optional) List of suggestions to include in the card. Maximum 10 suggestions. |
Media
A media file within a rich card.
JSON representation |
---|
{ "height": enum ( |
Fields | |
---|---|
height |
The height of the media within a rich card with a vertical layout. For a standalone card with horizontal layout, height is not customizable, and this field is ignored. |
Union field content . Media content content can be only one of the following: |
|
fileName |
The unique name of the file, returned by the RBM platform when the file was uploaded. Deprecated in favor of uploadedRbmFile below |
uploaded |
Contains identifiers for a file and thumbnail that were uploaded to and served by the RBM server |
content |
Information about a file, including the URL of the file and the URL of the file’s thumbnail. The RBM platform serves content from a cache, but an agent can force the RBM platform to fetch a new version of the content and refresh the cache. |
ContentInfo
Message containing the content information.
JSON representation |
---|
{ "fileUrl": string, "thumbnailUrl": string, "forceRefresh": boolean } |
Fields | |
---|---|
file |
Publicly reachable URL of the file. The RBM platform determines the MIME type of the file from the content-type field in the HTTP headers when the platform fetches the file. The content-type field must be present and accurate in the HTTP response from the URL. Recommended maximum file size of 100 MB. |
thumbnail |
(Optional, for image, audio and video files only) Publicly reachable URL of the thumbnail. Maximum size of 100 kB. If you don't provide a thumbnail URL, the RBM platform displays a blank placeholder thumbnail until the user's device downloads the file. Depending on the user's setting, the file may not download automatically and may require the user to tap a download button. |
force |
If set, the RBM platform fetches the file and thumbnail from the specified URLs, even if the platform has cached copies of the file (and/or of the thumbnail). |
Media.Height
Media height
Enums | |
---|---|
HEIGHT_UNSPECIFIED |
Not specified. |
SHORT |
112 DP. |
MEDIUM |
168 DP. |
TALL |
264 DP. Not available for rich card carousels when the card width is set to small. |
Suggestion
A suggested reply or a suggested action included within a rich card or within a suggestion chip list.
JSON representation |
---|
{ // Union field |
Fields | |
---|---|
Union field option . A suggested reply or a suggested action option can be only one of the following: |
|
reply |
Users can tap a suggested reply to send the text reply back to the agent. |
action |
Users can tap a suggested action to initiate the corresponding native action on the device. |
SuggestedReply
When tapped, sends the text reply back to the agent.
JSON representation |
---|
{ "text": string, "postbackData": string } |
Fields | |
---|---|
text |
Text that is shown in the suggested reply and sent back to the agent when the user taps it. Maximum 25 characters. |
postback |
The base64-encoded payload that the agent receives in a user event when the user taps the suggested reply. |
SuggestedAction
When tapped, initiates the corresponding native action on the device.
JSON representation |
---|
{ "text": string, "postbackData": string, "fallbackUrl": string, // Union field |
Fields | |
---|---|
text |
Text that is shown in the suggested action. Maximum 25 characters. |
postback |
Payload (base64 encoded) that will be sent to the agent in the user event that results when the user taps the suggested action. Maximum 2048 characters. |
fallback |
(Optional) Fallback URL to use if a client doesn't support a suggested action. Fallback URLs open in new browser windows. Must be a valid URI as defined in RFC 3986. Maximum 2048 characters. |
Union field action . The native action initiated on the device when the user taps the suggested action action can be only one of the following: |
|
dial |
Opens the user's default dialer app with the agent-specified phone number filled in. |
view |
Opens the user's default map app and selects the agent-specified location or searches around the user's location given an agent-specified query. |
create |
Opens the user's default calendar app and starts the new calendar event flow with the agent-specified event data pre-filled. |
open |
Opens the user's default web browser app to the given URL. If the user has an app installed that is registered as the default handler for the URL, then this app will be opened instead, and its icon will be used in the suggested action UI. |
share |
Opens the RCS app's location chooser so the user can pick a location to send to the agent. |
compose |
Compose and send a message to a predefined destination by chatbot. |
DialAction
Opens the user's default dialer app with the agent-specified phone number filled in.
JSON representation |
---|
{ "phoneNumber": string } |
Fields | |
---|---|
phone |
The phone number in E.164 format, for example, +12223334444. |
ViewLocationAction
Opens the user's default map app and selects the agent-specified location or searches around the user's location given an agent-specified query.
JSON representation |
---|
{
"latLong": {
object ( |
Fields | |
---|---|
lat |
(Optional) The latitude and longitude of the specified location. |
label |
(Optional) The label of the pin dropped at latLong. |
query |
(Optional, only supported on Android Messages clients) Rather than specify a latLong (and optionally, a label), the agent can instead specify a query string. For default map apps that support search functionality (including Google Maps), tapping this suggested action results in a location search centered around the user's current location. If the query is sufficiently specific, then agents can use it to select any location in the world. For instance, setting the query string to "Growing Tree Bank" will show all Growing Tree Bank locations in the user's vicinity. Setting the query string to "1600 Amphitheater Parkway, Mountain View, CA 94043" will select that specific address, regardless of the user's location. |
LatLng
An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges.
JSON representation |
---|
{ "latitude": number, "longitude": number } |
Fields | |
---|---|
latitude |
The latitude in degrees. It must be in the range [-90.0, +90.0]. |
longitude |
The longitude in degrees. It must be in the range [-180.0, +180.0]. |
CreateCalendarEventAction
Opens the user's default calendar app and starts the new calendar event flow with the agent-specified event data pre-filled.
JSON representation |
---|
{ "startTime": string, "endTime": string, "title": string, "description": string } |
Fields | |
---|---|
start |
Event start time. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
end |
Event end time. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
title |
Event title. Maximum 100 characters. |
description |
Event description. Maximum 500 characters. |
OpenUrlAction
Opens the user's default web browser app to the specified URL. If the user has an app installed that is registered as the default handler for the URL, then this app will be opened instead, and its icon will be used in the suggested action UI.
JSON representation |
---|
{ "url": string, "application": enum ( |
Fields | |
---|---|
url |
URL. Must be a valid URI as defined in RFC 3986. Maximum 2048 characters. |
application |
URL open application, browser or webview. To check whether a user's device supports webview mode, run a capability check first. See the documentation for details: https://developers.google.com/business-communications/rcs-business-messaging/guides/build/capabilities. |
webview |
View mode for webview |
description |
Accessbility description for webview. |
OpenUrlApplication
Type of the URL open application
Enums | |
---|---|
OPEN_URL_APPLICATION_UNSPECIFIED |
Not specified, will use browser to open. |
BROWSER |
Use browser to open URL. |
WEBVIEW |
Open URL in an integrated web view window |
WebviewViewMode
Type of the webview's view mode.
Enums | |
---|---|
WEBVIEW_VIEW_MODE_UNSPECIFIED |
Not specified. To use webview, a view mode must be specified. |
FULL |
Requires a full screen overlay with the Chatbot conversation labelled within the status bar. |
HALF |
Requires a half screen overlay. |
TALL |
Requires a three-quarters screen overlay. |
ComposeAction
Compose and send a message to a destination predefined by chatbot. To check whether a user's device supports this action, run a capability check first. See the documentation for details: https://developers.google.com/business-communications/rcs-business-messaging/guides/build/capabilities.
JSON representation |
---|
{ // Union field |
Fields | |
---|---|
Union field
|
|
compose |
Compose and send a text message. |
compose |
Initiate the recording and sending of an audio or video message. |
ComposeAction.ComposeTextMessage
Compose and send a text message.
JSON representation |
---|
{ "phoneNumber": string, "text": string } |
Fields | |
---|---|
phone |
Prefilled destination phone number by chatbot. |
text |
Draft to go into the send message text field. |
ComposeAction.ComposeRecordingMessage
Initiate the recording and sending of an audio or video message.
JSON representation |
---|
{
"phoneNumber": string,
"type": enum ( |
Fields | |
---|---|
phone |
Prefilled destination phone number by chatbot. |
type |
The type of the recording action. |
ComposeRecordingActionType
Type of the compose recording action.
Enums | |
---|---|
COMPOSE_RECORDING_ACTION_TYPE_UNSPECIFIED |
Not specified. |
ACTION_TYPE_AUDIO |
Audio type. |
ACTION_TYPE_VIDEO |
Video type. |
StandaloneCard
Standalone card
JSON representation |
---|
{ "cardOrientation": enum ( |
Fields | |
---|---|
card |
Orientation of the card. |
thumbnail |
Image preview alignment for standalone cards with horizontal layout. |
card |
Card content. |
StandaloneCard.CardOrientation
Orientation of the card.
Enums | |
---|---|
CARD_ORIENTATION_UNSPECIFIED |
Not specified. |
HORIZONTAL |
Horizontal layout. If a horizontal rich card's |
VERTICAL |
Vertical layout. |
StandaloneCard.ThumbnailImageAlignment
Image preview alignment for standalone cards with horizontal layout.
Enums | |
---|---|
THUMBNAIL_IMAGE_ALIGNMENT_UNSPECIFIED |
Not specified. |
LEFT |
File preview is left-aligned. |
RIGHT |
File preview is right-aligned. |
Methods |
|
---|---|
|
Sends a message from the agent to a user. |
|
Revokes an agent message that has been sent but not yet delivered. |