我们将于 2024 年 7 月 31 日逐步淘汰 Google Business Messages。点击
此处了解详情。
UserMessage
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
用户发送给代理的消息。
UserMessage
显示在代理收到的 message
对象的 data
字段中。data
字段是一个采用 Base64 编码的字符串,代理必须将该字段转换为字节并使用 UserMessage
协议缓冲区进行解析。
JSON 表示法 |
{
"requestId": string,
"conversationId": string,
"customAgentId": string,
"agent": string,
"context": {
object (Context )
},
"sendTime": string,
"dialogflowResponse": {
object (DialogflowResponse )
},
// Union field payload can be only one of the following:
"message": {
object (Message )
},
"receipts": {
object (Receipts )
},
"userStatus": {
object (UserStatus )
},
"surveyResponse": {
object (SurveyResponse )
},
"suggestionResponse": {
object (SuggestionResponse )
},
"authenticationResponse": {
object (AuthenticationResponse )
}
// End of list of possible types for union field payload .
} |
字段 |
requestId |
string
用户消息的唯一标识符。使用此字段可删除重复的传入邮件。
|
conversationId |
string
对话的唯一标识符。
|
customAgentId |
string
代理的自定义标识符。由合作伙伴在代理注册期间定义。
|
agent |
string
代理的标识符。在创建代理时设置。
|
context |
object (Context )
与消息相关联的情境数据。
|
sendTime |
string (Timestamp format)
消息的发送时间。 时间戳采用 RFC3339 世界协调时间(UTC,即“祖鲁时”)格式,精确到纳秒,最多九个小数位。示例:"2014-10-02T15:01:23Z" 和 "2014-10-02T15:01:23.045123456Z" 。
|
dialogflowResponse |
object (DialogflowResponse )
Dialogflow 响应。
|
联合字段 payload 。用户消息的载荷。payload 只能是下列其中一项: |
message |
object (Message )
消息的内容。
|
receipts |
object (Receipts )
收据的内容。
|
userStatus |
object (UserStatus )
用户状态的内容。
|
surveyResponse |
object (SurveyResponse )
调查问卷回复。
|
suggestionResponse |
object (SuggestionResponse )
建议响应。
|
authenticationResponse |
object (AuthenticationResponse )
身份验证响应。
|
UserStatus
JSON 表示法 |
{
"createTime": string,
// Union field status can be only one of the following:
"isTyping": boolean,
"requestedLiveAgent": boolean
// End of list of possible types for union field status .
} |
字段 |
createTime |
string (Timestamp format)
用户状态更改的时间。 时间戳采用 RFC3339 世界协调时间(UTC,即“祖鲁时”)格式,精确到纳秒,最多九个小数位。示例:"2014-10-02T15:01:23Z" 和 "2014-10-02T15:01:23.045123456Z" 。
|
联合字段 status 。 status 只能是下列其中一项:
|
isTyping |
boolean
用户是否正在输入。
|
requestedLiveAgent |
boolean
用户是否请求了人工客服。
|
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\u003cp\u003eAgents receive user messages within the \u003ccode\u003edata\u003c/code\u003e field of a \u003ccode\u003emessage\u003c/code\u003e object, encoded as base64 strings.\u003c/p\u003e\n"],["\u003cp\u003eAgents need to decode the \u003ccode\u003edata\u003c/code\u003e field and parse it using the \u003ccode\u003eUserMessage\u003c/code\u003e protocol buffer to access the message content.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eUserMessage\u003c/code\u003e object contains various fields like \u003ccode\u003erequestId\u003c/code\u003e, \u003ccode\u003econversationId\u003c/code\u003e, \u003ccode\u003eagent\u003c/code\u003e, \u003ccode\u003econtext\u003c/code\u003e, and more to provide context about the message.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003epayload\u003c/code\u003e field within \u003ccode\u003eUserMessage\u003c/code\u003e can contain different types of user interactions, such as a regular message, receipts, user status (like typing or requesting a live agent), survey responses, suggestion responses, and authentication responses.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eUserStatus\u003c/code\u003e provides information about the user's current state, including whether they are typing or have requested a live agent.\u003c/p\u003e\n"]]],[],null,[]]