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.
Quy trình trò chuyện
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.
Việc gửi và nhận tin nhắn cũng như sự kiện là những khía cạnh cốt lõi của hoạt động giao tiếp giữa một nhân viên hỗ trợ và người dùng. Các tác nhân gửi tin nhắn, sự kiện và yêu cầu đến người dùng thông qua các yêu cầu POST HTTP đến API RBM, nhưng nhận tin nhắn và sự kiện do người dùng tạo tại webhook đã định cấu hình.
Sau đây là ví dụ về luồng trò chuyện sử dụng dữ liệu mẫu để minh hoạ cách tin nhắn, sự kiện và yêu cầu có thể tạo ra các lượt tương tác hữu ích và có ý nghĩa.
Chào bạn!

Trong ví dụ này, tác nhân gửi Hello, World!
dưới dạng một thông báo đến người dùng và người dùng phản hồi bằng Hello to you!
.

Tác nhân gửi yêu cầu kiểm tra chức năng để xác minh rằng thiết bị của người dùng có hỗ trợ RBM hay không.
Nhân viên hỗ trợ gửi:
GET
/v1/phones/+12223334444/capabilities?requestId=147547143069602483572&agentId=welcome-bot
HTTP/1.1
Host: us-rcsbusinessmessaging.googleapis.com
Content-Type: application/json
Nền tảng RBM sẽ gửi cho nhân viên hỗ trợ một phản hồi kiểm tra chức năng cho biết rằng thiết bị của người dùng có thể nhận tin nhắn RBM.
Nhân viên hỗ trợ sẽ nhận được:
{
"rbmEnabled": true,
"features": [
"REVOCATION",
"RICHCARD_STANDALONE",
"RICHCARD_CAROUSEL",
"ACTION_CREATE_CALENDAR_EVENT",
"ACTION_DIAL",
"ACTION_OPEN_URL",
"ACTION_SHARE_LOCATION",
"ACTION_VIEW_LOCATION"
]
}
Tác nhân sẽ gửi thông báo Hello, World!
đến API RBM, API này sẽ truyền thông báo đó đến thiết bị của người dùng.
Nhân viên hỗ trợ sẽ gửi:
POST
/v1/phones/+12223334444/agentMessages?messageId=123&agentId=welcome-bot
HTTP/1.1
Host: us-rcsbusinessmessaging.googleapis.com
Content-Type: application/json
{
"contentMessage": {
"text": "Hello, World!",
}
}
Nền tảng RBM gửi tin nhắn đến thiết bị của người dùng và gửi một sự kiện DELIVERED
đến nhân viên hỗ trợ.
Nhân viên hỗ trợ sẽ nhận được:
{
"senderPhoneNumber": "+12223334444",
"agentId": "welcome-bot@rbm.goog",
"eventType": "DELIVERED",
"eventId": "Ms6oOiEli6QS-fe8QFrmhfIg",
"messageId": "123"
}
Người dùng mở tin nhắn trên thiết bị của họ, thao tác này sẽ gửi một sự kiện READ
đến nhân viên hỗ trợ.
Nhân viên hỗ trợ sẽ nhận được:
{
"senderPhoneNumber": "+12223334444",
"agentId": "welcome-bot@rbm.goog",
"eventType": "READ",
"eventId": "Ms6oOiEli6QS-ge9ZFsmgTj",
"messageId": "123"
}
Người dùng viết và gửi thư trả lời cho nhân viên hỗ trợ.
Nhân viên hỗ trợ sẽ nhận được:
{
"senderPhoneNumber": "+12223334444",
"agentId": "welcome-bot@rbm.goog",
"messageId": "msg000999888777a",
"sendTime": "2018-12-31T15:01:23.045123456Z",
"text": "Hello to you!",
}
Nền tảng RBM sẽ tự động gửi sự kiện DELIVERED
đến thiết bị của người dùng khi nhận được thông báo của người dùng.
Trợ lý sẽ gửi một sự kiện READ
để phản hồi tin nhắn của người dùng, cho họ biết rằng tin nhắn đã được nhận và xác nhận.
Nhân viên hỗ trợ sẽ gửi:
POST
/v1/phones/+12223334444/agentEvents?eventId=1234&agentId=welcome-bot
HTTP/1.1
Host: us-rcsbusinessmessaging.googleapis.com
Content-Type: application/json
{
"eventType": "READ",
"messageId": "msg000999888777a"
}
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: 2024-11-09 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2024-11-09 UTC."],[[["\u003cp\u003eAgents communicate with users by sending messages, events, and requests via HTTP POST requests to the RBM API.\u003c/p\u003e\n"],["\u003cp\u003eUser-created messages and events are received by agents at a designated webhook.\u003c/p\u003e\n"],["\u003cp\u003eA capability check request is initially sent by the agent to determine if the user's device supports RBM.\u003c/p\u003e\n"],["\u003cp\u003eMessages sent by an agent trigger \u003ccode\u003eDELIVERED\u003c/code\u003e and \u003ccode\u003eREAD\u003c/code\u003e events back to the agent, confirming the message's status.\u003c/p\u003e\n"],["\u003cp\u003eWhen a user replies, the agent receives the message, and a subsequent \u003ccode\u003eREAD\u003c/code\u003e event can be sent by the agent to confirm receipt.\u003c/p\u003e\n"]]],[],null,["# Conversation flows\n\nSending and receiving messages and events are the core aspects of communication\nbetween an agent and a user. Agents send messages, events, and requests to users\nthrough HTTP POST requests to the RBM API but receive user-created messages and\nevents at the configured\n[webhook](/business-communications/rcs-business-messaging/guides/integrate/webhooks).\n\nFollowing is an example of conversation flow that uses sample data to illustrate\nhow messages, events, and requests can create useful and meaningful\ninteractions.\n\nHello, World!\n-------------\n\nIn this example, the agent sends `Hello, World!` as\na message to the user, and the user responds with `Hello to you!`.\n\n1. The agent sends a capability check request to verify that the user's device\n is RBM-capable.\n\n The agent sends: \n\n ```text\n GET\n /v1/phones/+12223334444/capabilities?requestId=147547143069602483572&agentId=welcome-bot\n HTTP/1.1\n Host: us-rcsbusinessmessaging.googleapis.com\n Content-Type: application/json\n ```\n2. The RBM platform sends the agent a capability check response indicating that\n the user's device can receive RBM messages.\n\n The agent receives: \n\n ```component-pascal\n {\n \"rbmEnabled\": true,\n \"features\": [\n \"REVOCATION\",\n \"RICHCARD_STANDALONE\",\n \"RICHCARD_CAROUSEL\",\n \"ACTION_CREATE_CALENDAR_EVENT\",\n \"ACTION_DIAL\",\n \"ACTION_OPEN_URL\",\n \"ACTION_SHARE_LOCATION\",\n \"ACTION_VIEW_LOCATION\"\n ]\n }\n ```\n3. The agent sends the `Hello, World!` message to the RBM API, which passes\n it to the user's device.\n\n The agent sends: \n\n ```text\n POST\n /v1/phones/+12223334444/agentMessages?messageId=123&agentId=welcome-bot\n HTTP/1.1\n Host: us-rcsbusinessmessaging.googleapis.com\n Content-Type: application/json\n {\n \"contentMessage\": {\n \"text\": \"Hello, World!\",\n }\n }\n ```\n4. The RBM platform sends the message to the user's device and sends a\n `DELIVERED` event to the agent.\n\n The agent receives: \n\n ```transact-sql\n {\n \"senderPhoneNumber\": \"+12223334444\",\n \"agentId\": \"welcome-bot@rbm.goog\",\n \"eventType\": \"DELIVERED\",\n \"eventId\": \"Ms6oOiEli6QS-fe8QFrmhfIg\",\n \"messageId\": \"123\"\n }\n ```\n5. The user opens the message on their device, which sends a `READ` event to\n the agent.\n\n The agent receives: \n\n ```transact-sql\n {\n \"senderPhoneNumber\": \"+12223334444\",\n \"agentId\": \"welcome-bot@rbm.goog\",\n \"eventType\": \"READ\",\n \"eventId\": \"Ms6oOiEli6QS-ge9ZFsmgTj\",\n \"messageId\": \"123\"\n }\n ```\n6. The user writes and sends a reply to the agent.\n\n The agent receives: \n\n ```transact-sql\n {\n \"senderPhoneNumber\": \"+12223334444\",\n \"agentId\": \"welcome-bot@rbm.goog\",\n \"messageId\": \"msg000999888777a\",\n \"sendTime\": \"2018-12-31T15:01:23.045123456Z\",\n \"text\": \"Hello to you!\",\n }\n ```\n7. The RBM platform automatically sends the user's device a `DELIVERED` event\n when it receives the user's message.\n\n8. The agent sends a `READ` event in response to the user's message to let them\n know it was received and acknowledged.\n\n The agent sends: \n\n ```text\n POST\n /v1/phones/+12223334444/agentEvents?eventId=1234&agentId=welcome-bot\n HTTP/1.1\n Host: us-rcsbusinessmessaging.googleapis.com\n Content-Type: application/json\n {\n \"eventType\": \"READ\",\n \"messageId\": \"msg000999888777a\"\n }\n ```"]]