Method: spaces.messages.update
メッセージを更新します。patch
メソッドと update
メソッドには違いがあります。patch
メソッドは patch
リクエストを使用し、update
メソッドは put
リクエストを使用します。patch
メソッドを使用することをおすすめします。例については、メッセージを更新するをご覧ください。
次のタイプの認証をサポートしています。
アプリ認証を使用する場合、リクエストで更新できるのは、呼び出し元の Chat アプリによって作成されたメッセージのみです。
HTTP リクエスト
PUT https://chat.googleapis.com/v1/{message.name=spaces/*/messages/*}
この URL は gRPC Transcoding 構文を使用します。
パスパラメータ
パラメータ |
message.name |
string
ID。メッセージのリソース名。 形式: spaces/{space}/messages/{message} ここで、{space} はメッセージが投稿されたスペースの ID、{message} はメッセージにシステムによって割り当てられた ID です。例: spaces/AAAAAAAAAAA/messages/BBBBBBBBBBB.BBBBBBBBBBB メッセージを作成するときにカスタム ID を設定した場合は、{message} を clientAssignedMessageId フィールドの値に置き換えることで、この ID を使用してリクエストでメッセージを指定できます。例: spaces/AAAAAAAAAAA/messages/client-custom-name 。詳しくは、メッセージに名前を付けるをご覧ください。
|
クエリ パラメータ
パラメータ |
updateMask |
string (FieldMask format)
必須。更新するフィールドパス。複数の値をカンマで区切るか、* を使用してすべてのフィールドパスを更新します。 現在サポートされているフィールドパスは次のとおりです。
|
allowMissing |
boolean
省略可。true とメッセージが見つからない場合は、新しいメッセージが作成され、updateMask は無視されます。指定されたメッセージ ID はクライアントが割り当てた ID である必要があります。そうでない場合、リクエストは失敗します。
|
リクエストの本文
リクエストの本文には Message
のインスタンスが含まれます。
レスポンスの本文
成功した場合、レスポンスの本文には Message
のインスタンスが含まれます。
認可スコープ
以下のいずれかの OAuth スコープが必要です。
https://www.googleapis.com/auth/chat.bot
https://www.googleapis.com/auth/chat.import
https://www.googleapis.com/auth/chat.messages
詳しくは、認可ガイドをご覧ください。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-02-27 UTC。
[null,null,["最終更新日 2025-02-27 UTC。"],[[["Updates a Google Chat message using the `PUT` method, preferably with the `patch` approach for partial modifications."],["Requires providing the message's resource name in the URL path for identification."],["Allows specifying fields to update using `updateMask` and supports creating a new message if the original is missing with `allowMissing` set to `true`."],["Authentication can be done using app authentication or user authentication, with app authentication restricting updates to messages created by the calling Chat app."],["Needs authorization with specific OAuth scopes like `chat.bot`, `chat.import`, or `chat.messages`."]]],["This describes updating messages in Google Chat using either `patch` or `put` requests, recommending `patch`. The `PUT` request uses the format `https://chat.googleapis.com/v1/{message.name=spaces/*/messages/*}`. Updating requires specifying the `message.name` path parameter and the `updateMask` query parameter to identify fields to modify. Optional `allowMissing` creates a new message if one is not found. The request and response body are `Message` instances. Authorization requires specific OAuth scopes. App authentication can update messages from the calling app only.\n"]]