new_releases 更新: 新機能とサービスの更新については、
リリースノートをご覧ください。
ServerEvent
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
エージェントとユーザー間の会話に関連してサーバーサイドで発生したイベント。
たとえば、ボットがメッセージの TTL を設定し、TTL が期限切れになった場合、このイベントが発生して、ボット メッセージがタイムアウトしたことがパートナーに通知されます。
ServerEvent は、エージェントが Pub/Sub サブスクリプションから受信する「message」オブジェクトの「data」フィールドに表示されます。「data」フィールドは、エージェントが ServerEvent 構造と一致するようにデコードする必要がある base64 でエンコードされた文字列です。
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 メッセージ ID。
|
eventType |
enum (ServerEvent.EventType )
イベントのタイプ。
|
eventId |
string
イベント インスタンスに割り当てられた一意のイベント ID。
|
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\"`. |"]]