new_releases 更新:查看
版本说明,了解新功能和产品动态。
Method: phones.dialogflowMessages.create
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
提示 Dialogflow 代理通过 RBM 代理发送消息。
如果没有为 RBM 代理启用 Dialogflow 集成,此方法会返回 403 PERMISSION_DENIED
。
当 RBM 代理与 Dialogflow 代理集成时,此方法会在 Dialogflow 代理中触发一个事件。RBM 平台会将来自 Dialogflow 的响应路由到用户的设备,并将来自用户的消息路由回 Dialogflow 代理。
如果 Dialogflow 意图定义了多个响应,RBM 平台会针对每个定义的响应向用户发送一条消息。
如果您使用 Dialogflow fulfillment 来联系 webhook,则 fulfillment 请求会在载荷中包含以下信息:
字段 | 说明 |
rbm_user_phone_number
| 用户的电话号码。 |
rbm_share_location_response
| 用户的位置信息(如果用户点按了分享位置建议操作)。 |
HTTP 请求
POST https://rcsbusinessmessaging.googleapis.com/v1/{parent=phones/*}/dialogflowMessages
网址采用 gRPC 转码语法。
路径参数
参数 |
parent |
string
"phones/{E.164},其中 {E.164} 是用户的电话号码
|
查询参数
参数 |
messageIdPrefix |
string
Dialogflow 事件生成的 RBM 消息 ID 的唯一前缀。Dialogflow 支持针对给定事件提供多个响应。如果某个事件触发了多个响应,RBM 会将每个响应作为单独的消息转发。每个邮件 ID 的前缀都相同。
|
agentId |
string
必需。代理的唯一标识符。
|
请求正文
请求正文包含一个 DialogflowEvent
实例。
响应正文
如果成功,响应正文将包含一个新创建的 DialogflowEvent
实例。
授权范围
需要以下 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\u003eThis API method allows a Dialogflow agent to send messages through an RBM agent, requiring Dialogflow integration to be enabled for the RBM agent.\u003c/p\u003e\n"],["\u003cp\u003eWhen triggered, this method initiates an event in the integrated Dialogflow agent, routing responses from Dialogflow to the user and messages from the user back to Dialogflow.\u003c/p\u003e\n"],["\u003cp\u003eIf a Dialogflow intent has multiple responses, the RBM platform will send each response as a separate message to the user.\u003c/p\u003e\n"],["\u003cp\u003eWebhook fulfillment requests from Dialogflow will include the user's phone number and, if provided, their shared location in the payload.\u003c/p\u003e\n"],["\u003cp\u003eThe API request requires specific parameters, including the user's phone number in E.164 format and a unique prefix for RBM message IDs, and requires the \u003ccode\u003ehttps://www.googleapis.com/auth/rcsbusinessmessaging\u003c/code\u003e OAuth scope.\u003c/p\u003e\n"]]],[],null,["# Method: phones.dialogflowMessages.create\n\nPrompts a [Dialogflow](https://dialogflow.com) agent to send messages through an RBM agent.\n\nIf Dialogflow integration isn't enabled for an RBM agent, this method returns `403 PERMISSION_DENIED`.\n\nWhen an RBM agent is integrated with a Dialogflow agent, this method triggers an [event](https://dialogflow.com/docs/events) in the Dialogflow agent. The RBM Platform routes responses from Dialogflow to the user's device and routes messages from the user back to the Dialogflow agent.\n\nIf a Dialogflow [intent](https://dialogflow.com/docs/intents) defines multiple responses, the RBM Platform sends users one message per defined response.\n\nIf you contact a webhook with Dialogflow [fulfillment](https://dialogflow.com/docs/fulfillment), the fulfillment request includes the following information in the payload:\n\n\u003cbr /\u003e\n\n| Field | Description |\n|---------------------------------------------|--------------------------------------------------------------------------|\n| \u003cbr /\u003e `rbm_user_phone_number` \u003cbr /\u003e | The user's phone number. |\n| \u003cbr /\u003e `rbm_share_location_response` \u003cbr /\u003e | The user's location, if they tapped the share location suggested action. |\n\n\u003cbr /\u003e\n\n### HTTP request\n\n`POST https://rcsbusinessmessaging.googleapis.com/v1/{parent=phones/*}/dialogflowMessages`\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 |\n\n### Query parameters\n\n| Parameters ||\n|-------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `messageIdPrefix` | `string` A unique prefix of RBM message IDs that result from the Dialogflow event. Dialogflow supports multiple responses for a given event. If an event triggers multiple responses, RBM forwards each response as a separate message. Each message ID shares the same prefix. |\n| `agentId` | `string` Required. The agent's unique identifier. |\n\n### Request body\n\nThe request body contains an instance of [DialogflowEvent](/business-communications/rcs-business-messaging/reference/rest/v1/phones.dialogflowMessages#DialogflowEvent).\n\n### Response body\n\nIf successful, the response body contains a newly created instance of [DialogflowEvent](/business-communications/rcs-business-messaging/reference/rest/v1/phones.dialogflowMessages#DialogflowEvent).\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)."]]