new_releases Updates: Check the
release notes for new features and product updates.
Method: phones.agentMessages.create
Stay organized with collections
Save and categorize content based on your preferences.
Sends a message from the agent to a user.
The user must be RCS enabled and reachable by the RBM platform in order for the agent to successfully send a message. Otherwise, the agent receives a 404 error code.
If the user is online, the RBM platform delivers the message right away. Otherwise, the RBM platform queues the message and delivers it when the user is next online.
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.
Agent messages can be revoked between the time they are sent and the time they are delivered.
HTTP request
POST https://rcsbusinessmessaging.googleapis.com/v1/{parent=phones/*}/agentMessages
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters |
parent |
string
"phones/{E.164}", where {E.164} is the user's phone number in E.164 format. For example, with the US phone number +1-222-333-4444, the value would be phones/+12223334444, and the resulting endpoint would be https://rcsbusinessmessaging.googleapis.com/v1/phones/+12223334444/agentMessages.
|
Query parameters
Parameters |
messageId |
string
Required. The unique ID of the message, assigned by the agent. This must be a UUID, as defined in https://tools.ietf.org/html/rfc4122. 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.
|
agentId |
string
Required. The agent's unique identifier.
|
Request body
The request body contains an instance of AgentMessage
.
Response body
If successful, the response body contains a newly created instance of AgentMessage
.
Authorization scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/rcsbusinessmessaging
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 2025-02-25 UTC.
[null,null,["Last updated 2025-02-25 UTC."],[[["\u003cp\u003eMessages can be sent from an agent to a user, but the user must be RCS enabled and reachable by the RBM platform, otherwise, a 404 error code is returned.\u003c/p\u003e\n"],["\u003cp\u003eThe RBM platform immediately delivers messages to online users and queues messages for offline users, delivering them when the user comes back online.\u003c/p\u003e\n"],["\u003cp\u003eThe RBM platform will ignore agent messages with duplicate message IDs that were used in prior messages or events.\u003c/p\u003e\n"],["\u003cp\u003eAgent messages are revocable between the time they are sent and delivered.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ePOST\u003c/code\u003e request to send an agent message to a user should be sent to the endpoint: \u003ccode\u003ehttps://rcsbusinessmessaging.googleapis.com/v1/{parent=phones/*}/agentMessages\u003c/code\u003e, where \u003ccode\u003eparent\u003c/code\u003e is the user's E.164 formatted phone number.\u003c/p\u003e\n"]]],[],null,["# Method: phones.agentMessages.create\n\nSends a message from the agent to a user.\n\nThe user must be RCS enabled and reachable by the RBM platform in order for the agent to successfully send a message. Otherwise, the agent receives a 404 error code.\n\nIf the user is online, the RBM platform delivers the message right away. Otherwise, the RBM platform queues the message and delivers it when the user is next online.\n\nThe 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\nAgent messages can be revoked between the time they are sent and the time they are delivered.\n\n### HTTP request\n\n`POST https://rcsbusinessmessaging.googleapis.com/v1/{parent=phones/*}/agentMessages`\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, 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/agentMessages\u003e. |\n\n### Query parameters\n\n| Parameters ||\n|-------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `messageId` | `string` Required. The unique ID of the message, 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 [AgentMessage](/business-communications/rcs-business-messaging/reference/rest/v1/phones.agentMessages#AgentMessage).\n\n### Response body\n\nIf successful, the response body contains a newly created instance of [AgentMessage](/business-communications/rcs-business-messaging/reference/rest/v1/phones.agentMessages#AgentMessage).\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)."]]