Method: spaces.messages.patch
メッセージを更新します。patch
メソッドと update
メソッドには違いがあります。patch
メソッドは patch
リクエストを使用し、update
メソッドは put
リクエストを使用します。patch
メソッドの使用をおすすめします。例については、メッセージを更新するをご覧ください。
次のタイプの認証がサポートされています。
アプリ認証を使用する場合、リクエストで更新できるのは、呼び出し元の Chat アプリによって作成されたメッセージのみです。
HTTP リクエスト
PATCH 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 および関連会社の登録商標です。
最終更新日 2024-11-04 UTC。
[null,null,["最終更新日 2024-11-04 UTC。"],[[["Updates a Google Chat message using the `PATCH` method, preferably over the `update` method which uses `PUT`."],["Supports both app and user authentication, with app authentication limited to updating messages created by the calling Chat app."],["Requires specifying the message to update using its resource name in the URL path and the fields to update using the `updateMask` query parameter."],["Allows creation of a new message if the original is not found when `allowMissing` query parameter is set to `true` and a client-assigned message ID is provided."],["Requires authorization with one of the specified OAuth scopes (`chat.bot`, `chat.import`, or `chat.messages`)."]]],[]]