# Method: phones.dialogflowMessages.create

Prompts a [Dialogflow](https://dialogflow.com) agent to send messages through an RCS for Business agent.

If Dialogflow integration isn't enabled for an RCS for Business agent, this method returns `403 PERMISSION_DENIED`.

When an RCS for Business agent is integrated with a Dialogflow agent, this method triggers an [event](https://dialogflow.com/docs/events) in the Dialogflow agent. The RCS for Business platform routes responses from Dialogflow to the user's device and routes messages from the user back to the Dialogflow agent.

If a Dialogflow [intent](https://dialogflow.com/docs/intents) defines multiple responses, the RCS for Business platform sends users one message per defined response.

If you contact a webhook with Dialogflow [fulfillment](https://dialogflow.com/docs/fulfillment), the fulfillment request includes the following information in the payload:

<br />

| Field | Description |
|---|---|
| <br /> `rbm_user_phone_number` <br /> | The user's phone number. |
| <br /> `rbm_share_location_response` <br /> | The user's location, if they tapped the share location suggested action. |

<br />

### HTTP request

`POST https://rcsbusinessmessaging.googleapis.com/v1/{parent=phones/*}/dialogflowMessages`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `parent` | `string` "phones/{E.164}", where {E.164} is the user's phone number |

### Query parameters

| Parameters ||
|---|---|
| `messageIdPrefix` | `string` A unique prefix of RCS for Business message IDs that result from the Dialogflow event. Dialogflow supports multiple responses for a given event. If an event triggers multiple responses, RCS for Business forwards each response as a separate message. Each message ID shares the same prefix. |
| `agentId` | `string` Required. The agent's unique identifier. |

### Request body

The request body contains an instance of `https://developers.google.com/business-communications/rcs-business-messaging/reference/rest/v1/phones.dialogflowMessages#DialogflowEvent`.

### Response body

If successful, the response body contains a newly created instance of `https://developers.google.com/business-communications/rcs-business-messaging/reference/rest/v1/phones.dialogflowMessages#DialogflowEvent`.

### Authorization scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/rcsbusinessmessaging`

For more information, see the [OAuth 2.0 Overview](https://developers.google.com/identity/protocols/OAuth2).