new_releases 更新:查看
版本说明,了解新功能和产品动态。
UserEvent
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
用户在 RCS 客户端上发生的与代理对话相关的事件。
例如,事件可以指示用户正在输入内容,或者用户已读完代理发送的上一条消息。
UserEvent 会显示在代理从其 Google Pub/Sub 订阅接收的“message”对象的“data”字段中。“data”字段是一个 base64 编码的字符串,代理必须对其进行解码才能与 UserEvent 结构匹配。
JSON 表示法 |
{
"senderPhoneNumber": string,
"eventType": enum (UserEvent.EventType ),
"eventId": string,
"messageId": string,
"sendTime": string,
"agentId": string
} |
字段 |
senderPhoneNumber |
string
涉及相应事件的用户的电话号码(采用 E.164 格式)。
|
eventType |
enum (UserEvent.EventType )
事件的类型。
|
eventId |
string
由发送用户的 RCS 客户端分配的唯一事件 ID。
|
messageId |
string
与相应事件关联的消息的 ID。例如,已发送到用户的 RCS 客户端或已被用户读过的消息。系统会针对 DELIVERED 和 READ 事件填充此字段。
|
sendTime |
string (Timestamp format)
RCS 客户端发送事件的时间。 采用 RFC 3339 标准,生成的输出将始终在末尾带 Z,并使用 0、3、6 或 9 个小数位。不带“Z”的偏差时间也是可以接受的。示例:"2014-10-02T15:01:23Z" 、"2014-10-02T15:01:23.045123456Z" 或 "2014-10-02T15:01:23+05:30" 。
|
agentId |
string
代理的唯一标识符。由 RCS Business Messaging 设置。
|
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-22。
[null,null,["最后更新时间 (UTC):2025-08-22。"],[[["\u003cp\u003eUserEvents indicate user actions within an RCS conversation with an agent, such as typing or reading a message.\u003c/p\u003e\n"],["\u003cp\u003eThese events are transmitted to the agent within the base64-encoded "data" field of the "message" object from Google Pub/Sub.\u003c/p\u003e\n"],["\u003cp\u003eThe UserEvent structure includes details like \u003ccode\u003esenderPhoneNumber\u003c/code\u003e, \u003ccode\u003eeventType\u003c/code\u003e, \u003ccode\u003eeventId\u003c/code\u003e, \u003ccode\u003emessageId\u003c/code\u003e, \u003ccode\u003esendTime\u003c/code\u003e, and \u003ccode\u003eagentId\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003emessageId\u003c/code\u003e specifies the message associated with the event, which is only populated for DELIVERED and READ event types.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003esendTime\u003c/code\u003e field details when the event occurred, formatted according to RFC 3339.\u003c/p\u003e\n"]]],[],null,["# UserEvent\n\nAn event that occurred on the user's RCS client and was related to a conversation with the agent.\n\nFor instance, an event can indicate that the user is typing or that an earlier message from the agent was read by the user.\n\nThe UserEvent appears in the \"data\" field of the \"message\" object that the agent receives from its Google Pub/Sub subscription. The \"data\" field is a base64-encoded string that the agent must decode to match the UserEvent structure.\n\n| JSON representation |\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"senderPhoneNumber\": string, \"eventType\": enum (/business-communications/rcs-business-messaging/reference/rest/v1/UserEvent.EventType), \"eventId\": string, \"messageId\": string, \"sendTime\": string, \"agentId\": string } ``` |\n\n| Fields ||\n|---------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `senderPhoneNumber` | `string` Phone number (in E.164 format) of the user involved in the event. |\n| `eventType` | `enum (`[UserEvent.EventType](/business-communications/rcs-business-messaging/reference/rest/v1/UserEvent.EventType)`)` Type of the event. |\n| `eventId` | `string` A unique event ID, assigned by the sending user's RCS client. |\n| `messageId` | `string` The ID of the message that is associated with the event. For example, a message that was delivered to the user's RCS client or read by the user. This field is populated for DELIVERED and READ events. |\n| `sendTime` | `string (`[Timestamp](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp)` format)` Time at which RCS client sends the event. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than \"Z\" are also accepted. Examples: `\"2014-10-02T15:01:23Z\"`, `\"2014-10-02T15:01:23.045123456Z\"` or `\"2014-10-02T15:01:23+05:30\"`. |\n| `agentId` | `string` The agent's unique identifier. Set by RCS Business Messaging. |"]]