We will be winding down Google Business Messages on July 31, 2024. Read more
here.
Method: conversations.messages.create
Stay organized with collections
Save and categorize content based on your preferences.
Sends a message from an agent to a user. If a conversation doesn't exist or an agent tries to send a message in a conversation that it isn't authorized to participate in, returns a PERMISSION DENIED
error.
HTTP request
POST https://businessmessages.googleapis.com/v1/{parent=conversations/*}/messages
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters |
parent |
string
Required. The conversation that contains the message. Resolves to "conversations/{conversationId}".
|
Query parameters
Parameters |
forceFallback |
boolean
Optional. A flag to send the specified fallback text instead of other message content. Only available to agents that aren't launched. If the flag is true and fallback text isn't specified, Business Messages returns an error.
|
Request body
The request body contains an instance of Message
.
Response body
If successful, the response body contains a newly created instance of Message
.
Authorization scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/businessmessages
For more information, see the OAuth 2.0 Overview.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-11-14 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-11-14 UTC."],[[["\u003cp\u003eSends a message from an agent to a user within a specific conversation.\u003c/p\u003e\n"],["\u003cp\u003eReturns a \u003ccode\u003ePERMISSION DENIED\u003c/code\u003e error if the conversation doesn't exist or the agent isn't authorized.\u003c/p\u003e\n"],["\u003cp\u003eAllows sending fallback text instead of the main message content for non-launched agents using the \u003ccode\u003eforceFallback\u003c/code\u003e query parameter.\u003c/p\u003e\n"],["\u003cp\u003eRequires the \u003ccode\u003ehttps://www.googleapis.com/auth/businessmessages\u003c/code\u003e OAuth scope for authorization.\u003c/p\u003e\n"],["\u003cp\u003eUses the \u003ccode\u003ePOST\u003c/code\u003e method with the URL \u003ccode\u003ehttps://businessmessages.googleapis.com/v1/{parent=conversations/*}/messages\u003c/code\u003e to send the message.\u003c/p\u003e\n"]]],[],null,["# Method: conversations.messages.create\n\nSends a message from an agent to a user. If a conversation doesn't exist or an agent tries to send a message in a conversation that it isn't authorized to participate in, returns a `PERMISSION DENIED` error.\n\n### HTTP request\n\n`POST https://businessmessages.googleapis.com/v1/{parent=conversations/*}/messages`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|----------|--------------------------------------------------------------------------------------------------------------|\n| `parent` | `string` Required. The conversation that contains the message. Resolves to \"conversations/{conversationId}\". |\n\n### Query parameters\n\n| Parameters ||\n|-----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `forceFallback` | `boolean` Optional. A flag to send the specified fallback text instead of other message content. Only available to agents that aren't launched. If the flag is true and fallback text isn't specified, Business Messages returns an error. |\n\n### Request body\n\nThe request body contains an instance of [Message](/business-communications/business-messages/reference/rest/v1/conversations.messages#Message).\n\n### Response body\n\nIf successful, the response body contains a newly created instance of [Message](/business-communications/business-messages/reference/rest/v1/conversations.messages#Message).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/businessmessages`\n\nFor more information, see the [OAuth 2.0 Overview](https://developers.google.com/identity/protocols/OAuth2)."]]