new_releases Bản cập nhật: Kiểm tra
ghi chú phát hành để biết thông tin về các tính năng mới và bản cập nhật sản phẩm.
Method: phones.agentMessages.create
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Gửi tin nhắn từ nhân viên hỗ trợ đến người dùng.
Người dùng phải bật RCS và có thể liên lạc được bằng nền tảng RBM để nhân viên hỗ trợ có thể gửi tin nhắn thành công. Nếu không, tác nhân sẽ nhận được mã lỗi 404.
Nếu người dùng đang trực tuyến, nền tảng RBM sẽ phân phối tin nhắn ngay lập tức. Nếu không, nền tảng RBM sẽ đưa tin nhắn vào hàng đợi và phân phối tin nhắn đó vào lần tiếp theo người dùng có mạng.
Nền tảng RBM sẽ bỏ qua mọi tin nhắn của nhân viên hỗ trợ được gửi bằng một mã nhận dạng đã được sử dụng cho một tin nhắn hoặc sự kiện trước đó do cùng một nhân viên hỗ trợ gửi.
Bạn có thể thu hồi tin nhắn của tác nhân trong khoảng thời gian từ khi gửi đến khi phân phối.
Yêu cầu HTTP
POST https://rcsbusinessmessaging.googleapis.com/v1/{parent=phones/*}/agentMessages
URL sử dụng cú pháp Chuyển mã gRPC.
Tham số đường dẫn
Thông số |
parent |
string
"phones/{E.164}", trong đó {E.164} là số điện thoại của người dùng theo định dạng E.164. Ví dụ: với số điện thoại ở Hoa Kỳ +1-222-333-4444, giá trị sẽ là phones/+12223334444 và điểm cuối thu được sẽ là https://rcsbusinessmessaging.googleapis.com/v1/phones/+12223334444/agentMessages.
|
Tham số truy vấn
Thông số |
messageId |
string
Bắt buộc. Mã nhận dạng duy nhất của thông báo do nhân viên hỗ trợ chỉ định. Đây phải là một UUID, như được xác định trong https://tools.ietf.org/html/rfc4122. Nền tảng RBM sẽ bỏ qua mọi tin nhắn của nhân viên hỗ trợ được gửi bằng một mã nhận dạng đã được sử dụng bởi một tin nhắn hoặc sự kiện trước đó do cùng một nhân viên hỗ trợ gửi.
|
agentId |
string
Bắt buộc. Giá trị nhận dạng duy nhất của tác nhân.
|
Nội dung yêu cầu
Nội dung yêu cầu chứa một bản sao của AgentMessage
.
Nội dung phản hồi
Nếu thành công, nội dung phản hồi sẽ chứa một thực thể AgentMessage
mới tạo.
Phạm vi uỷ quyền
Yêu cầu phạm vi OAuth sau:
https://www.googleapis.com/auth/rcsbusinessmessaging
Để biết thêm thông tin, hãy xem OAuth 2.0 Overview.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-25 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-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)."]]