new_releases 更新:查看
版本说明,了解新功能和产品动态。
Method: phones.agentEvents.create
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
将代理中的事件发送给用户。
代理事件可用于表明代理已阅读用户发送的消息,或者代理正在输入内容(这会为 RBM 体验增添人为元素)。如果 RBM 无法覆盖用户,则 RBM 平台会返回 404 NOT_FOUND
。
与代理消息不同,代理事件在发送后无法撤消。
HTTP 请求
POST https://rcsbusinessmessaging.googleapis.com/v1/{parent=phones/*}/agentEvents
网址采用 gRPC 转码语法。
路径参数
参数 |
parent |
string
"phones/{E.164}”,其中 {E.164} 是用户的电话号码(采用 E.164 格式)。例如,对于美国电话号码为 +1-222-333-4444 的用户,其值将为 phone/+12223334444,其生成的端点将为 https://rcsbusinessmessaging.googleapis.com/v1/phones/+12223334444/agentEvents。
|
查询参数
参数 |
eventId |
string
由客服人员分配的事件 ID。此值必须是 https://tools.ietf.org/html/rfc4122 中定义的 UUID。RBM 平台会忽略通过同一 ID 发送的代理消息,而该 ID 与同一代理发送的先前消息或事件所使用的 ID 相同。
|
agentId |
string
必需。代理的唯一标识符。
|
请求正文
请求正文包含一个 AgentEvent
实例。
响应正文
如果成功,响应正文将包含一个新创建的 AgentEvent
实例。
授权范围
需要以下 OAuth 范围:
https://www.googleapis.com/auth/rcsbusinessmessaging
如需了解详情,请参阅 OAuth 2.0 Overview。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\u003cp\u003eAgent events are used to signal that an agent has read a user's message or is currently typing, adding a human touch to the interaction.\u003c/p\u003e\n"],["\u003cp\u003eAgent events cannot be revoked once sent, unlike agent messages, which means they are a permanent record of the interaction.\u003c/p\u003e\n"],["\u003cp\u003eTo send an agent event, use a \u003ccode\u003ePOST\u003c/code\u003e request to the specified URL, including the user's E.164 formatted phone number in the path.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eeventId\u003c/code\u003e and \u003ccode\u003eagentId\u003c/code\u003e are required as query parameters when sending an event, and \u003ccode\u003eeventId\u003c/code\u003e needs to be a UUID according to RFC4122 standards.\u003c/p\u003e\n"],["\u003cp\u003eSuccessful agent event requests will return a new instance of the sent AgentEvent in the response body.\u003c/p\u003e\n"]]],[],null,["# Method: phones.agentEvents.create\n\nSends an event from the agent to a user.\n\nAgent events can be used to indicate that the agent has read a message from the user or that the agent is in the process of typing (which adds a human element to the RBM experience). If RBM can't reach the user, the RBM platform returns `404 NOT_FOUND`.\n\nUnlike agent messages, agent events cannot be revoked after sending.\n\n### HTTP request\n\n`POST https://rcsbusinessmessaging.googleapis.com/v1/{parent=phones/*}/agentEvents`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `parent` | `string` \"phones/{E.164}\", where {E.164} is the user's phone number in E.164 format. For example, for a user with the US phone number +1-222-333-4444, the value would be phones/+12223334444, and the resulting endpoint would be \u003chttps://rcsbusinessmessaging.googleapis.com/v1/phones/+12223334444/agentEvents\u003e. |\n\n### Query parameters\n\n| Parameters ||\n|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `eventId` | `string` The ID of the event, assigned by the agent. This must be a UUID, as defined in \u003chttps://tools.ietf.org/html/rfc4122\u003e. The RBM platform ignores any agent message sent with an ID that was used by an earlier message or event sent from the same agent. |\n| `agentId` | `string` Required. The agent's unique identifier. |\n\n### Request body\n\nThe request body contains an instance of [AgentEvent](/business-communications/rcs-business-messaging/reference/rest/v1/phones.agentEvents#AgentEvent).\n\n### Response body\n\nIf successful, the response body contains a newly created instance of [AgentEvent](/business-communications/rcs-business-messaging/reference/rest/v1/phones.agentEvents#AgentEvent).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/rcsbusinessmessaging`\n\nFor more information, see the [OAuth 2.0 Overview](/identity/protocols/OAuth2)."]]