Google Business Messages 功能將於 2024 年 7 月 31 日終止服務。請按
這裡瞭解詳情。
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
使用者訊息的專屬 ID。你可以使用這個欄位來刪除重複收到的郵件。
|
conversationId |
string
對話的專屬 ID。
|
customAgentId |
string
虛擬服務專員的自訂 ID。由合作夥伴在服務專員註冊時定義。
|
agent |
string
代理程式的 ID,在建立代理程式時設定。
|
context |
object (Context )
與訊息相關聯的內容比對資料。
|
sendTime |
string (Timestamp format)
傳送郵件的時間。 RFC3339 世界標準時間「Zulu」的時間戳記格式,解析度為奈秒,且最多 9 個小數位數。範例:"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 世界標準時間「Zulu」的時間戳記格式,解析度為奈秒,且最多 9 個小數位數。範例:"2014-10-02T15:01:23Z" 和 "2014-10-02T15:01:23.045123456Z" 。
|
聯集欄位 status 。 status 只能採用下列其中一種設定:
|
isTyping |
boolean
使用者是否正在輸入。
|
requestedLiveAgent |
boolean
使用者是否要求與真人服務專員交談。
|
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間: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,[]]