Method: spaces.messages.delete
メッセージを削除します。例については、メッセージを削除するをご覧ください。
次のタイプの認証をサポートしています。
アプリ認証を使用する場合、リクエストで削除できるのは、呼び出し元の Chat アプリによって作成されたメッセージのみです。
HTTP リクエスト
DELETE https://chat.googleapis.com/v1/{name=spaces/*/messages/*}
この URL は gRPC Transcoding 構文を使用します。
パスパラメータ
パラメータ |
name |
string
必須。メッセージのリソース名。 形式: spaces/{space}/messages/{message} メッセージにカスタム ID を設定している場合は、{message} に clientAssignedMessageId フィールドの値を使用できます。詳しくは、メッセージに名前を付けるをご覧ください。
|
クエリ パラメータ
パラメータ |
force |
boolean
省略可。true の場合、メッセージを削除すると、スレッド形式の返信も削除されます。false の場合、メッセージにスレッド形式の返信がある場合、削除は失敗します。 ユーザーとして認証する場合にのみ適用されます。Chat アプリとして認証する場合は効果がありません。
|
リクエストの本文
リクエストの本文は空にする必要があります。
レスポンスの本文
成功すると、レスポンスの本文は空の JSON オブジェクトになります。
認可スコープ
以下のいずれかの 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-01-22 UTC。
[null,null,["最終更新日 2025-01-22 UTC。"],[[["This method enables you to delete messages and optionally their replies using an HTTP DELETE request."],["It supports both app and user authentication, with app authentication limiting deletion to messages created by the app."],["You can specify whether to force delete threaded replies with the `force` query parameter when using user authentication."],["The request requires specifying the message's resource name in the URL path and an empty request body."],["Authorization is required using one of the specified OAuth scopes."]]],["This document details how to delete a message using the Chat API. The `DELETE` request targets a specific message's resource name in the format `spaces/*/messages/*`. It supports both app and user authentication, with different limitations for each. The request requires a message's name as a path parameter. A `force` query parameter is optional for user authentication to delete threaded replies. The request body is empty, and a successful response returns an empty JSON object. One of three specified OAuth scopes is required.\n"]]