new_releases อัปเดต: ดู
บันทึกประจํารุ่นสําหรับฟีเจอร์ใหม่ๆ และการอัปเดตผลิตภัณฑ์
ServerEvent
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
เหตุการณ์ที่เกิดขึ้นฝั่งเซิร์ฟเวอร์ซึ่งเกี่ยวข้องกับการสนทนาระหว่างตัวแทนกับผู้ใช้
ตัวอย่างเช่น หากบ็อตตั้งค่า TTL สำหรับข้อความและ TTL หมดอายุ ระบบจะทริกเกอร์เหตุการณ์นี้เพื่อแจ้งให้พาร์ทเนอร์ทราบว่าข้อความของบ็อตหมดเวลาแล้ว
ServerEvent จะปรากฏในช่อง "data" ของออบเจ็กต์ "message" ที่เอเจนต์ได้รับจากการสมัครใช้บริการ Pub/Sub ฟิลด์ "data" เป็นสตริงที่เข้ารหัส Base64 ซึ่งตัวแทนต้องถอดรหัสเพื่อให้ตรงกับโครงสร้าง ServerEvent
การแสดง JSON |
{
"phoneNumber": string,
"agentId": string,
"messageId": string,
"eventType": enum (ServerEvent.EventType ),
"eventId": string,
"sendTime": string
} |
ช่อง |
phoneNumber |
string
หมายเลขโทรศัพท์ (ในรูปแบบ E.164) ของผู้ใช้ที่เกี่ยวข้องกับเหตุการณ์
|
agentId |
string
ตัวระบุที่ไม่ซ้ำกันของตัวแทน ตั้งค่าโดยการรับส่งข้อความทางธุรกิจ RCS
|
messageId |
string
รหัสข้อความ RCS ของข้อความที่เชื่อมโยงกับเหตุการณ์
|
eventType |
enum (ServerEvent.EventType )
ประเภทของกิจกรรม
|
eventId |
string
รหัสเหตุการณ์ที่ไม่ซ้ำกันที่กำหนดให้กับอินสแตนซ์เหตุการณ์
|
sendTime |
string (Timestamp format)
เวลาที่เซิร์ฟเวอร์ส่งเหตุการณ์ ใช้ RFC 3339 โดยเอาต์พุตที่สร้างขึ้นจะได้รับการแปลงเป็น Z เสมอ และใช้ตัวเลขเศษส่วน 0, 3, 6 หรือ 9 หลัก นอกจากนี้ ระบบยังยอมรับออฟเซ็ตอื่นๆ นอกเหนือจาก "Z" ด้วย ตัวอย่าง: "2014-10-02T15:01:23Z" , "2014-10-02T15:01:23.045123456Z" หรือ "2014-10-02T15:01:23+05:30"
|
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-22 UTC
[null,null,["อัปเดตล่าสุด 2025-08-22 UTC"],[[["\u003cp\u003eServerEvents are notifications about occurrences related to conversations between agents and users, such as when a bot message's TTL expires.\u003c/p\u003e\n"],["\u003cp\u003eThese events are delivered within the "data" field of a "message" object in a Pub/Sub subscription, requiring base64 decoding by the agent.\u003c/p\u003e\n"],["\u003cp\u003eEach ServerEvent contains fields such as \u003ccode\u003ephoneNumber\u003c/code\u003e, \u003ccode\u003eagentId\u003c/code\u003e, \u003ccode\u003emessageId\u003c/code\u003e, \u003ccode\u003eeventType\u003c/code\u003e, \u003ccode\u003eeventId\u003c/code\u003e, and \u003ccode\u003esendTime\u003c/code\u003e to provide specific context.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eeventType\u003c/code\u003e field specifies the type of the event, while \u003ccode\u003esendTime\u003c/code\u003e indicates the server's event dispatch time in RFC 3339 format.\u003c/p\u003e\n"],["\u003cp\u003eThe information is structured in a JSON format that contains information regarding the server event and it's corresponding data.\u003c/p\u003e\n"]]],[],null,["# ServerEvent\n\nAn event that occurred server side that is related to a conversation between an agent and a user.\n\nFor example, if the bot sets a TTL for the message and the TTL expires, this event will be fired to notify the partner that the bot message timed out.\n\nThe ServerEvent appears in the \"data\" field of the \"message\" object that the agent receives from its Pub/Sub subscription. The \"data\" field is a base64-encoded string that the agent must decode to match the ServerEvent structure.\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"phoneNumber\": string, \"agentId\": string, \"messageId\": string, \"eventType\": enum (/business-communications/rcs-business-messaging/reference/rest/v1/ServerEvent.EventType), \"eventId\": string, \"sendTime\": string } ``` |\n\n| Fields ||\n|---------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `phoneNumber` | `string` Phone number (in E.164 format) of the user involved in the event. |\n| `agentId` | `string` The agent's unique identifier. Set by RCS Business Messaging. |\n| `messageId` | `string` The RCS message ID of the message that is associated with the event. |\n| `eventType` | `enum (`[ServerEvent.EventType](/business-communications/rcs-business-messaging/reference/rest/v1/ServerEvent.EventType)`)` Type of the event. |\n| `eventId` | `string` A unique event ID assigned for the event instance. |\n| `sendTime` | `string (`[Timestamp](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp)` format)` Time at which the server sends the event. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than \"Z\" are also accepted. Examples: `\"2014-10-02T15:01:23Z\"`, `\"2014-10-02T15:01:23.045123456Z\"` or `\"2014-10-02T15:01:23+05:30\"`. |"]]